CNA-GAP-006: GraphicsDeviceManager never calls its FindBestDevice, RankDevices or CanResetDevice virtuals
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.
The three XNA selection hooks are implemented (as a default GDI, a no-op and 'device exists') but CreateDevice and ApplyChanges do not consult them, so overriding them has no effect on device selection or reset.
- Identifier
CNA-GAP-006- Category
- Functional gap
- Subsystem
- Core & runtime
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- None
- Affected contract
- Microsoft::Xna::Framework::GraphicsDeviceManager::FindBestDevice(bool), RankDevices(std::vector<GraphicsDeviceInformation>&), CanResetDevice(const GraphicsDeviceInformation&)
Expected behaviour
In XNA 4.0 (IL of GraphicsDeviceManager.ChangeDevice) device changes call FindBestDevice (which ranks through RankDevices) and CanResetDevice to decide between reset and re-creation; subclasses override them to choose adapters or modes.
Actual behaviour at TARGET
In GraphicsDeviceManager.cpp the three methods exist, but CreateDevice and ApplyChanges build their GraphicsDeviceInformation directly and always reset the Game-owned device in place; nothing calls the virtuals.
Source locations
modules/runtime/src/GraphicsDeviceManager.cpp— FindBestDevice, RankDevices, CanResetDevice, CreateDevice, ApplyChanges
Evidence
Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry. CNA supports a single adapter and never re-creates the Game's device, so the hooks have little to decide; the gap is that overrides are silently ignored.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
GraphicsDeviceManagerTests.cpp does not override the hooks.
Regression test
Either call the hooks from CreateDevice/ApplyChanges or document them as inert; a test override that records calls would pin whichever is chosen.
Blast radius
Ported XNA games that override these hooks to filter modes or adapters.
Workaround
Adjust PresentationParameters in a PreparingDeviceSettings handler instead.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- Deep dives
- Device manager: selection virtuals
- Known issues
- Functional gap index