CNA-GAP-022: DIRECTX9 ignores mipMap for RenderTarget2D (single level, GetData above level 0 throws) and ignores the MSAA request for RenderTargetCube
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.
CreateRenderTarget2D discards the mipMap argument and CreateRenderTargetCube discards mipMap and multiSampleCount, so mip chains are never generated and cube targets are never multisampled on DIRECTX9.
- Identifier
CNA-GAP-022- 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
- RenderTarget2D(mipMap = true) and RenderTargetCube(multiSampleCount > 0) on DIRECTX9
Expected behaviour
XNA generates a render target's mip chain when it is unbound (mipMap = true) and multisamples cube targets on HiDef devices that support it.
Actual behaviour at TARGET
DirectX9Renderer.cpp's CreateRenderTarget2D takes bool /*mipMap*/ and creates a single-level target; CreateRenderTargetCube ignores mipMap and multiSampleCount (its header note in D3D9RenderTargets.hpp records both as deliberate named gaps). D3D9RenderTargets.cpp's D3D9RenderTargetRenderer::GetData throws NotSupportedException for level > 0. The public RenderTarget2D and RenderTargetCube constructors still pass the full requested chain (CalculateMipLevels) to their Texture base, so LevelCount reports the requested chain while one level exists; GetData(level > 0) therefore passes the shared range check and is refused only by the renderer. The public MultiSampleCount of a cube target reports the renderer's real value (0), so that part is not misreported.
Source locations
modules/renderers/directx9/src/DirectX9Renderer.cpp— CreateRenderTarget2D and CreateRenderTargetCube parametersmodules/renderers/directx9/src/D3D9RenderTargets.cpp— D3D9RenderTargetRenderer::GetData level check
Evidence
Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry. Whether the public LevelCount of such a target reports the requested chain was not traced.
Independent re-verification: Checked by reading the named sources at 009d40f5 and the XNA IL (RenderTargetHelper.CreateSurfaces creates a multisampled surface for cube targets as well); nothing was built or executed for this entry. Checks S, T and U of directx9_smoke_test.cpp exercise the DX9 render-target classes but only with mipMap = false and no cube MSAA, so no test requests a mip chain or reads a lower level.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
No DIRECTX9 fixture samples a render target's lower mip levels.
Regression test
A DIRECTX9 fixture that renders into a mipMap target, unbinds and samples level 1.
Blast radius
Bloom, down-sampling and distance-sampled render targets on DIRECTX9.
Workaround
Down-sample manually into smaller targets.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- Deep dives
- Direct3D 9 fidelity: render targets
- Known issues
- Functional gap index