CNA-BUG-117: The SdlRenderer constructor maps any positive swap interval to 1, so a device constructed with PresentInterval::Two runs at interval 1 until the next reset

CNA snapshot 009d40f5  ·  Known Issues › Current bugs  ·  source links pinned to 009d40f5

✓

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 constructor calls SDL_SetRenderVSync(renderer, swapInterval > 0 ? 1 : 0), while SetSwapInterval (Task 713) passes 2 through and falls back only if the driver refuses it.

Identifier
CNA-BUG-117
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
Yes: see Current tests
Affected contract
GraphicsDevice construction with PresentationParameters.PresentationInterval = Two on SDL_RENDERER

Expected behaviour

CNA's own Task 713 fix in SetSwapInterval establishes the contract: interval 2 is forwarded as 2 (every second vertical refresh), with a fallback to 1 only when SDL rejects it.

Actual behaviour at TARGET

SdlRenderer.cpp's constructor still has the pre-fix mapping, with a stale comment claiming that SDL_SetRenderVSync supports only 0 and 1. A GraphicsDevice constructed with PresentInterval::Two therefore starts at interval 1; the Game path is unaffected in practice because GraphicsDeviceManager's Reset forwards the interval again through SetSwapInterval (and the manager only ever requests One or Immediate).

Source locations

Evidence

Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry.

Focused reproduction

No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.

Current tests

sdlrenderer_presentinterval_test.cpp checks forwarding through SetSwapInterval, not the constructor.

Regression test

A test that constructs a device with PresentInterval::Two and queries SDL_GetRenderVSync.

Blast radius

Directly constructed GraphicsDevices (tools, embedding) that request Two on SDL_RENDERER.

Workaround

Call Reset or SetPresentationParameters after construction.

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

Known issues
Bug index