Module: Mesa
Branch: master
Commit: 8943c80c9b171c638b98c35a28840f13b66c7860
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8943c80c9b171c638b98c35a28840f13b66c7860

Author: Bas Nieuwenhuizen <[email protected]>
Date:   Fri Oct 30 23:41:27 2020 +0100

radv: Fix variable name collision.

idx was aliased, and eb104e949ee4b7e0813d14f11a4a952bae48fe80 started
using the outer var in the inner scope ...

Fixes: eb104e949ee4b7e0813d14f11a4a952bae48fe80
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3701
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7388>

---

 src/amd/vulkan/radv_cmd_buffer.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index bb88d1064a6..f0a4d05fc6f 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -3880,17 +3880,17 @@ void radv_CmdBindDescriptorSets(
                radv_get_descriptors_state(cmd_buffer, pipelineBindPoint);
 
        for (unsigned i = 0; i < descriptorSetCount; ++i) {
-               unsigned idx = i + firstSet;
+               unsigned set_idx = i + firstSet;
                RADV_FROM_HANDLE(radv_descriptor_set, set, pDescriptorSets[i]);
 
                /* 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);
+               if (descriptors_state->sets[set_idx] != set ||
+                   !(descriptors_state->valid & (1u << set_idx))) {
+                       radv_bind_descriptor_set(cmd_buffer, pipelineBindPoint, 
set, set_idx);
                }
 
-               for(unsigned j = 0; j < layout->set[idx].dynamic_offset_count; 
++j, ++dyn_idx) {
+               for(unsigned j = 0; j < 
layout->set[set_idx].dynamic_offset_count; ++j, ++dyn_idx) {
                        unsigned idx = j + layout->set[i + 
firstSet].dynamic_offset_start;
                        uint32_t *dst = descriptors_state->dynamic_buffers + 
idx * 4;
                        assert(dyn_idx < dynamicOffsetCount);
@@ -3919,7 +3919,7 @@ void radv_CmdBindDescriptorSets(
                                }
                        }
 
-                       cmd_buffer->push_constant_stages |= 
layout->set[idx].dynamic_offset_stages;
+                       cmd_buffer->push_constant_stages |= 
layout->set[set_idx].dynamic_offset_stages;
                }
        }
 }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to