CNA-GAP-075: Compiled XNA effects whose pixel shaders use BEM, TEXDEPTH, TEXDP3, TEXDP3TEX, TEXM3X2DEPTH or TEXREG2AR/GB/RGB cannot run on SDL_GPU, WEBGPU or FNA3D's SDL_GPU driver
Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 3b43bd86; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
MojoShader's SPIR-V profile, which CNA's SDL_GPU and WEBGPU compiled effects and FNA3D's SDL_GPU driver use, refuses these eight shader model 1.x instructions by name ('... unimplemented in spirv profile'); its GLSL profile translates them, so the same effects run on EasyGL and on FNA3D's OpenGL driver.
- Identifier
CNA-GAP-075- Category
- Functional gap
- Subsystem
- Graphics & renderers
- Status
- Open
- Verified against
- CNA
3b43bd86(3b43bd8687ed46523d873f9bec4b32bd8481dcb5) - Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- Compiled XNA 4.0 effects (Effect from .xnb or .fxb) whose pixel shaders use the shader model 1.x instructions BEM, TEXDEPTH, TEXDP3, TEXDP3TEX, TEXM3X2DEPTH, TEXREG2AR, TEXREG2GB or TEXREG2RGB, on the SDL_GPU and WEBGPU compiled-effect routes and on the FNA3D renderer's SDL_GPU driver
Expected behaviour
A compiled effect XNA 4.0 runs should run on every renderer that reports GraphicsCapability::CompiledEffects, or be refused with its reason up front. CNA's EasyGL and SOFTWARE compiled-effect routes execute the complete pixel shader model 1.x instruction set (software-easygl-parity-ledger.md), and the bump-environment work of this snapshot (725481a1e) made a pass's BUMPENVMAT state reach FNA3D's drivers.
Actual behaviour at TARGET
In the MojoShader fork CNA builds (libcna/mojoshader at 03b686fe1a33, the revision the pinned FNA3D fork records; ThirdPartyFNA3D.cmake), profiles/mojoshader_profile_spirv.c declares BEM, TEXDEPTH, TEXDP3, TEXDP3TEX, TEXM3X2DEPTH, TEXREG2AR, TEXREG2GB and TEXREG2RGB through EMIT_SPIRV_OPCODE_UNIMPLEMENTED_FUNC, which fails the translation with “op unimplemented in spirv profile”. The GLSL profile implements all eight (the comment above the SPIR-V list, “unimplemented even in the GLSL emitter”, is out of date). The SPIR-V profile is the one CNA's SDL_GPU compiled effects use, the one CNA's WEBGPU compiled effects translate to WGSL from, and the one FNA3D's SDL_GPU driver uses; handoff.md section 5.2 (“MojoShader SPIR-V gaps”) records the refusal for the ps_1_4 BEM and TEXDEPTH, and the six ps_1_2/ps_1_3 texture-addressing instructions take the same failure path. An effect that uses any of them runs on EasyGL's and SOFTWARE's compiled effects and on FNA3D's OpenGL driver, but cannot run on SDL_GPU (the default renderer on Windows, macOS and iOS), on WEBGPU, or on FNA3D with its default SDL_GPU driver.
Source locations
handoff.md— section 5.2: MojoShader SPIR-V gaps, ps_1_4 BEM and TEXDEPTH refuse by name; GLSL implements bothcmake/ThirdPartyFNA3D.cmake— the libcna/FNA3D fork pin, whose MojoShader submodule is the fork revision read heremodules/renderers/sdl-gpu/tests/CNA/Internal/Renderers/SdlGpu/SdlGpuCompiledEffectTests.cpp— SdlGpuCompiledEffectDrawTest.SharedLegacyBumpEnvironmentContract accepts the SPIR-V refusal of the BEM leg by namemodules/renderers/webgpu/tests/CNA/Internal/Renderers/WebGPU/WebGPUCompiledEffectTests.cpp— WebGPUCompiledEffectDrawTest.SharedLegacyBumpEnvironmentContract, the same contract on WEBGPUdocs/software-easygl-parity-ledger.md— EasyGL and SOFTWARE compiled effects: complete pixel shader model 1.x
Evidence
Read at 3b43bd86 and in a clone of the MojoShader fork at 03b686fe1a33: the unimplemented-opcode list at the end of profiles/mojoshader_profile_spirv.c and the eight emit_GLSL_* implementations in profiles/mojoshader_profile_glsl.c. The BEM and TEXDEPTH refusals are recorded by CNA (handoff.md, and commit c8b8e0aa0, whose tests accept the BEM refusal on SPIR-V routes); the other six are by reading only. Nothing was built or executed for this entry.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
SdlGpuCompiledEffectDrawTest.SharedLegacyBumpEnvironmentContract and its WEBGPU twin accept the SPIR-V refusal of the ps_1_4 BEM leg by name and check TEXBEM/TEXBEML by pixels. No test covers the other seven instructions on a SPIR-V route.
Regression test
The shared bump-environment contract and one fixture per remaining instruction, run on SDL_GPU and WEBGPU, drawing XNA's pixels once the SPIR-V profile implements them.
Blast radius
XNA games whose compiled effects use shader model 1.x bump-environment, depth-replacement or texture-addressing instructions, on SDL_GPU, WEBGPU and FNA3D's SDL_GPU driver. Shader model 2.0 and 3.0 effects, CNA's stock effects and the GLSL-based routes are unaffected.
Workaround
Use EasyGL, SOFTWARE or FNA3D with its OpenGL driver for such effects, or recompile them for shader model 2.0 or later.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- User guide
- Effects
- Deep dives
- Compiled effects semantics
- Known issues
- Functional gap index