wsi/win32: Always use non-SRGB formats for DXGI
authorJesse Natalie <jenatali@microsoft.com>
Fri, 27 Jan 2023 20:05:35 +0000 (12:05 -0800)
committerMarge Bot <emma+marge@anholt.net>
Mon, 30 Jan 2023 17:27:47 +0000 (17:27 +0000)
The actual buffer is always created as non-SRGB, and then SRGB views
can be used to render into it. Fixes a crash trying to launch
3DMark Wild Lands

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20963>

src/vulkan/wsi/wsi_common_win32.cpp

index 16899b6..675aa17 100644 (file)
@@ -678,8 +678,7 @@ wsi_win32_surface_create_swapchain_dxgi(
    DXGI_SWAP_CHAIN_DESC1 desc = {
       create_info->imageExtent.width,
       create_info->imageExtent.height,
-      create_info->imageFormat == VK_FORMAT_B8G8R8A8_SRGB ?
-      DXGI_FORMAT_B8G8R8A8_UNORM_SRGB : DXGI_FORMAT_B8G8R8A8_UNORM,
+      DXGI_FORMAT_B8G8R8A8_UNORM,
       create_info->imageArrayLayers > 1,  // Stereo
       { 1 },                              // SampleDesc
       0,                                  // Usage (filled in below)