glsl: fix shader_storage_blocks_write_access for SSBO block arrays
authorMarek Olšák <marek.olsak@amd.com>
Mon, 8 Apr 2019 21:20:13 +0000 (17:20 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 9 Apr 2019 23:25:35 +0000 (19:25 -0400)
CTS: GL45-CTS.compute_shader.resources-max

Fixes: 4e1e8f684bf "glsl: remember which SSBOs are not read-only and pass it to gallium"
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/link_uniforms.cpp

index ef1241119912513803aa27bb374f69c15f83f00e..bbd71593948002ad86bad2078015c8f08cf7f8e0 100644 (file)
@@ -544,8 +544,12 @@ public:
          assert(buffer_block_index != -1);
 
          if (var->is_in_shader_storage_block() &&
-             !var->data.memory_read_only)
-            shader_storage_blocks_write_access |= 1 << buffer_block_index;
+             !var->data.memory_read_only) {
+            shader_storage_blocks_write_access |=
+               u_bit_consecutive(buffer_block_index,
+                                 var->type->is_array() ?
+                                    var->type->array_size() : 1);
+         }
 
          /* Uniform blocks that were specified with an instance name must be
           * handled a little bit differently.  The name of the variable is the