[PATCH 3/5] d3d11: Implement d3d11_immediate_context_CopyStructureCount().

Józef Kucia jkucia at codeweavers.com
Fri Aug 4 12:53:49 CDT 2017


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/d3d11/device.c      | 14 +++++++++++++-
 dlls/d3d11/tests/d3d11.c |  4 ++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 14e21f9280..3fea1bb8c1 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -1025,8 +1025,20 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_UpdateSubresource(ID3D11De
 static void STDMETHODCALLTYPE d3d11_immediate_context_CopyStructureCount(ID3D11DeviceContext *iface,
         ID3D11Buffer *dst_buffer, UINT dst_offset, ID3D11UnorderedAccessView *src_view)
 {
-    FIXME("iface %p, dst_buffer %p, dst_offset %u, src_view %p stub!\n",
+    struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface);
+    struct d3d11_unordered_access_view *uav;
+    struct d3d_buffer *buffer_impl;
+
+    TRACE("iface %p, dst_buffer %p, dst_offset %u, src_view %p.\n",
             iface, dst_buffer, dst_offset, src_view);
+
+    buffer_impl = unsafe_impl_from_ID3D11Buffer(dst_buffer);
+    uav = unsafe_impl_from_ID3D11UnorderedAccessView(src_view);
+
+    wined3d_mutex_lock();
+    wined3d_device_copy_uav_counter(device->wined3d_device,
+            buffer_impl->wined3d_buffer, dst_offset, uav->wined3d_view);
+    wined3d_mutex_unlock();
 }
 
 static void STDMETHODCALLTYPE d3d11_immediate_context_ClearRenderTargetView(ID3D11DeviceContext *iface,
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 9af9f875c3..73269ed97f 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -17983,7 +17983,7 @@ static void test_uav_counters(void)
     /* produce */
     ID3D11DeviceContext_Dispatch(context, 16, 1, 1);
     data = read_uav_counter(context, staging_buffer, uav);
-    todo_wine ok(data == 64, "Got unexpected value %u.\n", data);
+    ok(data == 64, "Got unexpected value %u.\n", data);
     get_buffer_readback(buffer, &rb);
     memcpy(id, rb.map_desc.pData, 64 * sizeof(*id));
     release_resource_readback(&rb);
@@ -18027,7 +18027,7 @@ static void test_uav_counters(void)
     todo_wine ok(data == 4, "Got unexpected value %u.\n", data);
     ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
     data = read_uav_counter(context, staging_buffer, uav);
-    ok(!data, "Got unexpected value %u.\n", data);
+    todo_wine ok(!data, "Got unexpected value %u.\n", data);
     get_buffer_readback(buffer2, &rb);
     for (i = 0; i < 8; ++i)
     {
-- 
2.13.0




More information about the wine-patches mailing list