Pablo Martin : d3d11: Make UpdateSubresource1 call wined3d_device_update_sub_resource directly.

Alexandre Julliard julliard at winehq.org
Wed May 23 15:52:04 CDT 2018


Module: wine
Branch: master
Commit: 04a9e3330f6db1dea6fb87aae451f69a954fea94
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=04a9e3330f6db1dea6fb87aae451f69a954fea94

Author: Pablo Martin <pmart-wine at riseup.net>
Date:   Tue May 22 14:37:50 2018 +0200

d3d11: Make UpdateSubresource1 call wined3d_device_update_sub_resource directly.

Signed-off-by: Pablo Martin <pmart-wine at riseup.net>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d11/device.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 4ca4f46..36ed44b 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -2631,13 +2631,22 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_UpdateSubresource1(ID3D11D
         ID3D11Resource *resource, UINT subresource_idx, const D3D11_BOX *box, const void *data,
         UINT row_pitch, UINT depth_pitch, UINT flags)
 {
+    struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface);
+    struct wined3d_resource *wined3d_resource;
+    struct wined3d_box wined3d_box;
+
     TRACE("iface %p, resource %p, subresource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u, flags %#x.\n",
             iface, resource, subresource_idx, box, data, row_pitch, depth_pitch, flags);
 
-    if (flags)
-        FIXME("Ignoring flags %#x.\n", flags);
+    if (box)
+        wined3d_box_set(&wined3d_box, box->left, box->top, box->right, box->bottom,
+                box->front, box->back);
 
-    d3d11_immediate_context_UpdateSubresource(iface, resource, subresource_idx, box, data, row_pitch, depth_pitch);
+    wined3d_resource = wined3d_resource_from_d3d11_resource(resource);
+    wined3d_mutex_lock();
+    wined3d_device_update_sub_resource(device->wined3d_device, wined3d_resource, subresource_idx,
+            box ? &wined3d_box : NULL, data, row_pitch, depth_pitch, flags);
+    wined3d_mutex_unlock();
 }
 
 static void STDMETHODCALLTYPE d3d11_immediate_context_DiscardResource(ID3D11DeviceContext1 *iface,




More information about the wine-cvs mailing list