1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[dxvk] Don't pass queue handles to DxvkCommandList

Instead, pull them from the device as needed. This coupling would
only make sense if we required one command list per queue family.
This commit is contained in:
Philip Rebohle 2019-06-28 00:29:34 +02:00
parent d2d11bf995
commit d8163c4446
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
5 changed files with 10 additions and 15 deletions

View File

@ -3,10 +3,9 @@
namespace dxvk {
DxvkCommandList::DxvkCommandList(
DxvkDevice* device,
uint32_t queueFamily)
: m_vkd (device->vkd()),
DxvkCommandList::DxvkCommandList(DxvkDevice* device)
: m_device (device),
m_vkd (device->vkd()),
m_cmdBuffersUsed(0),
m_descriptorPoolTracker(device) {
VkFenceCreateInfo fenceInfo;
@ -21,7 +20,7 @@ namespace dxvk {
poolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
poolInfo.pNext = nullptr;
poolInfo.flags = 0;
poolInfo.queueFamilyIndex = queueFamily;
poolInfo.queueFamilyIndex = device->queues().graphics.queueFamily;
if (m_vkd->vkCreateCommandPool(m_vkd->device(), &poolInfo, nullptr, &m_pool) != VK_SUCCESS)
throw DxvkError("DxvkCommandList: Failed to create command pool");
@ -48,9 +47,10 @@ namespace dxvk {
VkResult DxvkCommandList::submit(
VkQueue queue,
VkSemaphore waitSemaphore,
VkSemaphore wakeSemaphore) {
const auto& graphics = m_device->queues().graphics;
std::array<VkCommandBuffer, 2> cmdBuffers;
uint32_t cmdBufferCount = 0;
@ -73,7 +73,7 @@ namespace dxvk {
info.signalSemaphoreCount = wakeSemaphore == VK_NULL_HANDLE ? 0 : 1;
info.pSignalSemaphores = &wakeSemaphore;
return m_vkd->vkQueueSubmit(queue, 1, &info, m_fence);
return m_vkd->vkQueueSubmit(graphics.queueHandle, 1, &info, m_fence);
}

View File

@ -42,9 +42,7 @@ namespace dxvk {
public:
DxvkCommandList(
DxvkDevice* device,
uint32_t queueFamily);
DxvkCommandList(DxvkDevice* device);
~DxvkCommandList();
/**
@ -56,7 +54,6 @@ namespace dxvk {
* \returns Submission status
*/
VkResult submit(
VkQueue queue,
VkSemaphore waitSemaphore,
VkSemaphore wakeSemaphore);
@ -724,6 +721,7 @@ namespace dxvk {
private:
DxvkDevice* m_device;
Rc<vk::DeviceFn> m_vkd;
VkFence m_fence;

View File

@ -70,7 +70,7 @@ namespace dxvk {
Rc<DxvkCommandList> cmdList = m_recycledCommandLists.retrieveObject();
if (cmdList == nullptr)
cmdList = new DxvkCommandList(this, m_queues.graphics.queueFamily);
cmdList = new DxvkCommandList(this);
return cmdList;
}
@ -229,7 +229,6 @@ namespace dxvk {
VkSemaphore wakeSync) {
DxvkSubmitInfo submitInfo;
submitInfo.cmdList = commandList;
submitInfo.queue = m_queues.graphics.queueHandle;
submitInfo.waitSync = waitSync;
submitInfo.wakeSync = wakeSync;
m_submissionQueue.submit(submitInfo);

View File

@ -86,7 +86,6 @@ namespace dxvk {
{ std::lock_guard<std::mutex> lock(m_mutexQueue);
status = submitInfo.cmdList->submit(
submitInfo.queue,
submitInfo.waitSync,
submitInfo.wakeSync);
}

View File

@ -22,7 +22,6 @@ namespace dxvk {
*/
struct DxvkSubmitInfo {
Rc<DxvkCommandList> cmdList;
VkQueue queue;
VkSemaphore waitSync;
VkSemaphore wakeSync;
};