anv/UpdateDescriptorSets: Respect write.dstArrayElement
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 12 Jan 2016 19:43:48 +0000 (11:43 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 12 Jan 2016 19:45:12 +0000 (11:45 -0800)
src/vulkan/anv_descriptor_set.c

index 6e53f3897c813d99abe2fd2602f6b8fe0bc13498..3e11047c6739df15321efc073a5d3007458866e4 100644 (file)
@@ -472,6 +472,7 @@ void anv_UpdateDescriptorSets(
          &set->layout->binding[write->dstBinding];
       struct anv_descriptor *desc =
          &set->descriptors[bind_layout->descriptor_index];
+      desc += write->dstArrayElement;
 
       switch (write->descriptorType) {
       case VK_DESCRIPTOR_TYPE_SAMPLER:
@@ -544,7 +545,8 @@ void anv_UpdateDescriptorSets(
             assert(buffer);
 
             struct anv_buffer_view *view =
-               &set->buffer_views[bind_layout->buffer_index + j];
+               &set->buffer_views[bind_layout->buffer_index];
+            view += write->dstArrayElement + j;
 
             const struct anv_format *format =
                anv_format_for_descriptor_type(write->descriptorType);