mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 20:52:10 +01:00
[dxvk] Avoid redundant descriptor set updates when binding buffers (v2)
We need to check not just the buffer object but also the length of the bound buffer range, since this information will be written into the descriptor and cannot be changed via dynamic offsets. Fixes: f501ebc ('[dxvk] Avoid redundant descriptor set updates when binding buffers')
This commit is contained in:
parent
af15d85baa
commit
02d92210ad
@ -148,12 +148,24 @@ namespace dxvk {
|
||||
void DxvkContext::bindResourceBuffer(
|
||||
uint32_t slot,
|
||||
const DxvkBufferSlice& buffer) {
|
||||
m_rc[slot].bufferSlice = buffer;
|
||||
m_rcTracked.clr(slot);
|
||||
bool needsUpdate = !m_rc[slot].bufferSlice.matchesBuffer(buffer);
|
||||
|
||||
m_flags.set(
|
||||
DxvkContextFlag::CpDirtyResources,
|
||||
DxvkContextFlag::GpDirtyResources);
|
||||
if (likely(needsUpdate))
|
||||
m_rcTracked.clr(slot);
|
||||
else
|
||||
needsUpdate = m_rc[slot].bufferSlice.length() != buffer.length();
|
||||
|
||||
if (likely(needsUpdate)) {
|
||||
m_flags.set(
|
||||
DxvkContextFlag::CpDirtyResources,
|
||||
DxvkContextFlag::GpDirtyResources);
|
||||
} else {
|
||||
m_flags.set(
|
||||
DxvkContextFlag::CpDirtyDescriptorOffsets,
|
||||
DxvkContextFlag::GpDirtyDescriptorOffsets);
|
||||
}
|
||||
|
||||
m_rc[slot].bufferSlice = buffer;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user