Skip to content

gfx: clamp EFB clear scissor to the render target - #306

Open
StilesCrisis wants to merge 1 commit into
encounter:mainfrom
StilesCrisis:clamp-scissor-to-target
Open

StilesCrisis wants to merge 1 commit into
encounter:mainfrom
StilesCrisis:clamp-scissor-to-target

Conversation

@StilesCrisis

Copy link
Copy Markdown

clear::render passed the clear rect straight to SetScissorRect. The rect is mapped from the logical EFB size, and right after a window resize or a fullscreen toggle, it can extend past the current render target, which WebGPU rejects with a validation error ("scissor rect is not contained in the render target").

This PR prevents the error by adding a clamp (like apply_scissor in encoding.cpp already has).

@StilesCrisis
StilesCrisis force-pushed the clamp-scissor-to-target branch from ccf7a8a to 97bccdd Compare November 7, 2026 02:55
clear::render passed the clear rect straight to SetScissorRect. The rect
is mapped from the logical EFB size, and after a window resize or a
fullscreen toggle it can extend past the current render target, which
WebGPU rejects with a validation error ("scissor rect is not contained
in the render target"). Clamp it the same way apply_scissor already
does for regular draws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SjpWoYqNDKkH5Zpdbz3WaW
@StilesCrisis
StilesCrisis force-pushed the clamp-scissor-to-target branch from 97bccdd to 3588d98 Compare November 7, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant