From baba35ed693c17d474d495fc56b2f297aa97ebaa Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 22 Feb 2024 07:27:15 -0500 Subject: [PATCH] zink: clamp in_rp clears to fb size this was almost sort of clamping except that it wasn't cc: mesa-stable Part-of: (cherry picked from commit e6020355969c8f6a78e1698b2c31539055e5698e) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_clear.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index cb5435e1b82..732e960c51a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -224,7 +224,7 @@ "description": "zink: clamp in_rp clears to fb size", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/zink_clear.c b/src/gallium/drivers/zink/zink_clear.c index c417b62c811..dd1684a33f9 100644 --- a/src/gallium/drivers/zink/zink_clear.c +++ b/src/gallium/drivers/zink/zink_clear.c @@ -98,8 +98,8 @@ clear_in_rp(struct pipe_context *pctx, return; cr.rect.offset.x = scissor_state->minx; cr.rect.offset.y = scissor_state->miny; - cr.rect.extent.width = MIN2(fb->width, scissor_state->maxx - scissor_state->minx); - cr.rect.extent.height = MIN2(fb->height, scissor_state->maxy - scissor_state->miny); + cr.rect.extent.width = MIN2(fb->width - cr.rect.offset.x, scissor_state->maxx - scissor_state->minx); + cr.rect.extent.height = MIN2(fb->height - cr.rect.offset.y, scissor_state->maxy - scissor_state->miny); } else { cr.rect.extent.width = fb->width; cr.rect.extent.height = fb->height;