CNA-VGAP-003: No test pins EffectParameter's divergences for CNA-constructed parameters, including a SetValue(Texture*) that GetValueTexture2D() does not read back

CNA snapshot 009d40f5  ·  Known Issues › Verification 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.

Parameters without compiled storage keep separate base and typed texture slots and refuse numeric access only for Object-class parameters; the C API smoke test exercises the lenient string, numeric and texture setters, but no test pins that a texture set through the base overload reads back as null, or that the numeric refusal is by class rather than by storage.

Identifier
CNA-VGAP-003
Category
Verification 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
Microsoft::Xna::Framework::Graphics::EffectParameter SetValue/GetValue on stock-effect and standalone parameters

Expected behaviour

XNA rejects mismatched parameter access with InvalidCastException; CNA does so for compiled effects (FX-089/FX-105) and deliberately keeps a lenient mode for CNA-constructed parameters, which the C API's standalone-parameter tests rely on.

Actual behaviour at TARGET

In EffectParameter.cpp, RequireNumericParameter runs first in every numeric accessor and refuses only Object-class parameters, whether or not the parameter has compiled storage, so its comment's carve-out for CNA-constructed parameters is really a class rule: a CNA-constructed Object-class parameter still refuses numeric access. When compiledStorage_ is null nothing else is checked: SetValue(const std::string&) stores the string whatever the record's type, numeric setters write floatData_ whatever the class, and SetValue(Texture*) writes textureData_ while GetValueTexture2D() returns texture2DData_, so a texture set through the base-class overload reads back as null (the header records the separate texture slots as an out-of-scope API-shape decision, Task 863).

Source locations

Evidence

Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry.

Independent re-verification: Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry. Tests: EffectTests.cpp and CompiledEffectConformance.hpp cover compiled-mode checks; EffectParameterTests.cpp covers typed round trips only; EffectParameterSmoke.c (CApi_EffectParameterSmoke) sets a string, matrices, quaternions and textures on a standalone Vector/Single parameter but always sets the typed texture slot before reading it back, and no test asserts the Object-class numeric refusal or the base-overload read-back result.

Focused reproduction

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

Current tests

EffectTests.cpp and CompiledEffectConformance.hpp cover compiled-mode checks; EffectParameterTests.cpp does not cover the lenient paths above.

Regression test

Tests that pin the lenient contract explicitly: string on a numeric stock parameter, SetValue(Texture*) followed by each typed getter.

Blast radius

Code that manipulates stock-effect parameters generically; a mistake that XNA reports is silently accepted.

Workaround

No workaround is known.

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