diff --git a/src/gallium/drivers/zink/zink_blit.c b/src/gallium/drivers/zink/zink_blit.c index 82dc303d246..b358b26d3b3 100644 --- a/src/gallium/drivers/zink/zink_blit.c +++ b/src/gallium/drivers/zink/zink_blit.c @@ -38,7 +38,7 @@ blit_resolve(struct zink_context *ctx, const struct pipe_blit_info *info) util_range_add(info->dst.resource, &dst->valid_buffer_range, info->dst.box.x, info->dst.box.x + info->dst.box.width); - zink_fb_clears_apply(ctx, info->dst.resource); + zink_fb_clears_apply_or_discard(ctx, info->dst.resource, zink_rect_from_box(&info->dst.box), false); zink_fb_clears_apply(ctx, info->src.resource); struct zink_batch *batch = zink_batch_no_rp(ctx); @@ -120,7 +120,7 @@ blit_native(struct zink_context *ctx, const struct pipe_blit_info *info) dst->format != zink_get_format(screen, info->dst.format)) return false; - zink_fb_clears_apply(ctx, info->dst.resource); + zink_fb_clears_apply_or_discard(ctx, info->dst.resource, zink_rect_from_box(&info->dst.box), false); zink_fb_clears_apply(ctx, info->src.resource); struct zink_batch *batch = zink_batch_no_rp(ctx); zink_batch_reference_resource_rw(batch, src, false); @@ -213,6 +213,8 @@ zink_blit(struct pipe_context *pctx, return; } + zink_fb_clears_apply_or_discard(ctx, info->dst.resource, zink_rect_from_box(&info->dst.box), true); + if (info->dst.resource->target == PIPE_BUFFER) util_range_add(info->dst.resource, &dst->valid_buffer_range, info->dst.box.x, info->dst.box.x + info->dst.box.width); diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index a0df27d7d5f..0e5938186a9 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1591,7 +1591,7 @@ zink_resource_copy_region(struct pipe_context *pctx, } else unreachable("planar formats not yet handled"); - zink_fb_clears_apply(ctx, pdst); + zink_fb_clears_apply_or_discard(ctx, pdst, (struct u_rect){dstx, dstx + src_box->width, dsty, dsty + src_box->height}, false); zink_fb_clears_apply(ctx, psrc); region.srcSubresource.aspectMask = src->aspect;