summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_cmd_buffer.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-08-02 09:56:32 +0200
committerSamuel Pitoiset <[email protected]>2019-08-02 09:56:55 +0200
commit7368000868c21e72778d66b0cfd7661abfacfd00 (patch)
tree518d1d9f62e832982f8307f0b7a882afad13cf3c /src/amd/vulkan/radv_cmd_buffer.c
parent96a54455592646f34a2c80656bd75aef1cb00305 (diff)
radv: re-apply "Optimize rebinding the same descriptor set."
This makes it cheaper to just change the dynamic offsets with the same descriptor sets. This optimization has been reverted a while back because of random GPU hangs on GFX9, no it looks fine, at least CTS no longer hangs on GFX9 and it doesn't hang on GFX10 as well. It fixes a performance problem with Wolfenstein Youngblood. Suggested-by: Philip Rebohle <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_cmd_buffer.c')
-rw-r--r--src/amd/vulkan/radv_cmd_buffer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index da373d39fdd..b5c1476ed22 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -3350,7 +3350,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;