godot icon indicating copy to clipboard operation
godot copied to clipboard

Fix shader type detection

Open bitsawer opened this issue 2 years ago • 0 comments

  • Fixes https://github.com/godotengine/godot/issues/78482

The problem was that get_shader_type() was called too early, before the preprocessing step. This PR moves the check after the preprocessing and uses the preprocessed shader code to figure out the shader_type. This makes sure the shader compiler only sees valid shader code that has all preprocessor statements removed, so that get_shader_type() can correctly parse the code and figure out the type. Previously, any preprocessor statements before the shader_type xyz; would cause a silent parsing failure and the shader type would default to spatial.

bitsawer avatar Jul 10 '23 13:07 bitsawer