assets/shaders/default_shader_gl.frag:137-139, :149, :170;
src/Graphics/OpenGL/OpenGLIBL.hpp:29-31; src/Graphics/OpenGL/OpenGLRenderer.cpp:1078, :1073-1076, :835-843, :679
Extends findings #15/#16/#17 with the sampler-unit half of the same contract break.
default_shader_gl.frag is the shader every default material gets (src/Scene/GameObject.cpp:140,
src/Assets/ModelLoader.cpp:449). Declared vs actually bound:
| Resource |
Shader declares |
Renderer binds |
| IBL (irradiance/prefilter/BRDF) |
units 7/8/9 (:137-139) |
units 14/15/16 (OpenGLIBL.hpp:29-31) |
| SSAO |
unit 10 (:149) |
unit 13 (OpenGLRenderer.cpp:1078) |
sampler2DShadow |
unit 11 (:170) |
unit 3 (:779, :1091) |
Not one matches. Worse, the pass pair deferred-lighting → forward/transparent leaves units 8-11 bound to
GBuffer attachments (:1073-1076), so the forward shader's unit-11 sampler2DShadow reads
m_gbufferDepth: which has no GL_TEXTURE_COMPARE_MODE set (:835-843). Sampling a non-compare
texture through a sampler2DShadow is undefined per GL 4.5 §8.22.
This is live, not dormant: ShadowMapEnabled is driven from m_shadowPassEnabled (:679), so the shader
does execute the shadow fetch.
Severity: corruption (undefined GL behavior on every forward draw).
Found by a full audit of the graphics layer. Assessed severity: corruption.
assets/shaders/default_shader_gl.frag:137-139,:149,:170;src/Graphics/OpenGL/OpenGLIBL.hpp:29-31;src/Graphics/OpenGL/OpenGLRenderer.cpp:1078,:1073-1076,:835-843,:679Extends findings #15/#16/#17 with the sampler-unit half of the same contract break.
default_shader_gl.fragis the shader every default material gets (src/Scene/GameObject.cpp:140,src/Assets/ModelLoader.cpp:449). Declared vs actually bound::137-139)OpenGLIBL.hpp:29-31):149)OpenGLRenderer.cpp:1078)sampler2DShadow:170):779,:1091)Not one matches. Worse, the pass pair deferred-lighting → forward/transparent leaves units 8-11 bound to
GBuffer attachments (
:1073-1076), so the forward shader's unit-11sampler2DShadowreadsm_gbufferDepth: which has noGL_TEXTURE_COMPARE_MODEset (:835-843). Sampling a non-comparetexture through a
sampler2DShadowis undefined per GL 4.5 §8.22.This is live, not dormant:
ShadowMapEnabledis driven fromm_shadowPassEnabled(:679), so the shaderdoes execute the shadow fetch.
Severity: corruption (undefined GL behavior on every forward draw).
Found by a full audit of the graphics layer. Assessed severity: corruption.