Mesa (main): zink: add error logging for SRGB framebuffer without KHR_swapchain_mutable_format

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 7 23:19:42 UTC 2022


Module: Mesa
Branch: main
Commit: 4bb45bcd168039be52ca7764310a58d5a0832617
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4bb45bcd168039be52ca7764310a58d5a0832617

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Apr  7 17:55:09 2022 -0400

zink: add error logging for SRGB framebuffer without KHR_swapchain_mutable_format

this is going to explode, so at least print an error explaining why

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15808>

---

 src/gallium/drivers/zink/zink_context.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 358bd9f2453..da42871119e 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -2766,6 +2766,12 @@ zink_set_framebuffer_state(struct pipe_context *pctx,
             assert(!ctx->needs_present || ctx->needs_present == res);
             ctx->needs_present = res;
          }
+         if (res->obj->dt) {
+            /* #6274 */
+            if (!zink_screen(ctx->base.screen)->info.have_KHR_swapchain_mutable_format &&
+                surf->format != res->base.b.format)
+               mesa_loge("zink: SRGB framebuffer unsupported without KHR_swapchain_mutable_format");
+         }
          res->fb_binds++;
          ctx->gfx_pipeline_state.void_alpha_attachments |= util_format_has_alpha1(surf->format) ? BITFIELD_BIT(i) : 0;
       }



More information about the mesa-commit mailing list