radv: fix the dynamic buffer index in vkCmdBindDescriptorSets
authorFredrik Höglund <fredrik@kde.org>
Tue, 7 Mar 2017 00:53:20 +0000 (01:53 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 7 Mar 2017 19:23:04 +0000 (20:23 +0100)
This fixes the wrong dynamic buffer descriptors being updated when
firstSet > 0.

Cc: 17.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c

index 821306556ecef7cfbef889fa2a0cc0493e1393ad..5b44ce8452967f0e67ff1c99fdb6a4561a7ca42b 100644 (file)
@@ -1823,7 +1823,7 @@ void radv_CmdBindDescriptorSets(
                radv_bind_descriptor_set(cmd_buffer, set, idx);
 
                for(unsigned j = 0; j < set->layout->dynamic_offset_count; ++j, ++dyn_idx) {
-                       unsigned idx = j + layout->set[i].dynamic_offset_start;
+                       unsigned idx = j + layout->set[i + firstSet].dynamic_offset_start;
                        uint32_t *dst = cmd_buffer->dynamic_buffers + idx * 4;
                        assert(dyn_idx < dynamicOffsetCount);