diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index 8b2bfecf816..4db49c38fd4 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -2937,18 +2937,7 @@ util_blitter_stencil_fallback(struct blitter_context *blitter, blitter_set_dst_dimensions(ctx, dst_view->width, dst_view->height); if (scissor) { - pipe->clear_depth_stencil(pipe, dst_view, PIPE_CLEAR_STENCIL, 0.0, 0, - MAX2(dstbox->x, scissor->minx), - MAX2(dstbox->y, scissor->miny), - MIN2(dstbox->x + dstbox->width, scissor->maxx) - dstbox->x, - MIN2(dstbox->y + dstbox->height, scissor->maxy) - dstbox->y, - true); pipe->set_scissor_states(pipe, 0, 1, scissor); - } else { - pipe->clear_depth_stencil(pipe, dst_view, PIPE_CLEAR_STENCIL, 0.0, 0, - dstbox->x, dstbox->y, - dstbox->width, dstbox->height, - true); } pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, false, &src_view); diff --git a/src/gallium/drivers/d3d12/d3d12_blit.cpp b/src/gallium/drivers/d3d12/d3d12_blit.cpp index c9e0219e1dd..63d92aa11f4 100644 --- a/src/gallium/drivers/d3d12/d3d12_blit.cpp +++ b/src/gallium/drivers/d3d12/d3d12_blit.cpp @@ -599,6 +599,7 @@ static void blit_replicate_stencil(struct d3d12_context *ctx, const struct pipe_blit_info *info) { + struct pipe_context *pctx = &ctx->base; assert(info->mask & PIPE_MASK_S); if (D3D12_DEBUG_BLIT & d3d12_debug) @@ -611,6 +612,15 @@ blit_replicate_stencil(struct d3d12_context *ctx, util_blit(ctx, &new_info); } + struct pipe_surface *dst_view, dst_templ; + util_blitter_default_dst_texture(&dst_templ, info->dst.resource, + info->dst.level, info->dst.box.z); + dst_view = pctx->create_surface(pctx, info->dst.resource, &dst_templ); + + util_blit_save_state(ctx); + util_blitter_clear_depth_stencil(ctx->blitter, dst_view, PIPE_CLEAR_STENCIL, + 0, 0, info->dst.box.x, info->dst.box.y, + info->dst.box.width, info->dst.box.height); util_blit_save_state(ctx); util_blitter_stencil_fallback(ctx->blitter, info->dst.resource, info->dst.level, @@ -619,6 +629,8 @@ blit_replicate_stencil(struct d3d12_context *ctx, info->src.level, &info->src.box, info->scissor_enable ? &info->scissor : NULL); + + pipe_surface_release(pctx, &dst_view); } void