From c97aee426ec614cf5d6fc98bb201697b8c7f5796 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 20 May 2022 12:39:03 -0400 Subject: [PATCH] zink: only warn once for SRGB fb without KHR_swapchain_mutable_format Fixes: 4bb45bcd168 ("zink: add error logging for SRGB framebuffer without KHR_swapchain_mutable_format") Reviewed-by: Adam Jackson Part-of: --- src/gallium/drivers/zink/zink_context.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index e1e7c9ccb98..630ad4257a2 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -2610,8 +2610,13 @@ zink_set_framebuffer_state(struct pipe_context *pctx, if (res->obj->dt) { /* #6274 */ if (!zink_screen(ctx->base.screen)->info.have_KHR_swapchain_mutable_format && - psurf->format != res->base.b.format) - mesa_loge("zink: SRGB framebuffer unsupported without KHR_swapchain_mutable_format"); + psurf->format != res->base.b.format) { + static bool warned = false; + if (!warned) { + mesa_loge("zink: SRGB framebuffer unsupported without KHR_swapchain_mutable_format"); + warned = true; + } + } } res->fb_binds++; ctx->gfx_pipeline_state.void_alpha_attachments |= util_format_has_alpha1(psurf->format) ? BITFIELD_BIT(i) : 0;