CNA-GAP-030: FREEDIRECT keeps presenting at the old physical scale after a virtual-resolution change once the first Present has happened
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.
FreeDirectRenderer::SetVirtualResolution recreates the surfaces and the display mode, but free-direct applies its SDL logical-presentation rectangle only once, so output after a change made following the first Present keeps the old logical size and scale. That FREEDIRECT always letterboxes whatever presentation mode is requested is published as CNA-GAP-017.
- Identifier
CNA-GAP-030- 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
- GraphicsDevice presentation mode and virtual-resolution changes on FREEDIRECT
Expected behaviour
A virtual-resolution change applies to later frames.
Actual behaviour at TARGET
In FreeDirectRenderer.cpp, SetVirtualResolution calls Impl::CreateSurfaces, which creates a new shadow backbuffer and primary surface and calls IDirectDraw::SetDisplayMode. free-direct's PresentPrimary calls SDL_SetRenderLogicalPresentation (letterbox) once, guarded by a logicalPresentationSet_ flag that nothing resets, so a change after the first Present keeps the old physical scale. A code comment in SetVirtualResolution and freedirect-renderer.md record this as a known limitation that needs a change in free-direct itself. TransformWindowToLogical and TransformLogicalToWindow recompute the letterbox from the new logical size, so when the aspect ratio changes the pointer mapping is likely to disagree with the picture (inferred from the two code paths, not run).
Source locations
modules/renderers/freedirect/src/FreeDirectRenderer.cpp— FreeDirectRenderer::SetPresentationMode and SetVirtualResolutiondocs/freedirect-renderer.md— SetPresentationMode / resize-after-first-Present row and known limitations
Evidence
Checked by reading at 009d40f5; not executed.
Independent re-verification: Checked by reading at 009d40f5 and the free-direct sibling checkout (unpinned, see CNA-VGAP-042); not executed. FreeDirect_ResizeTransaction covers the resize bookkeeping and surface transaction, not the physical output; the SetPresentationMode half of the original entry duplicates CNA-GAP-017 and was removed.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
FreeDirect_ResizeTransaction covers resize bookkeeping; no test compares physical output across presentation modes.
Regression test
After a free-direct change: a readback test per presentation mode and one for a resolution change after the first Present.
Blast radius
FREEDIRECT games that request a non-letterbox mode or change resolution at run time. Mouse transforms follow the letterbox actually used.
Workaround
Choose the virtual resolution before the first Present and accept letterboxing.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- Deep dives
- FreeDirect and FreeAPI: status matrix
- Known issues
- Functional gap index