mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-13 19:29:14 +01:00
[dxvk] Bind consecutive descriptor sets in one go
Most of the time we'll be able to bind all sets in one iteration. Binding sets is expected to be cheap in the driver, but we should avoid unnecessary function call overhead for this frequently called function.
This commit is contained in:
parent
e2b7522034
commit
a27448bc76
@ -4384,18 +4384,19 @@ namespace dxvk {
|
||||
m_cmd->updateDescriptorSets(k, m_descriptorWrites.data());
|
||||
|
||||
// Bind all descriptor sets that need updating
|
||||
uint32_t bindSetMask = layoutSetMask & ~((1u << firstUpdated) - 1);
|
||||
uint32_t bindSetMask = layoutSetMask & ((~0u) << firstUpdated);
|
||||
|
||||
while (bindSetMask) {
|
||||
uint32_t setIndex = bit::tzcnt(bindSetMask);
|
||||
uint32_t setCount = bit::tzcnt(~(bindSetMask >> setIndex));
|
||||
|
||||
VkDescriptorSet& set = m_descriptorState.getSet<BindPoint>(setIndex);
|
||||
VkDescriptorSet* sets = &m_descriptorState.getSet<BindPoint>(setIndex);
|
||||
|
||||
m_cmd->cmdBindDescriptorSets(BindPoint,
|
||||
layout->getPipelineLayout(),
|
||||
setIndex, 1, &set, 0, nullptr);
|
||||
setIndex, setCount, sets, 0, nullptr);
|
||||
|
||||
bindSetMask &= bindSetMask - 1;
|
||||
bindSetMask &= (~0u) << (setIndex + setCount);
|
||||
}
|
||||
|
||||
// Update pipeline if there are unbound resources
|
||||
|
Loading…
x
Reference in New Issue
Block a user