Matteo Bruni : d3d11: Validate MiscFlags for 3D textures.
Alexandre Julliard
julliard at winehq.org
Tue Dec 5 15:02:13 CST 2017
Module: wine
Branch: master
Commit: 72a60e445512a8580beaf580e1fc499908357b37
URL: http://source.winehq.org/git/wine.git/?a=commit;h=72a60e445512a8580beaf580e1fc499908357b37
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Mon Dec 4 18:07:27 2017 +0100
d3d11: Validate MiscFlags for 3D textures.
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d11/texture.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
index 12186dc..e8870d5 100644
--- a/dlls/d3d11/texture.c
+++ b/dlls/d3d11/texture.c
@@ -942,6 +942,14 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi
unsigned int levels;
HRESULT hr;
+ 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 E_INVALIDARG;
+ }
+
texture->ID3D11Texture3D_iface.lpVtbl = &d3d11_texture3d_vtbl;
texture->ID3D10Texture3D_iface.lpVtbl = &d3d10_texture3d_vtbl;
texture->refcount = 1;
More information about the wine-cvs
mailing list