=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d9: Implement d3d9_device_CreateDepthStencilSurfaceEx().
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Feb 3 07:40:01 CST 2016
Module: wine
Branch: stable
Commit: bedeba0f33593072612224fa03338f3cba72130c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bedeba0f33593072612224fa03338f3cba72130c
Author: Józef Kucia <joseph.kucia at gmail.com>
Date: Thu Jan 7 16:22:45 2016 +0100
d3d9: Implement d3d9_device_CreateDepthStencilSurfaceEx().
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 89c6a755c4c752558b8d3bf3ba3883d8d3ab4cbd)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
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 16b27e5..2e4042b 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,
More information about the wine-cvs
mailing list