CNA-GAP-011: PresentationParameters.RenderTargetUsage is stored, cloned and exposed but never consulted by GraphicsDevice
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.
Only a render target's own usage is read (in SetRenderTargets); the back buffer's RenderTargetUsage has no effect when SetRenderTargets returns to the back buffer.
- Identifier
CNA-GAP-011- 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
- Microsoft::Xna::Framework::Graphics::PresentationParameters::RenderTargetUsage
Expected behaviour
XNA exposes PresentationParameters.RenderTargetUsage as the back buffer's contents policy (DiscardContents by default, PreserveContents to keep its pixels across a render-target switch).
Actual behaviour at TARGET
The property is stored and cloned in PresentationParameters.cpp and copied by the C API and the device-information equality code, but the only getRenderTargetUsageProperty() call in GraphicsDevice.cpp reads the first bound render target's usage. Whatever the back buffer's contents are after a switch is decided by each renderer, independent of the requested value.
Source locations
modules/graphics/src/Xna/PresentationParameters.cpp— renderTargetUsage_ storagemodules/graphics/src/Xna/GraphicsDevice.cpp— GraphicsDevice::SetRenderTargets (reads only the bound target's usage)
Evidence
Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry. What each renderer actually does with the back buffer across a switch was not surveyed.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
No test sets the back buffer's RenderTargetUsage and checks its contents after a render-target pass.
Regression test
A fixture that draws to the back buffer, renders to a target, returns, and checks the earlier pixels with PreserveContents (kept) and DiscardContents (XNA's documented discard).
Blast radius
Games that request PreserveContents for the back buffer to keep drawing across render-target passes.
Workaround
Render the scene into your own render target and draw it to the back buffer each frame.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- Deep dives
- Render targets: usage
- Known issues
- Functional gap index