mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 09:48:07 +02:00
radv: Optimize rebinding the same descriptor set.
This makes it cheaper to just change the dynamic offsets with the same descriptor sets. Suggested-by: Philip Rebohle <philip.rebohle@tu-dortmund.de> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
This commit is contained in:
parent
14976817f4
commit
02a43edf18
1 changed files with 7 additions and 1 deletions
|
|
@ -2464,7 +2464,13 @@ void radv_CmdBindDescriptorSets(
|
|||
for (unsigned i = 0; i < descriptorSetCount; ++i) {
|
||||
unsigned idx = i + firstSet;
|
||||
RADV_FROM_HANDLE(radv_descriptor_set, set, pDescriptorSets[i]);
|
||||
radv_bind_descriptor_set(cmd_buffer, pipelineBindPoint, set, idx);
|
||||
|
||||
/* If the set is already bound we only need to update the
|
||||
* (potentially changed) dynamic offsets. */
|
||||
if (descriptors_state->sets[idx] != set ||
|
||||
!(descriptors_state->valid & (1u << idx))) {
|
||||
radv_bind_descriptor_set(cmd_buffer, pipelineBindPoint, set, idx);
|
||||
}
|
||||
|
||||
for(unsigned j = 0; j < set->layout->dynamic_offset_count; ++j, ++dyn_idx) {
|
||||
unsigned idx = j + layout->set[i + firstSet].dynamic_offset_start;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue