anv/cmd_buffer: Use anv_descriptor_for_binding for samplers
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 15 Dec 2017 21:59:33 +0000 (13:59 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 24 Jan 2018 05:10:31 +0000 (21:10 -0800)
Tested-by: Józef Kucia <joseph.kucia@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Cc: "18.0" <mesa-stable@lists.freedesktop.org>
src/intel/vulkan/genX_cmd_buffer.c

index 389dd7871d6a5df2767040976341fd5bf56c9082..479f75b3b1a9353c6177314467435935fc87cb25 100644 (file)
@@ -1752,10 +1752,8 @@ emit_samplers(struct anv_cmd_buffer *cmd_buffer,
 
    for (uint32_t s = 0; s < map->sampler_count; s++) {
       struct anv_pipeline_binding *binding = &map->sampler_to_descriptor[s];
-      struct anv_descriptor_set *set =
-         cmd_buffer->state.descriptors[binding->set];
-      uint32_t offset = set->layout->binding[binding->binding].descriptor_index;
-      struct anv_descriptor *desc = &set->descriptors[offset + binding->index];
+      const struct anv_descriptor *desc =
+         anv_descriptor_for_binding(cmd_buffer, binding);
 
       if (desc->type != VK_DESCRIPTOR_TYPE_SAMPLER &&
           desc->type != VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER)