CNA-BUG-102: On DIRECTX9, SetContextRecoveryEnabled and SetStringMarkerEXT throw 'not yet implemented', and GraphicsDevice has already changed the recovery flag when the first one throws
Evidence basis: source-verified at the pinned commit. 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.
DirectX9Renderer overrides both hooks with NotYetImplemented (std::runtime_error); GraphicsDevice::SetContextRecoveryEnabled stores the flag before forwarding, so the device's Texture2D shadow policy changes even though the call failed.
- Identifier
CNA-BUG-102- Category
- Bug
- Subsystem
- Graphics & renderers
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Severity
- Low (a triage suggestion, not a project priority)
- Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- None
- Affected contract
- GraphicsDevice::SetContextRecoveryEnabled(bool) and GraphicsDevice::SetStringMarkerEXT(const std::string&) on the DIRECTX9 renderer
Expected behaviour
A setter that throws should leave the object unchanged. A debug string marker is advisory on every other renderer (the interface default is a no-op), so a renderer that cannot place one would be expected to ignore it.
Actual behaviour at TARGET
DirectX9Renderer.cpp implements both overrides as NotYetImplemented("DIRECTX9", ...), which throws std::runtime_error. GraphicsDevice.cpp's SetContextRecoveryEnabled assigns contextRecoveryEnabled_ = enabled first and then forwards, so the flag - which Texture2D.cpp reads to decide whether to keep CPU shadows - is changed while the exception propagates. A debugging aid (SetStringMarkerEXT) becomes a hard failure on this one renderer.
Source locations
modules/renderers/directx9/src/DirectX9Renderer.cpp— DirectX9Renderer::SetContextRecoveryEnabled and SetStringMarkerEXTmodules/graphics/src/Xna/GraphicsDevice.cpp— GraphicsDevice::SetContextRecoveryEnabled and SetStringMarkerEXTmodules/graphics/src/Xna/Texture2D.cpp— reads contextRecoveryEnabled_ for the shadow policy
Evidence
Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry. Both methods are CNA extensions.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
No DIRECTX9 test calls either method.
Regression test
A DIRECTX9 test that calls both and asserts either no throw (marker ignored, recovery flag honoured or documented as fixed) or a throw with the device flag unchanged.
Blast radius
Engine code that emits debug markers or toggles recovery generically across renderers; games that never call these CNA extensions are unaffected.
Workaround
Guard the calls by renderer identity 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: device lifecycle
- Known issues
- Bug index