mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-30 10:30:43 +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>
This commit is contained in:
parent
e3d4897dfe
commit
ac45d893d6
1 changed files with 9 additions and 5 deletions
|
|
@ -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