summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3DBase
diff options
context:
space:
mode:
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