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
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