mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[dxvk] Consider indirect draw buffer in graphics pipeline barriers
This commit is contained in:
parent
f60d1db1f1
commit
c44d30d78b
@ -4353,7 +4353,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_state.gp.flags.test(DxvkGraphicsPipelineFlag::HasStorageDescriptors))
|
if (m_state.gp.flags.test(DxvkGraphicsPipelineFlag::HasStorageDescriptors))
|
||||||
this->commitGraphicsBarriers<Indexed>();
|
this->commitGraphicsBarriers<Indexed, Indirect>();
|
||||||
|
|
||||||
if (m_flags.test(DxvkContextFlag::GpDirtyFramebuffer))
|
if (m_flags.test(DxvkContextFlag::GpDirtyFramebuffer))
|
||||||
this->updateFramebuffer();
|
this->updateFramebuffer();
|
||||||
@ -4538,7 +4538,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<bool Indexed>
|
template<bool Indexed, bool Indirect>
|
||||||
void DxvkContext::commitGraphicsBarriers() {
|
void DxvkContext::commitGraphicsBarriers() {
|
||||||
auto layout = m_state.gp.pipeline->layout();
|
auto layout = m_state.gp.pipeline->layout();
|
||||||
|
|
||||||
@ -4548,6 +4548,23 @@ namespace dxvk {
|
|||||||
|
|
||||||
bool requiresBarrier = false;
|
bool requiresBarrier = false;
|
||||||
|
|
||||||
|
// Check the draw buffer for indirect draw calls
|
||||||
|
if (m_flags.test(DxvkContextFlag::DirtyDrawBuffer) && Indirect) {
|
||||||
|
std::array<DxvkBufferSlice*, 2> slices = {{
|
||||||
|
&m_state.id.argBuffer,
|
||||||
|
&m_state.id.cntBuffer,
|
||||||
|
}};
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < slices.size() && !requiresBarrier; i++) {
|
||||||
|
if (slices[i]->defined()
|
||||||
|
&& slices[i]->bufferInfo().usage & storageBufferUsage) {
|
||||||
|
requiresBarrier = this->checkGfxBufferBarrier(*slices[i],
|
||||||
|
VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT,
|
||||||
|
VK_ACCESS_INDIRECT_COMMAND_READ_BIT).test(DxvkAccess::Write);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Read-only stage, so we only have to check this if
|
// Read-only stage, so we only have to check this if
|
||||||
// the bindngs have actually changed between draws
|
// the bindngs have actually changed between draws
|
||||||
if (m_flags.test(DxvkContextFlag::GpDirtyIndexBuffer) && !requiresBarrier && Indexed) {
|
if (m_flags.test(DxvkContextFlag::GpDirtyIndexBuffer) && !requiresBarrier && Indexed) {
|
||||||
|
@ -1183,7 +1183,7 @@ namespace dxvk {
|
|||||||
void commitComputeInitBarriers();
|
void commitComputeInitBarriers();
|
||||||
void commitComputePostBarriers();
|
void commitComputePostBarriers();
|
||||||
|
|
||||||
template<bool Indexed>
|
template<bool Indexed, bool Indirect>
|
||||||
void commitGraphicsBarriers();
|
void commitGraphicsBarriers();
|
||||||
|
|
||||||
DxvkAccessFlags checkGfxBufferBarrier(
|
DxvkAccessFlags checkGfxBufferBarrier(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user