mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 14: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:
parent
d2d11bf995
commit
d8163c4446
@ -3,10 +3,9 @@
|
|||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
DxvkCommandList::DxvkCommandList(
|
DxvkCommandList::DxvkCommandList(DxvkDevice* device)
|
||||||
DxvkDevice* device,
|
: m_device (device),
|
||||||
uint32_t queueFamily)
|
m_vkd (device->vkd()),
|
||||||
: m_vkd (device->vkd()),
|
|
||||||
m_cmdBuffersUsed(0),
|
m_cmdBuffersUsed(0),
|
||||||
m_descriptorPoolTracker(device) {
|
m_descriptorPoolTracker(device) {
|
||||||
VkFenceCreateInfo fenceInfo;
|
VkFenceCreateInfo fenceInfo;
|
||||||
@ -21,7 +20,7 @@ namespace dxvk {
|
|||||||
poolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
|
poolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
|
||||||
poolInfo.pNext = nullptr;
|
poolInfo.pNext = nullptr;
|
||||||
poolInfo.flags = 0;
|
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)
|
if (m_vkd->vkCreateCommandPool(m_vkd->device(), &poolInfo, nullptr, &m_pool) != VK_SUCCESS)
|
||||||
throw DxvkError("DxvkCommandList: Failed to create command pool");
|
throw DxvkError("DxvkCommandList: Failed to create command pool");
|
||||||
@ -48,9 +47,10 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
VkResult DxvkCommandList::submit(
|
VkResult DxvkCommandList::submit(
|
||||||
VkQueue queue,
|
|
||||||
VkSemaphore waitSemaphore,
|
VkSemaphore waitSemaphore,
|
||||||
VkSemaphore wakeSemaphore) {
|
VkSemaphore wakeSemaphore) {
|
||||||
|
const auto& graphics = m_device->queues().graphics;
|
||||||
|
|
||||||
std::array<VkCommandBuffer, 2> cmdBuffers;
|
std::array<VkCommandBuffer, 2> cmdBuffers;
|
||||||
uint32_t cmdBufferCount = 0;
|
uint32_t cmdBufferCount = 0;
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ namespace dxvk {
|
|||||||
info.signalSemaphoreCount = wakeSemaphore == VK_NULL_HANDLE ? 0 : 1;
|
info.signalSemaphoreCount = wakeSemaphore == VK_NULL_HANDLE ? 0 : 1;
|
||||||
info.pSignalSemaphores = &wakeSemaphore;
|
info.pSignalSemaphores = &wakeSemaphore;
|
||||||
|
|
||||||
return m_vkd->vkQueueSubmit(queue, 1, &info, m_fence);
|
return m_vkd->vkQueueSubmit(graphics.queueHandle, 1, &info, m_fence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,9 +42,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DxvkCommandList(
|
DxvkCommandList(DxvkDevice* device);
|
||||||
DxvkDevice* device,
|
|
||||||
uint32_t queueFamily);
|
|
||||||
~DxvkCommandList();
|
~DxvkCommandList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -56,7 +54,6 @@ namespace dxvk {
|
|||||||
* \returns Submission status
|
* \returns Submission status
|
||||||
*/
|
*/
|
||||||
VkResult submit(
|
VkResult submit(
|
||||||
VkQueue queue,
|
|
||||||
VkSemaphore waitSemaphore,
|
VkSemaphore waitSemaphore,
|
||||||
VkSemaphore wakeSemaphore);
|
VkSemaphore wakeSemaphore);
|
||||||
|
|
||||||
@ -724,6 +721,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
DxvkDevice* m_device;
|
||||||
Rc<vk::DeviceFn> m_vkd;
|
Rc<vk::DeviceFn> m_vkd;
|
||||||
|
|
||||||
VkFence m_fence;
|
VkFence m_fence;
|
||||||
|
@ -70,7 +70,7 @@ namespace dxvk {
|
|||||||
Rc<DxvkCommandList> cmdList = m_recycledCommandLists.retrieveObject();
|
Rc<DxvkCommandList> cmdList = m_recycledCommandLists.retrieveObject();
|
||||||
|
|
||||||
if (cmdList == nullptr)
|
if (cmdList == nullptr)
|
||||||
cmdList = new DxvkCommandList(this, m_queues.graphics.queueFamily);
|
cmdList = new DxvkCommandList(this);
|
||||||
|
|
||||||
return cmdList;
|
return cmdList;
|
||||||
}
|
}
|
||||||
@ -229,7 +229,6 @@ namespace dxvk {
|
|||||||
VkSemaphore wakeSync) {
|
VkSemaphore wakeSync) {
|
||||||
DxvkSubmitInfo submitInfo;
|
DxvkSubmitInfo submitInfo;
|
||||||
submitInfo.cmdList = commandList;
|
submitInfo.cmdList = commandList;
|
||||||
submitInfo.queue = m_queues.graphics.queueHandle;
|
|
||||||
submitInfo.waitSync = waitSync;
|
submitInfo.waitSync = waitSync;
|
||||||
submitInfo.wakeSync = wakeSync;
|
submitInfo.wakeSync = wakeSync;
|
||||||
m_submissionQueue.submit(submitInfo);
|
m_submissionQueue.submit(submitInfo);
|
||||||
|
@ -86,7 +86,6 @@ namespace dxvk {
|
|||||||
{ std::lock_guard<std::mutex> lock(m_mutexQueue);
|
{ std::lock_guard<std::mutex> lock(m_mutexQueue);
|
||||||
|
|
||||||
status = submitInfo.cmdList->submit(
|
status = submitInfo.cmdList->submit(
|
||||||
submitInfo.queue,
|
|
||||||
submitInfo.waitSync,
|
submitInfo.waitSync,
|
||||||
submitInfo.wakeSync);
|
submitInfo.wakeSync);
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ namespace dxvk {
|
|||||||
*/
|
*/
|
||||||
struct DxvkSubmitInfo {
|
struct DxvkSubmitInfo {
|
||||||
Rc<DxvkCommandList> cmdList;
|
Rc<DxvkCommandList> cmdList;
|
||||||
VkQueue queue;
|
|
||||||
VkSemaphore waitSync;
|
VkSemaphore waitSync;
|
||||||
VkSemaphore wakeSync;
|
VkSemaphore wakeSync;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user