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

[dxvk] Fix missing buffer tracking for indirect draw calls

This is optimized to allow a large number of indirect draws to be
submitted if they all access the same argument buffer, as is the
case in Assassin's Creed Syndicate and Odyssey.
This commit is contained in:
Philip Rebohle 2018-10-07 17:51:44 +02:00
parent af16461858
commit eb55325640
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 23 additions and 0 deletions

View File

@ -52,6 +52,7 @@ namespace dxvk {
Rc<DxvkCommandList> DxvkContext::endRecording() {
this->spillRenderPass();
this->trackDrawBuffer(DxvkBufferSlice(), VK_NULL_HANDLE);
m_queries.trackQueryPools(m_cmd);
@ -946,6 +947,8 @@ namespace dxvk {
descriptor.buffer.buffer,
descriptor.buffer.offset,
count, stride);
this->trackDrawBuffer(buffer, descriptor.buffer.buffer);
}
m_cmd->addStatCtr(DxvkStatCounter::CmdDrawCalls, 1);
@ -984,6 +987,8 @@ namespace dxvk {
descriptor.buffer.buffer,
descriptor.buffer.offset,
count, stride);
this->trackDrawBuffer(buffer, descriptor.buffer.buffer);
}
m_cmd->addStatCtr(DxvkStatCounter::CmdDrawCalls, 1);
@ -2833,5 +2838,17 @@ namespace dxvk {
}
}
}
void DxvkContext::trackDrawBuffer(
const DxvkBufferSlice& buffer,
VkBuffer handle) {
if (m_lastIndirectDrawBuffer != handle) {
m_lastIndirectDrawBuffer = handle;
if (handle != VK_NULL_HANDLE)
m_cmd->trackResource(buffer.resource());
}
}
}

View File

@ -703,6 +703,8 @@ namespace dxvk {
VkDescriptorSet m_gpSet = VK_NULL_HANDLE;
VkDescriptorSet m_cpSet = VK_NULL_HANDLE;
VkBuffer m_lastIndirectDrawBuffer = VK_NULL_HANDLE;
std::array<DxvkShaderResourceSlot, MaxNumResourceSlots> m_rc;
std::array<DxvkDescriptorInfo, MaxNumActiveBindings> m_descInfos;
@ -809,6 +811,10 @@ namespace dxvk {
void commitComputeInitBarriers();
void commitComputePostBarriers();
void trackDrawBuffer(
const DxvkBufferSlice& buffer,
VkBuffer handle);
};