CNA-BUG-012: GraphicsDeviceCapabilityTest's catch-all expectations are still wrong for STUB and for Linux SDL_GPU builds without libshaderc
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 c1c316b9; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
ExpectedCapabilities() now has an SDL_GPU arm, but on Linux it keeps the catch-all custom-effects expectation true although an SDL_GPU build without libshaderc answers false, and STUB, which answers false to every capability, still takes the all-true default.
- Identifier
CNA-BUG-012- Category
- Bug
- Subsystem
- Testing & evidence
- Status
- Narrowed (partially fixed; describes only what survives)
- Verified against
- CNA
c1c316b9(c1c316b9c7a846ce8002809c151fcd1af14942c9) - Severity
- Low (a triage suggestion, not a project priority)
- Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- GraphicsDeviceCapabilityTest.SupportsOcclusionQuery, SupportsCustomEffects and SupportsMultipleRenderTargets (ExpectedCapabilities())
Expected behaviour
A renderer that truthfully reports a capability as false should pass the shared capability suite. ExpectedCapabilities() in GraphicsDeviceCapabilityTests.cpp exists to state each renderer's accepted boundary, so every renderer whose answers differ from the all-true catch-all needs an arm that says so.
Actual behaviour at TARGET
ExpectedCapabilities() has explicit arms for FNA3D, SOFTWARE, SDL_RENDERER and SDL_GPU; every other renderer takes default: return {true, true, true}. The SDL_GPU arm expects occlusion queries false everywhere and custom effects false on Apple, Windows and Emscripten, but on other hosts it keeps the default true, because whether the build found libshaderc is visible only to the renderer target (CNA_SDL_GPU_SHADER_EFFECTS is a private definition) and SdlGpuRenderer::SupportsCapability(CustomEffects) answers false without it; SupportsCustomEffects therefore fails in a Linux SDL_GPU build without libshaderc. STUB answers false to every capability (StubRenderer::SupportsCapability) and still takes the catch-all, so SupportsOcclusionQuery, SupportsCustomEffects and the HiDef half of SupportsMultipleRenderTargets expect true on STUB.
Source locations
modules/graphics/tests/Microsoft/Xna/Framework/Graphics/GraphicsDeviceCapabilityTests.cpp— ExpectedCapabilities(): the SDL_GPU arm and the default arm; SupportsOcclusionQuery, SupportsCustomEffects, SupportsMultipleRenderTargetsmodules/renderers/sdl-gpu/CMakeLists.txt— CNA_SDL_GPU_SHADER_EFFECTS: a private definition, only with a target-native libshadercmodules/renderers/sdl-gpu/src/SdlGpuRenderer.cpp— SdlGpuRenderer::SupportsCapability: CustomEffects follows CNA_SDL_GPU_SHADER_EFFECTSmodules/renderers/stub/include/CNA/Internal/Renderers/Stub/StubRenderer.hpp— StubRenderer::SupportsCapability returns false for every capability
Evidence
Checked by reading at c1c316b9; not executed. CNA's records show the catch-all failing five cases under STUB (integration/BATCH_1_STABILIZATION.md); no CNA record of GraphicsDeviceCapabilityTest.* in a Linux SDL_GPU build without libshaderc was found.
Narrowed at c1c316b9: bb9250261 (AM4-070) rewrote sdlgpu_occlusionquery_limitation_test.cpp to assert the public constructor's NotSupportedException and the renderer's exact message at its own query factory, so that test no longer contradicts the renderer; e5a943e0d (AM4-175) gave ExpectedCapabilities() its SDL_GPU arm (occlusion queries false everywhere, custom effects false on Apple, Windows and Emscripten); and METAL now answers true for all three capabilities (MetalPolicy.hpp), so the catch-all describes it. Read at c1c316b9; not executed.
Focused reproduction
# Not executed for this entry. A Linux SDL_GPU build with tests and without libshaderc, or a STUB build with tests:
ctest --test-dir <build> -R 'GraphicsDeviceCapabilityTest\.Supports(CustomEffects|OcclusionQuery|MultipleRenderTargets)$' --output-on-failure
Current tests
GraphicsDeviceCapabilityTests.cpp (per-renderer expectations; its MRT case also compares the capability with a real two-target bind) and sdlgpu_occlusionquery_limitation_test.cpp (now consistent with the renderer). Nothing checks that ExpectedCapabilities() has an arm for every renderer whose answers differ from the catch-all.
Regression test
Give ExpectedCapabilities() an explicit STUB arm (all false), and let the SDL_GPU arm see whether the shader-effect route was built (a public compile definition, or ask the renderer's custom-effect intake directly). A structural guard in the style of TheMultipleRenderTargetCapabilityMatchesWhatBindingActuallyDoes for CustomEffects would catch the next mismatch.
Blast radius
Test evidence only; renderer behaviour is correct. STUB runs of the shared capability suite and Linux SDL_GPU runs without libshaderc report failures that are not renderer defects, which inflates their failure counts and can hide real regressions among them.
Workaround
When triaging such a run, treat these failures as test defects.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- User guide
- Graphics renderers: capability reporting
- Maintainer workflow
- Fix a renderer bug: prove it
- Tests and validation
- Test architecture: GPU tests
- Known issues
- Bug index