From 8e4b3c0b0234ed74ffe7470e2d2e350a9d769d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Fri, 3 Feb 2017 14:08:50 +0100 Subject: [PATCH] d3d11: Use WINED3D_POOL_MANAGED for staging 3D textures. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes 3D staging textures CPU accessible. Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3d11/tests/d3d11.c | 4 +--- dlls/d3d11/texture.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index abd78c51ae9..1e966d47388 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -7972,8 +7972,7 @@ static void test_resource_map(void) memset(&mapped_subresource, 0, sizeof(mapped_subresource)); hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)texture3d, 0, D3D11_MAP_WRITE, 0, &mapped_subresource); - todo_wine ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr); - if (FAILED(hr)) goto done; + ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr); ok(mapped_subresource.RowPitch == 4 * 64, "Got unexpected row pitch %u.\n", mapped_subresource.RowPitch); ok(mapped_subresource.DepthPitch == 4 * 64 * 64, "Got unexpected depth pitch %u.\n", mapped_subresource.DepthPitch); @@ -7990,7 +7989,6 @@ static void test_resource_map(void) ok(data == 0xdeadbeef, "Got unexpected data %#x.\n", data); ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)texture3d, 0); -done: refcount = ID3D11Texture3D_Release(texture3d); ok(!refcount, "3D texture has %u references left.\n", refcount); diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c index 54c56133867..de1e865a069 100644 --- a/dlls/d3d11/texture.c +++ b/dlls/d3d11/texture.c @@ -946,7 +946,7 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE; wined3d_desc.multisample_quality = 0; wined3d_desc.usage = wined3d_usage_from_d3d11(desc->BindFlags, desc->Usage); - wined3d_desc.pool = WINED3D_POOL_DEFAULT; + wined3d_desc.pool = desc->Usage == D3D11_USAGE_STAGING ? WINED3D_POOL_MANAGED : WINED3D_POOL_DEFAULT; wined3d_desc.width = desc->Width; wined3d_desc.height = desc->Height; wined3d_desc.depth = desc->Depth;