CNA-GAP-014: CANVAS and FREEDIRECT ignore GraphicsDevice.Viewport and ScissorRectangle, and SDL_RENDERER ignores Viewport
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.
The renderers leave the no-op IGraphicsRenderer::SetViewport (and, on CANVAS and FREEDIRECT, SetScissorRect) in place, so a custom viewport never offsets drawing and a scissor rectangle never clips there.
- Identifier
CNA-GAP-014- 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.Viewport and GraphicsDevice.ScissorRectangle (with RasterizerState.ScissorTestEnable) on CANVAS, FREEDIRECT and SDL_RENDERER
Expected behaviour
XNA SpriteBatch and 3D drawing honour the device viewport, and an enabled scissor rectangle clips rasterisation - split-screen and UI clipping depend on both.
Actual behaviour at TARGET
IGraphicsRenderer::SetViewport and SetScissorRect are empty defaults in IGraphicsRenderer.hpp. CANVAS (CanvasRenderer.cpp) and FREEDIRECT (FreeDirectRenderer.cpp) override neither, and SDL_RENDERER (SdlRenderer.cpp) overrides only SetScissorRect. GraphicsDevice validates and stores the values, so the getters round-trip while nothing changes on screen. SDL_RENDERER also has no applied-format override, so PresentationParameters keeps the requested depth format (for example Depth24) on a renderer without a depth buffer. The SDL_RENDERER scissor-enable defect is published separately as CNA-BUG-105.
Source locations
modules/graphics/include/CNA/Internal/Renderers/Common/IGraphicsRenderer.hpp— SetViewport and SetScissorRect no-op defaultsmodules/renderers/canvas/src/CanvasRenderer.cpp— no SetViewport/SetScissorRect overridemodules/renderers/freedirect/src/FreeDirectRenderer.cpp— no SetViewport/SetScissorRect overridemodules/renderers/sdl-renderer/include/CNA/Internal/Renderers/SdlRenderer/SdlRenderer.hpp— overrides SetScissorRect only; no GetApplied*FormatEXT
Evidence
Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry. Established by grepping the three renderers' headers and sources for the overrides.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
No viewport or scissor pixel fixture is registered for CANVAS or FREEDIRECT, and none checks a custom viewport on SDL_RENDERER.
Regression test
Register the shared viewport and scissor fixtures for these renderers, or make them refuse the settings explicitly and test the refusal.
Blast radius
Split-screen, letterboxed UI and clipped scroll panels on the three 2D renderers.
Workaround
Offset and clip in game code (render to a render target and draw a sub-rectangle).
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- Known issues
- Functional gap index