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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39336>
This commit is contained in:
Mike Blumenkrantz 2026-01-16 09:43:58 -05:00 committed by Marge Bot
parent 8056e4756f
commit 193b7cb29d

View file

@ -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);