Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/cs.c | 51 ++++++++++++++++------------------ dlls/wined3d/device.c | 2 +- dlls/wined3d/wined3d_private.h | 5 ++-- 3 files changed, 28 insertions(+), 30 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index c5fc8fbb7a6..24f35298879 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -2353,25 +2353,13 @@ static void wined3d_cs_issue_query(struct wined3d_device_context *context, query->state = QUERY_SIGNALLED; }
-static void wined3d_cs_execute_command_list(struct wined3d_device_context *context, +static void wined3d_cs_acquire_command_list(struct wined3d_device_context *context, struct wined3d_command_list *list, bool restore_state) { - struct wined3d_cs_execute_command_list *op; SIZE_T i;
- op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); - op->opcode = WINED3D_CS_OP_EXECUTE_COMMAND_LIST; - op->list = list; - for (i = 0; i < list->resource_count; ++i) wined3d_resource_acquire(list->resources[i]); - - wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); - - if (restore_state) - wined3d_device_context_set_state(context, context->state); - else - wined3d_device_context_reset_state(context); }
static void wined3d_cs_exec_preload_resource(struct wined3d_cs *cs, const void *data) @@ -2962,6 +2950,25 @@ static void wined3d_cs_exec_execute_command_list(struct wined3d_cs *cs, const vo } }
+void wined3d_device_context_emit_execute_command_list(struct wined3d_device_context *context, + struct wined3d_command_list *list, bool restore_state) +{ + struct wined3d_cs_execute_command_list *op; + + op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); + op->opcode = WINED3D_CS_OP_EXECUTE_COMMAND_LIST; + op->list = list; + + context->ops->acquire_command_list(context, list); + + wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); + + if (restore_state) + wined3d_device_context_set_state(context, context->state); + else + wined3d_device_context_reset_state(context); +} + static void *wined3d_cs_st_require_space(struct wined3d_device_context *context, size_t size, enum wined3d_cs_queue_id queue_id) { @@ -3042,7 +3049,7 @@ static const struct wined3d_device_context_ops wined3d_cs_st_ops = wined3d_cs_issue_query, wined3d_cs_flush, wined3d_cs_acquire_resource, - wined3d_cs_execute_command_list, + wined3d_cs_acquire_command_list, };
static BOOL wined3d_cs_queue_is_empty(const struct wined3d_cs *cs, const struct wined3d_cs_queue *queue) @@ -3168,7 +3175,7 @@ static const struct wined3d_device_context_ops wined3d_cs_mt_ops = wined3d_cs_issue_query, wined3d_cs_flush, wined3d_cs_acquire_resource, - wined3d_cs_execute_command_list, + wined3d_cs_acquire_command_list, };
static void poll_queries(struct wined3d_cs *cs) @@ -3561,20 +3568,10 @@ static void wined3d_deferred_context_acquire_resource(struct wined3d_device_cont wined3d_resource_incref(resource); }
-static void wined3d_deferred_context_execute_command_list(struct wined3d_device_context *context, +static void wined3d_deferred_context_acquire_command_list(struct wined3d_device_context *context, struct wined3d_command_list *list, bool restore_state) { struct wined3d_deferred_context *deferred = wined3d_deferred_context_from_context(context); - struct wined3d_cs_execute_command_list *op; - - op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); - op->opcode = WINED3D_CS_OP_EXECUTE_COMMAND_LIST; - op->list = list; - - if (restore_state) - wined3d_device_context_set_state(context, context->state); - else - wined3d_device_context_reset_state(context);
/* Grab a reference to the command list. Note that this implicitly prevents * any dependent command lists or resources from being freed as well. */ @@ -3596,7 +3593,7 @@ static const struct wined3d_device_context_ops wined3d_deferred_context_ops = wined3d_deferred_context_issue_query, wined3d_deferred_context_flush, wined3d_deferred_context_acquire_resource, - wined3d_deferred_context_execute_command_list, + wined3d_deferred_context_acquire_command_list, };
HRESULT CDECL wined3d_deferred_context_create(struct wined3d_device *device, struct wined3d_device_context **context) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 55879e546f2..c550899466f 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4908,7 +4908,7 @@ void CDECL wined3d_device_context_execute_command_list(struct wined3d_device_con { TRACE("context %p, list %p, restore_state %d.\n", context, list, restore_state);
- context->ops->execute_command_list(context, list, restore_state); + wined3d_device_context_emit_execute_command_list(context, list, restore_state); }
struct wined3d_rendertarget_view * CDECL wined3d_device_context_get_rendertarget_view( diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 36e1fa4ec7a..5ba00871222 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4717,8 +4717,7 @@ struct wined3d_device_context_ops void (*issue_query)(struct wined3d_device_context *context, struct wined3d_query *query, unsigned int flags); void (*flush)(struct wined3d_device_context *context); void (*acquire_resource)(struct wined3d_device_context *context, struct wined3d_resource *resource); - void (*execute_command_list)(struct wined3d_device_context *context, - struct wined3d_command_list *list, bool restore_state); + void (*acquire_command_list)(struct wined3d_device_context *context, struct wined3d_command_list *list); };
struct wined3d_device_context @@ -4798,6 +4797,8 @@ void wined3d_device_context_emit_draw(struct wined3d_device_context *context, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count, int base_vertex_idx, unsigned int start_idx, unsigned int index_count, unsigned int start_instance, unsigned int instance_count, bool indexed) DECLSPEC_HIDDEN; +void wined3d_device_context_emit_execute_command_list(struct wined3d_device_context *context, + struct wined3d_command_list *list, bool restore_state) DECLSPEC_HIDDEN; void wined3d_device_context_emit_generate_mipmaps(struct wined3d_device_context *context, struct wined3d_shader_resource_view *view) DECLSPEC_HIDDEN; HRESULT wined3d_device_context_emit_map(struct wined3d_device_context *context,
On Fri, 2 Jul 2021 at 18:46, Zebediah Figura zfigura@codeweavers.com wrote:
+static void wined3d_cs_acquire_command_list(struct wined3d_device_context *context, struct wined3d_command_list *list, bool restore_state)
[...]
+static void wined3d_deferred_context_acquire_command_list(struct wined3d_device_context *context, struct wined3d_command_list *list, bool restore_state)
[...]
- void (*acquire_command_list)(struct wined3d_device_context *context, struct wined3d_command_list *list);
Those don't quite match.