diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-11-18 16:31:03 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-11-18 16:31:03 +0000 |
| commit | 466a563e61330078ca4b0559308b42f9468b9da3 (patch) | |
| tree | 8ac915e2ad60c08ff82bea18a3fb46102e54d311 /Graphics/GraphicsEngineD3DBase | |
| parent | D3D11 and D3D12 backends: fixed issue with resolving typeless resources (diff) | |
| download | DiligentCore-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.h | 15 |
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 |
