Fixed bug #6199 - Broken clip behaviour on a render target (metal)

main
Sylvain 2022-09-08 05:44:39 +02:00
parent 0ad8d9d292
commit 90a480a100
No known key found for this signature in database
GPG Key ID: 5F87E02E5BC0939E
1 changed files with 7 additions and 1 deletions

View File

@ -1227,7 +1227,13 @@ SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const SDL_Met
/* Set Scissor Rect Validation: w/h must be <= render pass */ /* Set Scissor Rect Validation: w/h must be <= render pass */
SDL_zero(output); SDL_zero(output);
if (renderer->target) {
output.w = renderer->target->w;
output.h = renderer->target->h;
} else {
METAL_GetOutputSize(renderer, &output.w, &output.h); METAL_GetOutputSize(renderer, &output.w, &output.h);
}
if (SDL_IntersectRect(&output, &clip, &clip)) { if (SDL_IntersectRect(&output, &clip, &clip)) {
MTLScissorRect mtlrect; MTLScissorRect mtlrect;