summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-11-17 17:24:07 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-11-17 17:24:07 +0000
commitf0f3961326a855740b761732205bfc4c4e8449b5 (patch)
tree43e5860af2d35c4457def74d757f981f24316030 /Graphics/GraphicsEngineD3D12
parentVulkan backend: added SPIRV optimization when compiling from glsl (diff)
downloadDiligentCore-f0f3961326a855740b761732205bfc4c4e8449b5.tar.gz
DiligentCore-f0f3961326a855740b761732205bfc4c4e8449b5.zip
D3D11 and D3D12 backends: fixed issue with resolving typeless resources
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
index 32a07203..c15eea8e 100644
--- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
@@ -1778,7 +1778,19 @@ namespace Diligent
auto Format = ResolveAttribs.Format;
if (Format == TEX_FORMAT_UNKNOWN)
- Format = SrcTexDesc.Format;
+ {
+ const auto& SrcFmtAttribs = GetTextureFormatAttribs(SrcTexDesc.Format);
+ if (!SrcFmtAttribs.IsTypeless)
+ {
+ Format = SrcTexDesc.Format;
+ }
+ else
+ {
+ const auto& DstFmtAttribs = GetTextureFormatAttribs(DstTexDesc.Format);
+ DEV_CHECK_ERR(!DstFmtAttribs.IsTypeless, "Resolve operation format can't be typeless when both source and destination textures are typeless");
+ Format = DstFmtAttribs.Format;
+ }
+ }
auto DXGIFmt = TexFormatToDXGI_Format(Format);
auto SrcSubresIndex = D3D12CalcSubresource(ResolveAttribs.SrcMipLevel, ResolveAttribs.SrcSlice, 0, SrcTexDesc.MipLevels, SrcTexDesc.ArraySize);