glsl: simplify SSBO resources check
authorTimothy Arceri <timothy.arceri@collabora.com>
Sat, 2 Apr 2016 00:48:27 +0000 (11:48 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Sat, 2 Apr 2016 06:10:56 +0000 (17:10 +1100)
We already have a count of active SSBOs per stage so use it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/linker.cpp

index ab90961a898b5c98ea722cb7bf890580b1d43266..47087c862432a17229a4fad67755c4785cbc3221 100644 (file)
@@ -3072,13 +3072,7 @@ check_image_resources(struct gl_context *ctx, struct gl_shader_program *prog)
                          ctx->Const.Program[i].MaxImageUniforms);
 
          total_image_units += sh->NumImages;
-
-         for (unsigned j = 0; j < prog->NumBufferInterfaceBlocks; j++) {
-            int stage_index = prog->InterfaceBlockStageIndex[i][j];
-            if (stage_index != -1 &&
-                sh->BufferInterfaceBlocks[stage_index]->IsShaderStorage)
-               total_shader_storage_blocks++;
-         }
+         total_shader_storage_blocks += sh->NumShaderStorageBlocks;
 
          if (i == MESA_SHADER_FRAGMENT) {
             foreach_in_list(ir_instruction, node, sh->ir) {