Skip to content

Commit

Permalink
vkd3d: Don't fuse high-prio COPY and COMPUTE queues on one queue.
Browse files Browse the repository at this point in the history
Signed-off-by: Hans-Kristian Arntzen <[email protected]>
  • Loading branch information
HansKristian-Work committed Jan 6, 2025
1 parent 9d07d38 commit 7c2d8d5
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions libs/vkd3d/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -2636,13 +2636,25 @@ struct vkd3d_queue *d3d12_device_allocate_vkd3d_queue(struct vkd3d_queue_family_
{
unsigned int num_available_physical_queues = 0;
struct vkd3d_queue *last_vacant_queue = NULL;
D3D12_COMMAND_LIST_TYPE type;
struct vkd3d_queue *queue;
bool allow_vacant_queue;
bool is_higher_prio;
unsigned int i, j;
int prio;

prio = command_queue ? command_queue->desc.Priority : D3D12_COMMAND_QUEUE_PRIORITY_NORMAL;
if (command_queue)
{
prio = command_queue->desc.Priority;
type = command_queue->desc.Type;
}
else
{
prio = D3D12_COMMAND_QUEUE_PRIORITY_NORMAL;
/* This is effectively ignored since internal queues are created on startup. */
type = D3D12_COMMAND_LIST_TYPE_DIRECT;
}

is_higher_prio = prio >= D3D12_COMMAND_QUEUE_PRIORITY_HIGH;

for (i = 0; i < queue_family->queue_count; i++)
Expand Down Expand Up @@ -2684,7 +2696,12 @@ struct vkd3d_queue *d3d12_device_allocate_vkd3d_queue(struct vkd3d_queue_family_
bool same_prio_level = candidate->command_queue_count != 0;

for (j = 0; j < candidate->command_queue_count && same_prio_level; j++)
same_prio_level = candidate->command_queues[j]->desc.Priority == prio;
{
/* Only fuse physical queues here if they are of the same type.
* E.g. high-prio COMPUTE and high-prio COPY should be able to get their separate queues. */
same_prio_level = candidate->command_queues[j]->desc.Priority == prio &&
candidate->command_queues[j]->desc.Type == type;
}

if (!same_prio_level)
continue;
Expand Down

0 comments on commit 7c2d8d5

Please sign in to comment.