CNA-GAP-033: CNA has no counterpart of XNA's MissingVertexShaderInput draw check, and renderers resolve a stock-effect draw that lacks an input differently

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

✓

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.

XNA refuses a draw whose vertex declaration lacks a semantic the shader reads; CNA has no device-level check, so EasyGL feeds neutral values, WEBGPU substitutes, SDL_GPU and FNA3D throw NotSupportedException and VULKAN aliases TEXCOORD1.

Identifier
CNA-GAP-033
Category
Functional gap
Subsystem
Graphics & renderers
Status
Open
Verified against
CNA c1c316b9 (c1c316b9c7a846ce8002809c151fcd1af14942c9)
Evidence basis
Source-verified: read at TARGET, not executed
Tests touching this area
Yes: see Current tests
Affected contract
GraphicsDevice::DrawPrimitives / DrawIndexedPrimitives / DrawUserPrimitives with a stock effect whose required vertex semantic is missing from the VertexDeclaration

Expected behaviour

The genuine XNA 4.0 GraphicsDevice refuses such a draw with InvalidOperationException (FrameworkResources.MissingVertexShaderInput, reached from its draw-time verification), identically on every device.

Actual behaviour at TARGET

GraphicsDevice::validateDrawState in GraphicsDevice.cpp implements XNA's draw-time float-filtering and blending restrictions but no input check; no source under modules/ implements MissingVertexShaderInput. StockEffectUsesVertexSemantic in IGraphicsRenderer.hpp encodes the per-variant table but decides only which streams are consumed. EasyGL leaves a missing attribute disabled and reads the (0, 0, 0, 1) neutral record, except that a lit BasicEffect draw whose declaration names no Normal is now drawn unlit (StockLightingFollowsDeclarationEXT, AM4-056); WEBGPU's SelectStockVertexShapeEXT falls back from EnvironmentMapEffect without NORMAL0/TEXCOORD0 to a BasicEffect shape and sends alpha-test or dual-texture draws without TEXCOORD0 to the stride-16 coloured path; SDL_GPU throws NotSupportedException for those cases (std::invalid_argument for SkinnedEffect); VULKAN aliases TEXCOORD1 onto TEXCOORD0 for DualTextureEffect where the others read (0, 0). FNA3D, on every driver but OpenGL, now checks a stock draw against the inputs the selected XNA stock vertex shader reads and throws NotSupportedException naming the missing input (RequireStockVertexInputsDeclared in Fna3dDraw.cpp, AM4-190), because its Metal and SDL_GPU drivers otherwise fail the pipeline and crash; that is a renderer refusal with a different exception type, not XNA's device-level InvalidOperationException.

Source locations

Evidence

Checked by reading at c1c316b9 and the XNA 4.0 Graphics IL in the reference cache (MissingVertexShaderInput and its details string); not executed. The per-renderer outcomes are spot-checked at the named functions, not traced for every effect variant.

Re-verified at c1c316b9: read GraphicsDevice::validateDrawState, EasyGL's StockLightingFollowsDeclarationEXT (AM4-056), FNA3D's RequireStockVertexInputsDeclared (AM4-190), WebGPU's SelectStockVertexShapeEXT and Vulkan's BuildDualTextureVertexLayoutEXT; not executed.

Focused reproduction

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

Current tests

Stock-effect tests draw with complete declarations; none asserts XNA's refusal for a missing input. GltfStrideAndBufferTests.cpp accepts FNA3D's named refusal (FNA3D-MISSING-STOCK-INPUT) as an outcome.

Regression test

A renderer-independent test per stock effect variant that draws with a declaration missing one required semantic and expects InvalidOperationException before the renderer is reached.

Blast radius

Code that XNA would reject: it runs with renderer-dependent results in CNA. Correct XNA code is unaffected.

Workaround

Test ports on a reference renderer and supply every semantic the stock effect reads.

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