Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51485 Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 9 +++++++++ dlls/wined3d/cs.c | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index f85646050e7..0bea5973aa4 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -33104,6 +33104,15 @@ static void test_deferred_context_map(void)
ID3D11CommandList_Release(list);
+ /* Dead Rising unmaps a resource on the wrong context. */ + + hr = ID3D11DeviceContext_Map(immediate, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0); + + ID3D11DeviceContext_Unmap(immediate, (ID3D11Resource *)buffer, 0); + /* Test WRITE_NO_OVERWRITE. */
hr = ID3D11DeviceContext_Map(immediate, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc); diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 13c0fce5bb1..51e5055c4ab 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -2520,7 +2520,8 @@ HRESULT wined3d_device_context_emit_unmap(struct wined3d_device_context *context
wined3d_not_from_cs(context->device->cs);
- op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_MAP); + if (!(op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_MAP))) + return E_OUTOFMEMORY; op->opcode = WINED3D_CS_OP_UNMAP; op->resource = resource; op->sub_resource_idx = sub_resource_idx;