1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-03 04:24:11 +01:00

[dxvk] Introduce flag to synchronize transfer queue

Also, get rid of superfluous binary semaphores since we have
a straight per-submission timeline anyway.
This commit is contained in:
Philip Rebohle 2024-10-18 10:14:22 +02:00 committed by Philip Rebohle
parent 13da763f9b
commit 0723250c12
2 changed files with 25 additions and 1 deletions

View File

@ -232,7 +232,7 @@ namespace dxvk {
timelines.graphics, VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT);
}
// Submit transfer commands as necessary
// Execute transfer command buffer, if any
if (cmd.usedFlags.test(DxvkCmdBuffer::SdmaBuffer))
m_commandSubmission.executeCommandBuffer(cmd.sdmaBuffer);
@ -294,6 +294,16 @@ namespace dxvk {
if ((status = m_commandSubmission.submit(m_device, graphics.queueHandle)))
return status;
}
// Finally, submit semaphore wait on the transfer queue. If this
// is not the final iteration, fold the wait into the next one.
if (cmd.syncSdma) {
m_commandSubmission.waitSemaphore(semaphores.graphics,
timelines.graphics, VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT);
if (isLast && (status = m_commandSubmission.submit(m_device, transfer.queueHandle)))
return status;
}
}
return VK_SUCCESS;
@ -349,7 +359,9 @@ namespace dxvk {
m_cmd.sdmaBuffer = m_transferPool->getCommandBuffer();
}
m_cmd.syncSdma = VK_FALSE;
m_cmd.usedFlags = 0;
m_cmd.sparseBind = VK_FALSE;
}

View File

@ -145,6 +145,7 @@ namespace dxvk {
*/
struct DxvkCommandSubmissionInfo {
DxvkCmdBufferFlags usedFlags = 0;
VkBool32 syncSdma = VK_FALSE;
VkCommandBuffer execBuffer = VK_NULL_HANDLE;
VkCommandBuffer initBuffer = VK_NULL_HANDLE;
VkCommandBuffer sdmaBuffer = VK_NULL_HANDLE;
@ -366,6 +367,17 @@ namespace dxvk {
m_wsiSemaphores = wsiSemaphores;
}
/**
* \brief Sets flag to stall transfer queue
*
* If set, the current submission will submit a semaphore
* wait to the transfer queue in order to stall subsequent
* submissions. Necessary in case of resource relocations.
*/
void setSubmissionBarrier() {
m_cmd.syncSdma = VK_TRUE;
}
/**
* \brief Resets the command list
*