mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
zink: handle stencil_fallback in zink_clear_depth_stencil
ctx->blitting will already be set at this point, meaning the flag
should not be modified and no barriers are required
fixes stencil blitting on nvk
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27735>
(cherry picked from commit ac45d893d6)
This commit is contained in:
parent
7426889729
commit
40c72e73e7
2 changed files with 10 additions and 6 deletions
|
|
@ -1634,7 +1634,7 @@
|
|||
"description": "zink: handle stencil_fallback in zink_clear_depth_stencil",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -644,6 +644,8 @@ zink_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *dst,
|
|||
bool render_condition_enabled)
|
||||
{
|
||||
struct zink_context *ctx = zink_context(pctx);
|
||||
/* check for stencil fallback */
|
||||
bool blitting = ctx->blitting;
|
||||
zink_flush_dgc_if_enabled(ctx);
|
||||
bool render_condition_active = ctx->render_condition_active;
|
||||
if (!render_condition_enabled && render_condition_active) {
|
||||
|
|
@ -656,14 +658,16 @@ zink_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *dst,
|
|||
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);
|
||||
zink_blit_barriers(ctx, NULL, zink_resource(dst->texture), false);
|
||||
ctx->blitting = true;
|
||||
if (!blitting) {
|
||||
util_blitter_save_framebuffer(ctx->blitter, &ctx->fb_state);
|
||||
set_clear_fb(pctx, NULL, dst);
|
||||
zink_blit_barriers(ctx, NULL, zink_resource(dst->texture), false);
|
||||
ctx->blitting = true;
|
||||
}
|
||||
}
|
||||
struct pipe_scissor_state scissor = {dstx, dsty, dstx + width, dsty + height};
|
||||
pctx->clear(pctx, clear_flags, &scissor, NULL, depth, stencil);
|
||||
if (!cur_attachment) {
|
||||
if (!cur_attachment && !blitting) {
|
||||
util_blitter_restore_fb_state(ctx->blitter);
|
||||
ctx->blitting = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue