Giovanni Mascellani (@giomasce) commented about libs/vkd3d/command.c:
+ + if (!(op = d3d12_command_queue_op_array_require_space(&command_queue->op_queue))) + { + ERR("Failed to add op.\n"); + goto done; + } + + op->opcode = VKD3D_CS_OP_UPDATE_MAPPINGS; + memset(&op->u.update_mappings, 0, sizeof(op->u.update_mappings)); + op->u.update_mappings.resource = resource_impl; + op->u.update_mappings.heap = heap_impl; + if (!clone_tile_mapping_parameter((void **)&op->u.update_mappings.region_start_coordinates, + region_start_coordinates, sizeof(*region_start_coordinates), region_count)) + { + ERR("Failed to allocate region start coordinates.\n"); + goto done; All this `goto`'s do not properly release allocated memory, and leave the half-filled op structure in the array, even if they don't submit for flushing.
Also, maybe all the clone operations could be done before taking the `op_mutex` lock, so there is as little contention as possible. I am never sure on this kind of micro-optimizations, but I always feel some excitement for critical sections that only set a few bytes and are done. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/216#note_35269