From 85c141483471794d43680c4e1af36f7b13aeeb35 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 18 Nov 2019 08:54:12 -0800 Subject: Improved parameter validation of ResolveTextureSubresource() --- Graphics/GraphicsEngine/include/DeviceContextBase.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.h b/Graphics/GraphicsEngine/include/DeviceContextBase.h index 3cf70d30..09eed747 100644 --- a/Graphics/GraphicsEngine/include/DeviceContextBase.h +++ b/Graphics/GraphicsEngine/include/DeviceContextBase.h @@ -914,6 +914,11 @@ void DeviceContextBase :: 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"); + } 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"); -- cgit v1.2.3