X Tutup
Skip to content

Move check for sky cubemap array back into the SkyRD initializer#110627

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
clayjohn:RD-intel-mac-sky-check
Sep 19, 2025
Merged

Move check for sky cubemap array back into the SkyRD initializer#110627
Repiteo merged 1 commit intogodotengine:masterfrom
clayjohn:RD-intel-mac-sky-check

Conversation

@clayjohn
Copy link
Member

Fixes: #110589
Regression from #103306

This basically removes the changes from #105424

We need to disable sky_use_cubemap_array as early as possible since it can be read from a few places during initialization of the renderer. However, #103306 caused a crash because it used RenderingServer::get_singleton()->get_video_adapter_name() which isn't available until after the Utilities class is initialized. However, Utilities::get_video_adapter_name() is just a wrapper function for RenderingDevice::get_device_name().

String Utilities::get_video_adapter_name() const {
return RenderingDevice::get_singleton()->get_device_name();
}

So there is no need to access Utilities at all.

In #105424 we moved the check until the end of RendererCompositorRD::initialize() to ensure the RenderingServer was initialized. That fixed the crash, but it caused the graphical artifacts in #110589 because sky_use_cubemap_array was getting set to false after it had been read during initialization. So all our shaders were compiled thinking that sky_use_cubemap_array was true, but then at run time we followed the false path. This is why setting the project setting for sky_use_cubemap_array to false made the graphical artifacts go away.

Since we don't need to rely on RenderingServer::get_singleton()->get_video_adapter_name() after all. We can move the check up to SkyRD() to ensure that it is done on time. Now the code is simpler, more self contained and doesn't cause a crash.

@clayjohn clayjohn added this to the 4.6 milestone Sep 17, 2025
@clayjohn clayjohn requested a review from a team as a code owner September 17, 2025 18:40
@clayjohn clayjohn added bug regression cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Sep 17, 2025
@clayjohn clayjohn requested review from Calinou and bruvzg and removed request for a team September 17, 2025 18:40
…t is set before being used.

Previously it was moved out of this function becuase we relied on RenderingServer::get_video_adapter_name which wasn't available yet.

However, that was unnecessary since it is just a wrapper around RenderingDevice::get_device_name() which is available.
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me (I don't have an Intel Mac to test).

@Repiteo Repiteo merged commit 62273fa into godotengine:master Sep 19, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Sep 19, 2025

Thanks!

@Repiteo
Copy link
Contributor

Repiteo commented Sep 22, 2025

Cherry-picked to 4.5

@Repiteo Repiteo removed the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bad shadows and ilumination with low poly meshes

3 participants

X Tutup