summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
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/GraphicsEngineD3D11
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/GraphicsEngineD3D11')
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index 93e7362c..974ee98f 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -2064,7 +2064,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 = D3D11CalcSubresource(ResolveAttribs.SrcMipLevel, ResolveAttribs.SrcSlice, SrcTexDesc.MipLevels);