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.
This commit is contained in:
Hugo Locurcio 2025-09-04 00:33:24 +02:00
parent 6c9aa4c7d3
commit dd8bab9f89
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C

View file

@ -1022,12 +1022,6 @@ uniform highp mat4 world_transform;
uniform highp uint instance_offset; uniform highp uint instance_offset;
uniform highp uint model_flags; uniform highp uint model_flags;
/* clang-format off */
#GLOBALS
/* clang-format on */
#define LIGHT_BAKE_DISABLED 0u #define LIGHT_BAKE_DISABLED 0u
#define LIGHT_BAKE_STATIC 1u #define LIGHT_BAKE_STATIC 1u
#define LIGHT_BAKE_DYNAMIC 2u #define LIGHT_BAKE_DYNAMIC 2u
@ -1268,6 +1262,12 @@ layout(location = 0) out vec4 frag_color;
#endif // !RENDER_MATERIAL #endif // !RENDER_MATERIAL
/* clang-format off */
#GLOBALS
/* clang-format on */
vec3 F0(float metallic, float specular, vec3 albedo) { vec3 F0(float metallic, float specular, vec3 albedo) {
float dielectric = 0.16 * specular * specular; float dielectric = 0.16 * specular * specular;
// use albedo * metallic as colored specular reflectance at 0 angle for metallic materials; // use albedo * metallic as colored specular reflectance at 0 angle for metallic materials;