From 067cbd9d820c6731280eb1a07c88c0f1ab3cdf3d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 16 Jan 2026 09:43:58 -0500 Subject: [PATCH] zink: delete all the no-op checks when rewriting clears there's no harm in calling this on a no-op, and generally if this function is called then it won't be a no-op. plus most of these checks are broken in some way cc: mesa-stable (cherry picked from commit 193b7cb29d3134bf234cbd5426fa1790dd774e80) Part-of: --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_clear.c | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 64b8659cd4a..191b0c24642 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -784,7 +784,7 @@ "description": "zink: delete all the no-op checks when rewriting clears", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/zink_clear.c b/src/gallium/drivers/zink/zink_clear.c index fe14bcef182..3c59227e9d7 100644 --- a/src/gallium/drivers/zink/zink_clear.c +++ b/src/gallium/drivers/zink/zink_clear.c @@ -840,23 +840,6 @@ zink_fb_clears_apply_region(struct zink_context *ctx, struct pipe_resource *pres void zink_fb_clear_rewrite(struct zink_context *ctx, unsigned idx, enum pipe_format before, enum pipe_format after) { - /* if the values for the clear color are incompatible, they must be rewritten; - * this occurs if: - * - the formats' srgb-ness does not match - * - the formats' signedness does not match - */ - const struct util_format_description *bdesc = util_format_description(before); - const struct util_format_description *adesc = util_format_description(after); - int bfirst_non_void_chan = util_format_get_first_non_void_channel(before); - int afirst_non_void_chan = util_format_get_first_non_void_channel(after); - bool bsigned = false, asigned = false; - if (bfirst_non_void_chan > 0) - bsigned = bdesc->channel[bfirst_non_void_chan].type == UTIL_FORMAT_TYPE_SIGNED; - if (afirst_non_void_chan > 0) - asigned = adesc->channel[afirst_non_void_chan].type == UTIL_FORMAT_TYPE_SIGNED; - if (util_format_is_srgb(before) == util_format_is_srgb(after) && - bsigned == asigned) - return; struct zink_framebuffer_clear *fb_clear = &ctx->fb_clears[idx]; for (int j = 0; j < zink_fb_clear_count(fb_clear); j++) { struct zink_framebuffer_clear_data *clear = zink_fb_clear_element(fb_clear, j);