CNA-GAP-015: Only BasicEffect exposes XNA's parameter graph and technique name; the other stock effects still lack texture or light parameters and carry a Default technique
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 3b43bd86; 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 DirLight*, SkinnedEffect lacks Texture/DirLight*; these effects carry a Default technique and WorldInverseTranspose keeps a 4x4 shape.
- Identifier
CNA-GAP-015- Category
- Functional gap
- Subsystem
- Graphics & renderers
- Status
- Narrowed (partially fixed; describes only what survives)
- Verified against
- CNA
3b43bd86(3b43bd8687ed46523d873f9bec4b32bd8481dcb5) - 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 declare their parameters with AddStockParameterInternal: AlphaTest and DualTexture publish only numeric parameters (no Texture, no Texture2), EnvironmentMap publishes Texture and EnvironmentMap but no DirLight0..2, and Skinned publishes Bones and the numeric parameters but no Texture or DirLight0..2, so Parameters["Texture"] on AlphaTest, DualTexture or Skinned returns null. These effects are built on Effect(GraphicsDevice&), whose single technique is named "Default" (BasicEffect alone passes a stock technique name). WorldInverseTranspose is still declared 4x4 where XNA's .fx uses float3x3.
Fixed since first recorded: d650554a8 (CNA-DEMOS-ISSUE-034/035) added Texture and EnvironmentMap to EnvironmentMapEffect and made SkinnedEffect's Bones 72 coherent 4x3 matrix views, as XNA's float4x3[72], pinned by StockBoneParameterTest in StockParameterContractTests.cpp.
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 3b43bd86; 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.
Re-verified at c6dec91f: the four CacheEffectParameters functions were re-read after d650554a8; the parameters named above are still absent and the copy constructors still use Effect(*src.device_). Not executed.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
StockParameterContractTests.cpp pins scalar shapes and the Bones views; stock-effect tests otherwise use the typed properties, and 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