CNA-GAP-020: SDL_GPU accepts ShaderEffect GLSL only in Vulkan-rule form (#version 450, explicit locations and SDL_gpu sets), so the shared GLSL ES 3.00 .cnj effect fixture does not load there

CNA snapshot c1c316b9  ·  Known Issues › Functional gaps  ·  source links pinned to c1c316b9

✓

Evidence basis: source-verified at the pinned commit; recorded by CNA's own run (not repeated here); tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit c1c316b9; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.

SdlGpuEffectRenderer::CompileProgram passes GLSL to libshaderc for SPIR-V, which rejects GLSL ES 3.00 sources and implicit uniform bindings; CNA's portable .cnj effect fixture is written in GLSL ES 3.00.

Identifier
CNA-GAP-020
Category
Functional gap
Subsystem
Graphics & renderers
Status
Open
Verified against
CNA c1c316b9 (c1c316b9c7a846ce8002809c151fcd1af14942c9)
Evidence basis
Recorded by CNA: CNA's own recorded run, not repeated here
Tests touching this area
Yes: see Current tests
Affected contract
ShaderEffect construction from GLSL source and ContentManager::Load of GLSL .cnj effects on SDL_GPU

Expected behaviour

A .cnj effect names GLSL source files; which dialect each renderer accepts is part of its contract (GetShaderDialectEXT).

Actual behaviour at TARGET

SdlGpuRenderer.cpp's SdlGpuEffectRenderer::CompileProgram accepts SPIR-V words directly or, when built with CNA_SDL_GPU_SHADER_EFFECTS, passes GLSL source unchanged to libshaderc for Vulkan-rule SPIR-V and declares one uniform buffer per stage and one fragment sampler to SDL_gpu. The renderer declares ShaderDialectEXT::SpirV and claims no GLSL language, deliberately, because the GLSL ES 3.00 profile is not a legal input on that route. The fixture in CnjEffectTests.cpp uses #version 300 es sources with a non-block uniform, which that route refuses; custom GLSL effects for SDL_GPU must follow Vulkan GLSL rules (for example #version 450) with explicit locations, uniform blocks and SDL_gpu's sets.

Source locations

Evidence

Checked by reading the named sources at c1c316b9; nothing was built or executed for this entry. The GLSL ES rejection is the chapter package's reading of the SDL_GPU route; glslang's refusal of ES 3.00 for SPIR-V generation was not re-run here.

Independent re-verification: Checked by reading the named sources at c1c316b9; nothing was built or executed for this entry. CNA's own plan (plan_sdlgpu_modern_graphics.md) records the measured libshaderc refusal of the GLSL ES 3.00 profile on SDL_GPU (ES shaders for SPIR-V require version 310 or higher; SPIR-V requires location for user input/output; non-opaque uniforms outside a block are not allowed for Vulkan GLSL), and the fixture's sources use the same constructs. Tests: SDL_GPU's own ShaderEffect fixtures use #version 450; CnjEffectTests is not run against SDL_GPU in any workflow.

Re-verified at c1c316b9: read SdlGpuEffectRenderer::CompileProgram and CnjEffectTests' ExpectedGlslEffectValidity; not executed. Since AM4-177 the predicate expects any renderer that declares a non-GLSL dialect (HLSL, MSL, WGSL or SPIR-V) to refuse the shared GLSL fixture, so CNA's own test now treats this refusal on SDL_GPU as the contract.

Focused reproduction

No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.

Current tests

SDL_GPU ShaderEffect fixtures use its own dialect. CnjEffectTests.cpp loads the shared GLSL ES fixture on whatever renderer the test binary runs, and its ExpectedGlslEffectValidity expects the effect to be invalid on a renderer that declares SPIR-V (AM4-177), so on SDL_GPU it pins the refusal, not a translation; no workflow runs it against SDL_GPU.

Regression test

A test that asserts the documented refusal (or a translation) for GLSL ES 3.00 on SDL_GPU.

Blast radius

Content pipelines that ship one GLSL ES effect for all GL-family and SDL_GPU targets.

Workaround

Ship a separate Vulkan-rule GLSL (or SPIR-V) variant for SDL_GPU.

The same subject is explained at several altitudes. These are the neighbouring pages at each one.