zink: ignore no-op image copies
rare, but it happens and is illegal affects: GTF-GL46.gtf30.GLCoverage.CoverageGL30 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22960>
This commit is contained in:
committed by
Marge Bot
parent
864ccc7a92
commit
468554804c
@@ -4389,7 +4389,9 @@ zink_resource_copy_region(struct pipe_context *pctx,
|
||||
struct zink_resource *src = zink_resource(psrc);
|
||||
struct zink_context *ctx = zink_context(pctx);
|
||||
if (dst->base.b.target != PIPE_BUFFER && src->base.b.target != PIPE_BUFFER) {
|
||||
VkImageCopy region = {0};
|
||||
VkImageCopy region;
|
||||
/* fill struct holes */
|
||||
memset(®ion, 0, sizeof(region));
|
||||
if (util_format_get_num_planes(src->base.b.format) == 1 &&
|
||||
util_format_get_num_planes(dst->base.b.format) == 1) {
|
||||
/* If neither the calling command’s srcImage nor the calling command’s dstImage
|
||||
@@ -4470,6 +4472,12 @@ zink_resource_copy_region(struct pipe_context *pctx,
|
||||
region.extent.width = src_box->width;
|
||||
region.extent.height = src_box->height;
|
||||
|
||||
/* ignore no-op copies */
|
||||
if (src == dst &&
|
||||
!memcmp(®ion.dstOffset, ®ion.srcOffset, sizeof(region.srcOffset)) &&
|
||||
!memcmp(®ion.dstSubresource, ®ion.srcSubresource, sizeof(region.srcSubresource)))
|
||||
return;
|
||||
|
||||
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_region(ctx, psrc, zink_rect_from_box(src_box));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user