zink: force a new framebuffer for clear_depth_stencil if the clear region is big

can't clear outside the framebuffer, so set a new one if necessary

Fixes: f1f08e3529 ("zink: massively simplify zink_clear_depth_stencil")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17775>
(cherry picked from commit ff1fb9101f)
This commit is contained in:
Mike Blumenkrantz
2022-07-27 16:04:54 -04:00
committed by Dylan Baker
parent 0ee8821b83
commit 71b113251d
2 changed files with 5 additions and 1 deletions

View File

@@ -526,7 +526,7 @@
"description": "zink: force a new framebuffer for clear_depth_stencil if the clear region is big",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "f1f08e3529de26953e243d3e2e99fa89bbcbe619"
},

View File

@@ -553,6 +553,10 @@ zink_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *dst,
ctx->render_condition_active = false;
}
bool cur_attachment = zink_csurface(ctx->fb_state.zsbuf) == zink_csurface(dst);
if (dstx > ctx->fb_state.width || dsty > ctx->fb_state.height ||
dstx + width > ctx->fb_state.width ||
dsty + height > ctx->fb_state.height)
cur_attachment = false;
if (!cur_attachment) {
util_blitter_save_framebuffer(ctx->blitter, &ctx->fb_state);
set_clear_fb(pctx, NULL, dst);