CNA-BUG-116: DIRECTX9 never resolves multisampled render targets bound as a multiple-render-target set
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.
SetRenderTargets binds each MSAA target's multisample surface but does not track an MRT set, so when the set is unbound no StretchRect resolve runs and the textures keep stale contents.
- Identifier
CNA-BUG-116- Category
- Bug
- Subsystem
- Graphics & renderers
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Severity
- Medium (a triage suggestion, not a project priority)
- Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- GraphicsDevice::SetRenderTargets with two or more multisampled RenderTarget2D bindings on DIRECTX9
Expected behaviour
After a multisampled render target is unbound, sampling it or reading it with GetData must see the resolved result of the draws (DIRECTX9 does this for a single target through ResolveForTransitionEXT).
Actual behaviour at TARGET
DirectX9Renderer.cpp's MRT branch of SetRenderTargets binds GetActiveColorSurfaceEXT() for each target - the multisample surface when MSAA is applied (D3D9RenderTargets.hpp) - then sets currentCustomRT_ = nullptr, with the comment "MRT binds are NOT tracked". The next transition resolves only currentCustomRT_, which is null, so none of the MRT members is StretchRect-resolved into its texture.
Source locations
modules/renderers/directx9/src/DirectX9Renderer.cpp— DirectX9Renderer::SetRenderTargets MRT branch and SetRenderTarget2D resolvemodules/renderers/directx9/include/CNA/Internal/Renderers/DirectX9/D3D9RenderTargets.hpp— GetActiveColorSurfaceEXT returns msaaSurface_ when MSAA is appliedmodules/renderers/directx9/src/D3D9RenderTargets.cpp— D3D9RenderTargetRenderer::ResolveForTransitionEXT
Evidence
Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry. Whether a device grants MSAA on all MRT members depends on D3D9 caps.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
No DIRECTX9 fixture combines MRT and multisampling.
Regression test
An MRT+MSAA fixture on DIRECTX9: draw distinct colours to two 4x-MSAA targets, unbind, read both back.
Blast radius
Deferred and multi-output techniques with MSAA on DIRECTX9; single MSAA targets and non-MSAA MRT sets are unaffected.
Workaround
Use MultiSampleCount 0 for MRT members on DIRECTX9.
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
- Bug index