summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-11-23 08:17:10 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-11-23 08:17:10 +0000
commit4b28dd1fbd64ea2975e5c79466beb87e88c80235 (patch)
tree3943956ad4cb27440a3284a7e0a3c0e35eaa0635 /Graphics/GraphicsEngine
parentRenamed INSTALL_DILIGENT_CORE cmake option to DILIGENT_INSTALL_CORE (diff)
downloadDiligentCore-4b28dd1fbd64ea2975e5c79466beb87e88c80235.tar.gz
DiligentCore-4b28dd1fbd64ea2975e5c79466beb87e88c80235.zip
Fixed bug in ResolveTextureSubresource parameter validation
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/DeviceContextBase.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.h b/Graphics/GraphicsEngine/include/DeviceContextBase.h
index 09eed747..4ca3e286 100644
--- a/Graphics/GraphicsEngine/include/DeviceContextBase.h
+++ b/Graphics/GraphicsEngine/include/DeviceContextBase.h
@@ -909,19 +909,19 @@ void DeviceContextBase<BaseInterface,ImplementationTraits> ::
const auto& SrcFmtAttribs = GetTextureFormatAttribs(SrcTexDesc.Format);
const auto& DstFmtAttribs = GetTextureFormatAttribs(DstTexDesc.Format);
const auto& ResolveFmtAttribs = GetTextureFormatAttribs(ResolveAttribs.Format);
- if (ResolveAttribs.Format != TEX_FORMAT_UNKNOWN)
- {
- DEV_CHECK_ERR(!SrcFmtAttribs.IsTypeless && !DstFmtAttribs.IsTypeless,
- "Format of a resolve operations must not be unknown when one of the texture formats is typeless");
- }
if (!SrcFmtAttribs.IsTypeless && !DstFmtAttribs.IsTypeless)
{
DEV_CHECK_ERR(SrcTexDesc.Format == DstTexDesc.Format, "Source (", SrcFmtAttribs.Name, ") and destination (", DstFmtAttribs.Name, ") texture formats "
"of a resolve operation must match exaclty or be compatible typeless formats");
+ DEV_CHECK_ERR(ResolveAttribs.Format == TEX_FORMAT_UNKNOWN || SrcTexDesc.Format == ResolveAttribs.Format, "Invalid format of a resolve operation");
+ }
+ if (SrcFmtAttribs.IsTypeless && DstFmtAttribs.IsTypeless)
+ {
+ DEV_CHECK_ERR(ResolveAttribs.Format != TEX_FORMAT_UNKNOWN, "Format of a resolve operation must not be unknown when both src and dst texture formats are typeless");
}
if (SrcFmtAttribs.IsTypeless || DstFmtAttribs.IsTypeless)
{
- DEV_CHECK_ERR(!ResolveFmtAttribs.IsTypeless, "Format of a resolve operations must not be typeless when one of the texture formats is typeless");
+ DEV_CHECK_ERR(!ResolveFmtAttribs.IsTypeless, "Format of a resolve operation must not be typeless when one of the texture formats is typeless");
}
#endif
}