Skip to content

SDL_Renderer D3D12 is not paired with other renderers #16038

Description

@jairov4

Using SDL_SetRenderViewport in combination with other situations causes wrong behavior.
I have this happening with 2x2 split screen rendering 4 quadrants, then resetting the viewport, but instead this renderer set do not restore the width x height, only sets the position. Causing the drawing keep clipped to first quadrant.

The cause

SDL3's D3D12 backend only re-syncs its scissor rect to the current viewport when a real SDL_RENDERCMD_SETCLIPRECT command is processed (see D3D12_RunCommandQueue's SDL_RENDERCMD_SETCLIPRECT case) -- changing the viewport alone marks the scissor dirty but rebuilds it from the stale last-set clip rect, not from the new viewport.

Workaround

Invoke SDL_SetRenderClipRect just after every SDL_SetRenderTarget and SDL_SetRenderViewport

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions