From dd8bab9f8908ba0c05c181bcde26d463b7c3a131 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 4 Sep 2025 00:33:24 +0200 Subject: [PATCH] Fix shader compilation errors in Compatibility when using `depth_texture` Globals were defined too early, which means some uniforms were not available at the point they were defined in. --- drivers/gles3/shaders/scene.glsl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 2814f41c37..d99fd5563c 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1022,12 +1022,6 @@ uniform highp mat4 world_transform; uniform highp uint instance_offset; uniform highp uint model_flags; -/* clang-format off */ - -#GLOBALS - -/* clang-format on */ - #define LIGHT_BAKE_DISABLED 0u #define LIGHT_BAKE_STATIC 1u #define LIGHT_BAKE_DYNAMIC 2u @@ -1268,6 +1262,12 @@ layout(location = 0) out vec4 frag_color; #endif // !RENDER_MATERIAL +/* clang-format off */ + +#GLOBALS + +/* clang-format on */ + vec3 F0(float metallic, float specular, vec3 albedo) { float dielectric = 0.16 * specular * specular; // use albedo * metallic as colored specular reflectance at 0 angle for metallic materials;