anv: set right datatypes in anv_pipeline_binding
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Fri, 25 Aug 2017 15:31:14 +0000 (17:31 +0200)
committerJuan A. Suarez Romero <jasuarez@igalia.com>
Wed, 30 Aug 2017 06:01:53 +0000 (08:01 +0200)
This structure contains two fields, binding and index, that store the
binding in the descriptor set and the index inside the binding.

These structures are defined as uint8_t, but the types in Vulkan
specification are uint32_t, so big values are clamp.

This fixes dEQP-VK.binding_model.shader_access.*.multiple_arbitrary_descriptors.*

v2: use UINT32_MAX for index when having no render targets (Tapani)

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/intel/vulkan/anv_pipeline.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/genX_pipeline.c

index 8306cd366ac8bc2c8316eb01c937c1979765f11c..94e99d8437ad8743181b9d575b3a150a1182c378 100644 (file)
@@ -907,7 +907,7 @@ anv_pipeline_compile_fs(struct anv_pipeline *pipeline,
          rt_bindings[0] = (struct anv_pipeline_binding) {
             .set = ANV_DESCRIPTOR_SET_COLOR_ATTACHMENTS,
             .binding = 0,
-            .index = UINT8_MAX,
+            .index = UINT32_MAX,
          };
          num_rts = 1;
       }
index b30b71f3367d5a29b6425749252d2d8736141409..674bc28cc02eef73682268d824334ad8a6d1d991 100644 (file)
@@ -1246,10 +1246,10 @@ struct anv_pipeline_binding {
    uint8_t set;
 
    /* Binding in the descriptor set */
-   uint8_t binding;
+   uint32_t binding;
 
    /* Index in the binding */
-   uint8_t index;
+   uint32_t index;
 
    /* Input attachment index (relative to the subpass) */
    uint8_t input_attachment_index;
index 8065163dc4622bdb9f7be4ef689785ae07ee7827..83c4487bf9b13fd1208871fcca0f3f443f26f9db 100644 (file)
@@ -1346,7 +1346,7 @@ has_color_buffer_write_enabled(const struct anv_pipeline *pipeline)
       if (bind_map->surface_to_descriptor[i].set !=
           ANV_DESCRIPTOR_SET_COLOR_ATTACHMENTS)
          continue;
-      if (bind_map->surface_to_descriptor[i].index != UINT8_MAX)
+      if (bind_map->surface_to_descriptor[i].index != UINT32_MAX)
          return true;
    }