Fixing shader compilation error when writing to FOG when render_mode fog_disabled.

Always declares FOG variable regardless of fog state. Previously, only declared
fog if FOG_DISABLED was undefined. This caused errors if the code tried to
write to fog later. Exists as a dummy variable when unused.

Signed-off-by: Joshua Rothe <joshrothe@gmail.com>
(cherry picked from commit 7a2f188382)
This commit is contained in:
Joshua Rothe
2026-01-16 02:12:52 -07:00
committed by Thaddeus Crews
parent 715bd0794a
commit 795a61dbb3
3 changed files with 0 additions and 8 deletions
-2
View File
@@ -2026,9 +2026,7 @@ void main() {
#ifdef PREMUL_ALPHA_USED
float premul_alpha = 1.0;
#endif // PREMUL_ALPHA_USED
#ifndef FOG_DISABLED
vec4 fog = vec4(0.0);
#endif // !FOG_DISABLED
#if defined(CUSTOM_RADIANCE_USED)
vec4 custom_radiance = vec4(0.0);
#endif
@@ -1237,9 +1237,7 @@ void fragment_shader(in SceneData scene_data) {
float anisotropy = 0.0;
vec2 anisotropy_flow = vec2(1.0, 0.0);
vec3 energy_compensation = vec3(1.0);
#ifndef FOG_DISABLED
vec4 fog = vec4(0.0, 0.0, 0.0, 1.0);
#endif // !FOG_DISABLED
#if defined(CUSTOM_RADIANCE_USED)
vec4 custom_radiance = vec4(0.0);
#endif
@@ -1155,9 +1155,7 @@ void main() {
#ifdef PREMUL_ALPHA_USED
float premul_alpha_highp = 1.0;
#endif
#ifndef FOG_DISABLED
vec4 fog_highp = vec4(0.0);
#endif // !FOG_DISABLED
#if defined(CUSTOM_RADIANCE_USED)
vec4 custom_radiance_highp = vec4(0.0);
#endif
@@ -1296,9 +1294,7 @@ void main() {
#ifdef PREMUL_ALPHA_USED
half premul_alpha = half(premul_alpha_highp);
#endif
#ifndef FOG_DISABLED
hvec4 fog = hvec4(fog_highp);
#endif
#ifdef CUSTOM_RADIANCE_USED
hvec4 custom_radiance = hvec4(custom_radiance_highp);
#endif