summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3DBase
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-11-18 16:31:03 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-11-18 16:31:03 +0000
commit466a563e61330078ca4b0559308b42f9468b9da3 (patch)
tree8ac915e2ad60c08ff82bea18a3fb46102e54d311 /Graphics/GraphicsEngineD3DBase
parentD3D11 and D3D12 backends: fixed issue with resolving typeless resources (diff)
downloadDiligentCore-466a563e61330078ca4b0559308b42f9468b9da3.tar.gz
DiligentCore-466a563e61330078ca4b0559308b42f9468b9da3.zip
D3D12 backend: fixed issue with the format of the swap chain's back buffer texture
Diffstat (limited to 'Graphics/GraphicsEngineD3DBase')
-rw-r--r--Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h b/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h
index 84a29a54..6ad6e0a9 100644
--- a/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h
+++ b/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h
@@ -97,7 +97,20 @@ namespace Diligent
// - DXGI_FORMAT_R10G10B10A2_UNORM
// If RGBA8_UNORM_SRGB swap chain is required, we will create RGBA8_UNORM swap chain, but
// create RGBA8_UNORM_SRGB render target view
- swapChainDesc.Format = DXGIColorBuffFmt == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB ? DXGI_FORMAT_R8G8B8A8_UNORM : DXGIColorBuffFmt;
+ switch (DXGIColorBuffFmt)
+ {
+ case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
+ swapChainDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ break;
+
+ case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
+ swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
+ break;
+
+ default:
+ swapChainDesc.Format = DXGIColorBuffFmt;
+ }
+
swapChainDesc.Stereo = FALSE;
// Multi-sampled swap chains are not supported anymore. CreateSwapChainForHwnd() fails when sample count is not 1