Conor McCarthy (@cmccarthy) commented about libs/vkd3d/vkd3d_private.h:
struct d3d12_device *device; struct vkd3d_mutex op_mutex;
/* These fields are protected by op_mutex. */ struct vkd3d_cs_op_data *ops; size_t ops_count; size_t ops_size; bool is_flushing;
/* These fields are not protected by op_mutex, but can only be
* used by the thread that set is_flushing; when is_flushing is
* not set, aux_ops_count must be zero. */
struct vkd3d_cs_op_data *aux_ops;
size_t aux_ops_count;
size_t aux_ops_size;
It would be neater to introduce a new struct, e.g. `d3d12_command_queue_op_array`, with helpers to perform initialisation, allocation and cleanup. The swap operation could then be three lines.