[PATCH 8/8] d3d11: Implement ID3D11DeviceContext::ExecuteCommandList().

Zebediah Figura (she/her) zfigura at codeweavers.com
Wed May 26 15:27:59 CDT 2021



On 5/26/21 11:36 AM, Henri Verbeet wrote:
> On Wed, 26 May 2021 at 07:23, Zebediah Figura <z.figura12 at gmail.com> wrote:
>> +static void wined3d_deferred_context_execute_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;
>> +    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;
>> +
>> +    if (restore_state)
>> +        wined3d_device_context_set_state(context, context->state);
>> +    else
>> +        wined3d_device_context_reset_state(context);
>> +
>> +    /* Grab a reference to each command list queued on this command list, as
>> +     * well as the command list itself. */
>> +    if (!wined3d_array_reserve((void **)&deferred->command_lists, &deferred->command_lists_capacity,
>> +            deferred->command_list_count + list->command_list_count + 1, sizeof(*deferred->command_lists)))
>> +        return;
>> +
>> +    for (i = 0; i < list->command_list_count; ++i)
>> +        wined3d_command_list_incref(deferred->command_lists[deferred->command_list_count++] = list->command_lists[i]);
>> +    wined3d_command_list_incref(deferred->command_lists[deferred->command_list_count++] = list);
>> +
> Is that really needed? Wouldn't the reference we keep to "list"
> already prevent anything referenced by "list" from being released?

I had to think through that for a minute, but I believe you're right.

> 
>> +void CDECL wined3d_device_context_execute_command_list(struct wined3d_device_context *context,
>> +        struct wined3d_command_list *list, BOOL restore_state)
>> +{
> bool, probably.
> 



More information about the wine-devel mailing list