Zebediah Figura : d3d11: Forbid map types other than DISCARD and NOOVERWRITE on a deferred context.
Alexandre Julliard
julliard at winehq.org
Thu Jul 1 15:53:51 CDT 2021
Module: wine
Branch: master
Commit: 1e9c094aa66e1eb9c2b6b891dfbec99816b67d7a
URL: https://source.winehq.org/git/wine.git/?a=commit;h=1e9c094aa66e1eb9c2b6b891dfbec99816b67d7a
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Wed Jun 30 17:38:32 2021 -0500
d3d11: Forbid map types other than DISCARD and NOOVERWRITE on a deferred context.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d11/device.c | 4 ++++
dlls/d3d11/tests/d3d11.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 56f34c70ea1..d043af7051a 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -744,6 +744,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_context_Map(ID3D11DeviceContext1 *
if (map_flags)
FIXME("Ignoring map_flags %#x.\n", map_flags);
+ if (context->type != D3D11_DEVICE_CONTEXT_IMMEDIATE
+ && map_type != D3D11_MAP_WRITE_DISCARD && map_type != D3D11_MAP_WRITE_NO_OVERWRITE)
+ return E_INVALIDARG;
+
wined3d_resource = wined3d_resource_from_d3d11_resource(resource);
wined3d_mutex_lock();
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index a2858ed0155..6d5141ea90d 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -33046,7 +33046,7 @@ static void test_deferred_context_map(void)
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE, 0, &map_desc);
- todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &map_desc);
todo_wine ok(hr == D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD, "Got unexpected hr %#x.\n", hr);
More information about the wine-cvs
mailing list