CNA-GAP-015: Only BasicEffect exposes XNA's parameter graph and technique name; the other stock effects publish partial, hand-built parameter tables
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.
AlphaTestEffect lacks Texture, DualTextureEffect lacks Texture/Texture2, EnvironmentMapEffect lacks Texture/EnvironmentMap/DirLight*, SkinnedEffect lacks Texture/DirLight*; these effects carry a 'Default' technique and some parameter shapes differ from XNA's.
- Identifier
CNA-GAP-015- 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
- Effect::getParametersProperty() and CurrentTechnique of AlphaTestEffect, DualTextureEffect, EnvironmentMapEffect, SkinnedEffect
Expected behaviour
XNA 4.0's stock effects cache the parameters of their compiled effect (IL of each CacheEffectParameters): Texture for AlphaTest; Texture and Texture2 for DualTexture; Texture, EnvironmentMap and DirLight0..2 for EnvironmentMap; Texture and DirLight0..2 (with specular) for Skinned. Code can read or set them through Parameters[name].
Actual behaviour at TARGET
CNA's AlphaTestEffect.cpp, DualTextureEffect.cpp, EnvironmentMapEffect.cpp and SkinnedEffect.cpp add only numeric parameters with AddParam; the texture and light parameters above are absent, so Parameters["Texture"] returns null. These effects are built on Effect(GraphicsDevice&), whose single technique is named "Default" (BasicEffect alone passes a stock technique name). The chapter package also recorded shape differences (WorldInverseTranspose declared 4x4 where XNA's .fx uses float3x3; Bones as 72 four-column rows rather than float4x3[72]).
Source locations
modules/graphics/src/Xna/AlphaTestEffect.cpp— AlphaTestEffect::CacheEffectParametersmodules/graphics/src/Xna/EnvironmentMapEffect.cpp— EnvironmentMapEffect::CacheEffectParametersmodules/graphics/src/Xna/SkinnedEffect.cpp— SkinnedEffect::CacheEffectParameters (Bones rows)modules/graphics/src/Xna/BasicEffect.cpp— BasicEffect uses the stock-technique constructor
Evidence
Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry. XNA parameter names read from the genuine XNA 4.0 Graphics IL. The typed properties (Texture, EnvironmentMap, lights) work; only the generic parameter surface is incomplete.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
Stock-effect tests use the typed properties; none enumerates Parameters against XNA's list.
Regression test
A table-driven test per stock effect comparing parameter names, classes, types and shapes with XNA's (a generated list from the XNA IL).
Blast radius
Code that manipulates stock effects generically through Parameters (editors, material systems, serializers).
Workaround
Use the typed properties.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- Deep dives
- Effect object model: stock parameters
- Known issues
- Functional gap index