Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DummyShader handling to Dummy RenderingServer to ensure shader parameters are saved in headless export #87392

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

clayjohn
Copy link
Member

Supersedes: #76121

Fixes #66842 (including the MRP in #76121 (comment))

This introduces the minimal set of logic needed by get_shader_parameter_list() which is used by materials to figure out what shader parameters need to be exported.

We can get away with a single shader compiler for all shader types since we don't care about the generated code, we just need the uniforms.

Also, we need to validate the existence of RendererSceneOcclusionCull::get_singleton() in RendererSceneCull::free() now since that gets called to free certain shaders.

Copy link
Contributor

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

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

LGTM, interesting use case, I think we would have run into this in the XR team as we're working on using CI to build APKs for standalone VR devices.

@YuriSizov YuriSizov merged commit 344fe62 into godotengine:master Jan 24, 2024
16 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

@clayjohn clayjohn deleted the dummy-shader branch January 24, 2024 19:20
@nikitalita
Copy link
Contributor

nikitalita commented Feb 10, 2024

The dummy renderer sets low_end to true, which is checked by ShaderCompiler/ShaderLanguage when compiling the shader. Won't this fail to compile the shaders if it uses high-end-only built-in functions and such?

@nikitalita
Copy link
Contributor

Yup:

SHADER ERROR: Built-in function "findLSB(int)" is only supported on high-end platforms.
          at: (null) (:26)
ERROR: Shader compilation failed.
   at: shader_set_code (servers/rendering/dummy/storage/material_storage.cpp:90)

And when it fails to compile, it obliterates the shader parameters, too:

image

@akien-mga
Copy link
Member

Cherry-picked for 4.2.2.

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.

Shader parameters specified in the inspector are not included when exporting a project in headless mode
6 participants