[PATCH 5/5] d3d11: Validate D3D11_RESOURCE_MISC_GENERATE_MIPS flag for 2D textures.

Matteo Bruni mbruni at codeweavers.com
Fri Nov 24 16:30:01 CST 2017


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
 dlls/d3d11/texture.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
index ef2c9a29fe..12186dcf37 100644
--- a/dlls/d3d11/texture.c
+++ b/dlls/d3d11/texture.c
@@ -472,6 +472,14 @@ static BOOL validate_texture2d_desc(const D3D11_TEXTURE2D_DESC *desc)
         return FALSE;
     }
 
+    if (desc->MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS
+            && (~desc->BindFlags & (D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE)))
+    {
+        WARN("D3D11_RESOURCE_MISC_GENERATE_MIPS used without D3D11_BIND_RENDER_TARGET and "
+                "D3D11_BIND_SHADER_RESOURCE.\n");
+        return FALSE;
+    }
+
     return TRUE;
 }
 
-- 
2.13.6




More information about the wine-devel mailing list