diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 6138764971f..e97af4846ba 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -90,6 +90,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * { if ((usage & WINED3DUSAGE_RENDERTARGET) && !(format->flags & WINED3DFMT_FLAG_RENDERTARGET)) return WINED3DERR_INVALIDCALL; + if ((usage & WINED3DUSAGE_DEPTHSTENCIL) && !(format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))) + return WINED3DERR_INVALIDCALL; } resource->ref = 1;