From f7b5faa1a276a29b1de9a87a645320703bc3d841 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 2 Oct 2024 05:56:21 -0400 Subject: [PATCH] zink: block srgb with winsys imports these are already a set format cc: mesa-stable Part-of: --- src/gallium/drivers/zink/zink_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index af8c48b866d..5c08376e88b 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -1252,7 +1252,7 @@ create_image(struct zink_screen *screen, struct zink_resource_object *obj, /* we often need to be able to mutate between srgb and linear, but we don't need general * image view/shader image format compatibility (that path means losing fast clears or compression on some hardware). */ - if (!(templ->bind & ZINK_BIND_MUTABLE)) { + if (!(templ->bind & ZINK_BIND_MUTABLE) && (!alloc_info->whandle || alloc_info->whandle->type == ZINK_EXTERNAL_MEMORY_HANDLE)) { srgb = util_format_is_srgb(templ->format) ? util_format_linear(templ->format) : util_format_srgb(templ->format); /* why do these helpers have different default return values? */ if (srgb == templ->format)