[PATCH 9/9] d3d11: Use WINED3D_POOL_MANAGED for staging 3D textures.

Józef Kucia jkucia at codeweavers.com
Fri Feb 3 07:08:50 CST 2017


This makes 3D staging textures CPU accessible.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 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 abd78c5..1e966d4 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 54c5613..de1e865 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;
-- 
2.10.2




More information about the wine-patches mailing list