From e0e4f9bbcda1243b9317dbfbeeff84a18b4e855c Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 7 Jun 2017 21:31:54 +0200 Subject: [PATCH] wined3d: Use WINED3D_CS_QUEUE_MAP for WINED3D_CS_OP_UPDATE_SUB_RESOURCE. Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/cs.c | 6 +++--- dlls/wined3d/device.c | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 1e1d69e11ac..c7df670682d 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -2146,7 +2146,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r { struct wined3d_cs_update_sub_resource *op; - op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); + op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_MAP); op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE; op->resource = resource; op->sub_resource_idx = sub_resource_idx; @@ -2157,10 +2157,10 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r wined3d_resource_acquire(resource); - cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT); + cs->ops->submit(cs, WINED3D_CS_QUEUE_MAP); /* The data pointer may go away, so we need to wait until it is read. * Copying the data may be faster if it's small. */ - cs->ops->finish(cs, WINED3D_CS_QUEUE_DEFAULT); + cs->ops->finish(cs, WINED3D_CS_QUEUE_MAP); } static void wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, const void *data) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e07d07c41e3..ded4af6616c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4216,6 +4216,8 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str return; } + wined3d_resource_wait_idle(resource); + wined3d_cs_emit_update_sub_resource(device->cs, resource, sub_resource_idx, box, data, row_pitch, depth_pitch); }