mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +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:
parent
af16461858
commit
eb55325640
@ -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);
|
||||
@ -2834,4 +2839,16 @@ 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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -704,6 +704,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;
|
||||
std::array<uint32_t, MaxNumActiveBindings> m_descOffsets;
|
||||
@ -810,6 +812,10 @@ namespace dxvk {
|
||||
void commitComputeInitBarriers();
|
||||
void commitComputePostBarriers();
|
||||
|
||||
void trackDrawBuffer(
|
||||
const DxvkBufferSlice& buffer,
|
||||
VkBuffer handle);
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user