From 193b7cb29d3134bf234cbd5426fa1790dd774e80 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 Part-of: --- src/gallium/drivers/zink/zink_clear.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/gallium/drivers/zink/zink_clear.c b/src/gallium/drivers/zink/zink_clear.c index 025c0657346..e4048fd755a 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);