From 167300eef147f3008876516a6464196458518ccc Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 11 Feb 2022 12:56:17 -0800 Subject: gfx: Various Vulkan fixes. (#2129) * gfx: Various Vulkan fixes. * Fix test case. * Fix vulkan crash. Co-authored-by: Yong He --- tools/gfx/d3d/d3d-swapchain.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools/gfx/d3d') diff --git a/tools/gfx/d3d/d3d-swapchain.h b/tools/gfx/d3d/d3d-swapchain.h index 11914cca8..99343aaf4 100644 --- a/tools/gfx/d3d/d3d-swapchain.h +++ b/tools/gfx/d3d/d3d-swapchain.h @@ -35,12 +35,14 @@ public: m_desc = desc; + m_desc.format = srgbToLinearFormat(m_desc.format); + // Describe the swap chain. DXGI_SWAP_CHAIN_DESC swapChainDesc = {}; swapChainDesc.BufferCount = desc.imageCount; swapChainDesc.BufferDesc.Width = desc.width; swapChainDesc.BufferDesc.Height = desc.height; - swapChainDesc.BufferDesc.Format = D3DUtil::getMapFormat(desc.format); + swapChainDesc.BufferDesc.Format = D3DUtil::getMapFormat(m_desc.format); swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; swapChainDesc.SwapEffect = swapEffect; swapChainDesc.OutputWindow = (HWND)window.handleValues[0]; -- cgit v1.2.3