Commit a8e047e8 authored by Mike Blumenkrantz's avatar Mike Blumenkrantz 🏋 Committed by Marge Bot
Browse files

zink: discard pending clears during blit/copy if we'll overwrite the data



these operations are redundant, so there's no point in forcing them through
since they'll never be visible
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Part-of: <mesa/mesa!9206>
parent 031e3e68
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment