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 009d40f5  ·  Known Issues › Functional gaps  ·  source links pinned to 009d40f5

✓

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 009d40f5; 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 such check, so EasyGL/OPENGL4 feed neutral values, WEBGPU substitutes, SDL_GPU throws and VULKAN aliases TEXCOORD1.

Identifier
CNA-GAP-033
Category
Functional gap
Subsystem
Graphics & renderers
Status
Open
Verified against
CNA 009d40f5 (009d40f5dd085c4e674d3479675fac84b12b3e0a)
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 and OPENGL4 leave a missing attribute disabled and read the (0, 0, 0, 1) neutral record; 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).

Source locations

Evidence

Checked by reading at 009d40f5 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.

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 a refusal for a missing input.

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.