Skip to content

Commit

Permalink
[dxvk] Create async compute queue
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpyneDreams committed Nov 28, 2024
1 parent b8ce414 commit 0882e53
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/dxvk/dxvk_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ namespace dxvk {
DxvkAdapterQueueIndices queues;
queues.graphics = graphicsQueue;
queues.transfer = transferQueue;
queues.sparse = sparseQueue;
queues.sparse = sparseQueue;
queues.compute = computeQueue;
return queues;
}

Expand Down Expand Up @@ -465,18 +466,19 @@ namespace dxvk {
DxvkAdapterQueueIndices queueFamilies = findQueueFamilies();
queueFamiliySet.insert(queueFamilies.graphics);
queueFamiliySet.insert(queueFamilies.transfer);
queueFamiliySet.insert(queueFamilies.compute);

if (queueFamilies.sparse != VK_QUEUE_FAMILY_IGNORED)
queueFamiliySet.insert(queueFamilies.sparse);

this->logQueueFamilies(queueFamilies);

for (uint32_t family : queueFamiliySet) {
VkDeviceQueueCreateInfo graphicsQueue = { VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO };
graphicsQueue.queueFamilyIndex = family;
graphicsQueue.queueCount = 1;
graphicsQueue.pQueuePriorities = &queuePriority;
queueInfos.push_back(graphicsQueue);
VkDeviceQueueCreateInfo queueCreateInfo = { VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO };
queueCreateInfo.queueFamilyIndex = family;
queueCreateInfo.queueCount = 1;
queueCreateInfo.pQueuePriorities = &queuePriority;
queueInfos.push_back(queueCreateInfo);
}

VkDeviceCreateInfo info = { VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, enabledFeatures.core.pNext };
Expand Down Expand Up @@ -1347,7 +1349,8 @@ namespace dxvk {
Logger::info(str::format("Queue families:",
"\n Graphics : ", queues.graphics,
"\n Transfer : ", queues.transfer,
"\n Sparse : ", queues.sparse != VK_QUEUE_FAMILY_IGNORED ? str::format(queues.sparse) : "n/a"));
"\n Sparse : ", queues.sparse != VK_QUEUE_FAMILY_IGNORED ? str::format(queues.sparse) : "n/a",
"\n Compute : ", queues.compute != VK_QUEUE_FAMILY_IGNORED ? str::format(queues.compute) : "n/a"));
}


Expand Down
1 change: 1 addition & 0 deletions src/dxvk/dxvk_adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ namespace dxvk {
uint32_t graphics;
uint32_t transfer;
uint32_t sparse;
uint32_t compute;
};


Expand Down

0 comments on commit 0882e53

Please sign in to comment.