summaryrefslogtreecommitdiffstats
path: root/tools/gfx/d3d
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-02-11 12:56:17 -0800
committerGitHub <noreply@github.com>2022-02-11 12:56:17 -0800
commit167300eef147f3008876516a6464196458518ccc (patch)
tree12071fa666c58f5f8510501227a7df286ef18f96 /tools/gfx/d3d
parent7d296ba93ff9f01d381dd573160386958457fc18 (diff)
gfx: Various Vulkan fixes. (#2129)
* gfx: Various Vulkan fixes. * Fix test case. * Fix vulkan crash. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/d3d')
-rw-r--r--tools/gfx/d3d/d3d-swapchain.h4
1 files changed, 3 insertions, 1 deletions
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];