[PATCH 2/4] d3d9: Implement d3d9_device_CreateDepthStencilSurfaceEx().
Józef Kucia
jkucia at codeweavers.com
Thu Jan 7 09:22:45 CST 2016
From: Józef Kucia <joseph.kucia at gmail.com>
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
For bug 34185.
---
dlls/d3d9/device.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 294e680..ef019b1 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -3352,16 +3352,28 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurfaceEx(IDirect3DDevice9Ex
UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality,
BOOL discard, IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage)
{
- FIXME("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u,\n"
- "discard %#x, surface %p, shared_handle %p, usage %#x stub!\n",
+ struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
+ DWORD flags = WINED3D_SURFACE_MAPPABLE;
+
+ TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u, "
+ "discard %#x, surface %p, shared_handle %p, usage %#x.\n",
iface, width, height, format, multisample_type, multisample_quality,
discard, surface, shared_handle, usage);
- *surface = NULL;
+ if (usage & D3DUSAGE_DEPTHSTENCIL)
+ {
+ WARN("Invalid usage %#x.\n", usage);
+ return D3DERR_INVALIDCALL;
+ }
+
if (shared_handle)
FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
- return E_NOTIMPL;
+ if (discard)
+ flags |= WINED3D_SURFACE_DISCARD;
+
+ return d3d9_device_create_surface(device, width, height, format, flags, surface,
+ D3DUSAGE_DEPTHSTENCIL | usage, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL);
}
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_ResetEx(IDirect3DDevice9Ex *iface,
--
2.4.10
More information about the wine-patches
mailing list