CNA-GAP-014: SDL_RENDERER ignores GraphicsDevice.Viewport

CNA snapshot c1c316b9  ·  Known Issues › Functional gaps  ·  source links pinned to c1c316b9

✓

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 c1c316b9; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.

SDL_RENDERER leaves the no-op IGraphicsRenderer::SetViewport in place, so a custom viewport never offsets or clips drawing on that renderer.

Identifier
CNA-GAP-014
Category
Functional gap
Subsystem
Graphics & renderers
Status
Narrowed (partially fixed; describes only what survives)
Verified against
CNA c1c316b9 (c1c316b9c7a846ce8002809c151fcd1af14942c9)
Evidence basis
Source-verified: read at TARGET, not executed
Tests touching this area
Yes: see Current tests
Affected contract
GraphicsDevice.Viewport on 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. SDL_RENDERER (SdlRenderer.cpp) overrides only SetScissorRect. GraphicsDevice validates and stores the viewport, so the getter round-trips 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

Evidence

Checked by reading the named sources at c1c316b9; nothing was built or executed for this entry. Established by grepping the renderer's header 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 test checks a custom viewport on SDL_RENDERER.

Regression test

Register the shared viewport fixtures for SDL_RENDERER, or make it refuse a non-default viewport explicitly and test the refusal.

Blast radius

Split-screen and offset viewports on SDL_RENDERER.

Workaround

Offset and clip in game code (render to a render target and draw a sub-rectangle).

The same subject is explained at several altitudes. These are the neighbouring pages at each one.