mesa: Rename {Num}UniformBlocks to {Num}BufferInterfaceBlocks
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 1 Oct 2015 07:08:20 +0000 (09:08 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Wed, 14 Oct 2015 06:11:13 +0000 (08:11 +0200)
Currently, these arrays in gl_shader and gl_shader_program hold both
UBOs and SSBOs, so this looks like a better name. We were already
using NumBufferInterfaceBlocks in gl_shader_program, so this makes
things more consistent as well.

In a later patch we will add {Num}UniformBlocks and
{Num}ShaderStorageBlocks which will contain only references to
UBOs and SSBOs respectively that will provide backends with
a separate index space for both types of objects.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
15 files changed:
src/glsl/link_uniform_initializers.cpp
src/glsl/link_uniforms.cpp
src/glsl/linker.cpp
src/glsl/lower_ubo_reference.cpp
src/glsl/nir/glsl_to_nir.cpp
src/glsl/standalone_scaffolding.cpp
src/mesa/drivers/dri/i965/brw_shader.cpp
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/main/mtypes.h
src/mesa/main/shader_query.cpp
src/mesa/main/shaderapi.c
src/mesa/main/shaderobj.c
src/mesa/main/uniforms.c
src/mesa/state_tracker/st_atom_constbuf.c
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 065257b5a0ea80763d32eb9a3009fcd69751c578..c48ca69c641417d40c4136727d69a971801fcf03 100644 (file)
@@ -49,7 +49,7 @@ get_uniform_block_index(const gl_shader_program *shProg,
                         const char *uniformBlockName)
 {
    for (unsigned i = 0; i < shProg->NumBufferInterfaceBlocks; i++) {
-      if (!strcmp(shProg->UniformBlocks[i].Name, uniformBlockName))
+      if (!strcmp(shProg->BufferInterfaceBlocks[i].Name, uniformBlockName))
         return i;
    }
 
@@ -169,7 +169,7 @@ set_block_binding(gl_shader_program *prog, const char *block_name, int binding)
 
          if (stage_index != -1) {
             struct gl_shader *sh = prog->_LinkedShaders[i];
-            sh->UniformBlocks[stage_index].Binding = binding;
+            sh->BufferInterfaceBlocks[stage_index].Binding = binding;
          }
       }
 }
index 0ccd9c8c8652b948fbe83ae2c35e663794c91cbd..5465687a954ef2fffa8c97596d0f65f78127603a 100644 (file)
@@ -502,9 +502,9 @@ public:
 
             for (unsigned i = 0; i < prog->NumBufferInterfaceBlocks; i++) {
                if (strncmp(var->get_interface_type()->name,
-                           prog->UniformBlocks[i].Name,
+                           prog->BufferInterfaceBlocks[i].Name,
                            l) == 0
-                   && prog->UniformBlocks[i].Name[l] == '[') {
+                   && prog->BufferInterfaceBlocks[i].Name[l] == '[') {
                   ubo_block_index = i;
                   break;
                }
@@ -512,7 +512,7 @@ public:
          } else {
             for (unsigned i = 0; i < prog->NumBufferInterfaceBlocks; i++) {
                if (strcmp(var->get_interface_type()->name,
-                          prog->UniformBlocks[i].Name) == 0) {
+                          prog->BufferInterfaceBlocks[i].Name) == 0) {
                   ubo_block_index = i;
                   break;
                }
@@ -530,7 +530,7 @@ public:
             ubo_byte_offset = 0;
          } else {
             const struct gl_uniform_block *const block =
-               &prog->UniformBlocks[ubo_block_index];
+               &prog->BufferInterfaceBlocks[ubo_block_index];
 
             assert(var->data.location != -1);
 
@@ -971,10 +971,10 @@ link_update_uniform_buffer_variables(struct gl_shader *shader)
       }
 
       const unsigned l = strlen(var->name);
-      for (unsigned i = 0; i < shader->NumUniformBlocks; i++) {
-        for (unsigned j = 0; j < shader->UniformBlocks[i].NumUniforms; j++) {
+      for (unsigned i = 0; i < shader->NumBufferInterfaceBlocks; i++) {
+        for (unsigned j = 0; j < shader->BufferInterfaceBlocks[i].NumUniforms; j++) {
             if (sentinel) {
-               const char *begin = shader->UniformBlocks[i].Uniforms[j].Name;
+               const char *begin = shader->BufferInterfaceBlocks[i].Uniforms[j].Name;
                const char *end = strchr(begin, sentinel);
 
                if (end == NULL)
@@ -989,7 +989,7 @@ link_update_uniform_buffer_variables(struct gl_shader *shader)
                   break;
                }
             } else if (!strcmp(var->name,
-                               shader->UniformBlocks[i].Uniforms[j].Name)) {
+                               shader->BufferInterfaceBlocks[i].Uniforms[j].Name)) {
               found = true;
               var->data.location = j;
               break;
@@ -1115,10 +1115,10 @@ link_assign_uniform_locations(struct gl_shader_program *prog,
       sh->num_uniform_components = uniform_size.num_shader_uniform_components;
       sh->num_combined_uniform_components = sh->num_uniform_components;
 
-      for (unsigned i = 0; i < sh->NumUniformBlocks; i++) {
-         if (!sh->UniformBlocks[i].IsShaderStorage) {
+      for (unsigned i = 0; i < sh->NumBufferInterfaceBlocks; i++) {
+         if (!sh->BufferInterfaceBlocks[i].IsShaderStorage) {
            sh->num_combined_uniform_components +=
-              sh->UniformBlocks[i].UniformBufferSize / 4;
+              sh->BufferInterfaceBlocks[i].UniformBufferSize / 4;
          }
       }
    }
index a97b4ef0a32d11e43268fe94a2b058bdd1eb8c8d..8d30bea8cf0d027684a41a8c3c30b2a19e7131f6 100644 (file)
@@ -1161,7 +1161,7 @@ cross_validate_uniforms(struct gl_shader_program *prog)
 }
 
 /**
- * Accumulates the array of prog->UniformBlocks and checks that all
+ * Accumulates the array of prog->BufferInterfaceBlocks and checks that all
  * definitons of blocks agree on their contents.
  */
 static bool
@@ -1170,7 +1170,7 @@ interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog)
    unsigned max_num_uniform_blocks = 0;
    for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
       if (prog->_LinkedShaders[i])
-        max_num_uniform_blocks += prog->_LinkedShaders[i]->NumUniformBlocks;
+        max_num_uniform_blocks += prog->_LinkedShaders[i]->NumBufferInterfaceBlocks;
    }
 
    for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
@@ -1184,15 +1184,15 @@ interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog)
       if (sh == NULL)
         continue;
 
-      for (unsigned int j = 0; j < sh->NumUniformBlocks; j++) {
+      for (unsigned int j = 0; j < sh->NumBufferInterfaceBlocks; j++) {
         int index = link_cross_validate_uniform_block(prog,
-                                                      &prog->UniformBlocks,
+                                                      &prog->BufferInterfaceBlocks,
                                                       &prog->NumBufferInterfaceBlocks,
-                                                      &sh->UniformBlocks[j]);
+                                                      &sh->BufferInterfaceBlocks[j]);
 
         if (index == -1) {
            linker_error(prog, "uniform block `%s' has mismatching definitions\n",
-                        sh->UniformBlocks[j].Name);
+                        sh->BufferInterfaceBlocks[j].Name);
            return false;
         }
 
@@ -2064,9 +2064,9 @@ link_intrastage_shaders(void *mem_ctx,
    linked->ir = new(linked) exec_list;
    clone_ir_list(mem_ctx, linked->ir, main->ir);
 
-   linked->UniformBlocks = uniform_blocks;
-   linked->NumUniformBlocks = num_uniform_blocks;
-   ralloc_steal(linked, linked->UniformBlocks);
+   linked->BufferInterfaceBlocks = uniform_blocks;
+   linked->NumBufferInterfaceBlocks = num_uniform_blocks;
+   ralloc_steal(linked, linked->BufferInterfaceBlocks);
 
    link_fs_input_layout_qualifiers(prog, linked, shader_list, num_shaders);
    link_tcs_out_layout_qualifiers(prog, linked, shader_list, num_shaders);
@@ -2804,19 +2804,19 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
 
    for (unsigned i = 0; i < prog->NumBufferInterfaceBlocks; i++) {
       /* Don't check SSBOs for Uniform Block Size */
-      if (!prog->UniformBlocks[i].IsShaderStorage &&
-          prog->UniformBlocks[i].UniformBufferSize > ctx->Const.MaxUniformBlockSize) {
+      if (!prog->BufferInterfaceBlocks[i].IsShaderStorage &&
+          prog->BufferInterfaceBlocks[i].UniformBufferSize > ctx->Const.MaxUniformBlockSize) {
          linker_error(prog, "Uniform block %s too big (%d/%d)\n",
-                      prog->UniformBlocks[i].Name,
-                      prog->UniformBlocks[i].UniformBufferSize,
+                      prog->BufferInterfaceBlocks[i].Name,
+                      prog->BufferInterfaceBlocks[i].UniformBufferSize,
                       ctx->Const.MaxUniformBlockSize);
       }
 
-      if (prog->UniformBlocks[i].IsShaderStorage &&
-          prog->UniformBlocks[i].UniformBufferSize > ctx->Const.MaxShaderStorageBlockSize) {
+      if (prog->BufferInterfaceBlocks[i].IsShaderStorage &&
+          prog->BufferInterfaceBlocks[i].UniformBufferSize > ctx->Const.MaxShaderStorageBlockSize) {
          linker_error(prog, "Shader storage block %s too big (%d/%d)\n",
-                      prog->UniformBlocks[i].Name,
-                      prog->UniformBlocks[i].UniformBufferSize,
+                      prog->BufferInterfaceBlocks[i].Name,
+                      prog->BufferInterfaceBlocks[i].UniformBufferSize,
                       ctx->Const.MaxShaderStorageBlockSize);
       }
 
@@ -2824,7 +2824,7 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
         if (prog->UniformBlockStageIndex[j][i] != -1) {
             struct gl_shader *sh = prog->_LinkedShaders[j];
             int stage_index = prog->UniformBlockStageIndex[j][i];
-            if (sh && sh->UniformBlocks[stage_index].IsShaderStorage) {
+            if (sh && sh->BufferInterfaceBlocks[stage_index].IsShaderStorage) {
                shader_blocks[j]++;
                total_shader_storage_blocks++;
             } else {
@@ -2941,7 +2941,7 @@ check_image_resources(struct gl_context *ctx, struct gl_shader_program *prog)
 
          for (unsigned j = 0; j < prog->NumBufferInterfaceBlocks; j++) {
             int stage_index = prog->UniformBlockStageIndex[i][j];
-            if (stage_index != -1 && sh->UniformBlocks[stage_index].IsShaderStorage)
+            if (stage_index != -1 && sh->BufferInterfaceBlocks[stage_index].IsShaderStorage)
                total_shader_storage_blocks++;
          }
 
@@ -3147,7 +3147,7 @@ should_add_buffer_variable(struct gl_shader_program *shProg,
       return true;
 
    for (unsigned i = 0; i < shProg->NumBufferInterfaceBlocks; i++) {
-      block_name = shProg->UniformBlocks[i].Name;
+      block_name = shProg->BufferInterfaceBlocks[i].Name;
       if (strncmp(block_name, name, strlen(block_name)) == 0) {
          found_interface = true;
          break;
@@ -3480,10 +3480,10 @@ build_program_resource_list(struct gl_shader_program *shProg)
 
    /* Add program uniform blocks and shader storage blocks. */
    for (unsigned i = 0; i < shProg->NumBufferInterfaceBlocks; i++) {
-      bool is_shader_storage = shProg->UniformBlocks[i].IsShaderStorage;
+      bool is_shader_storage = shProg->BufferInterfaceBlocks[i].IsShaderStorage;
       GLenum type = is_shader_storage ? GL_SHADER_STORAGE_BLOCK : GL_UNIFORM_BLOCK;
       if (!add_program_resource(shProg, type,
-          &shProg->UniformBlocks[i], 0))
+          &shProg->BufferInterfaceBlocks[i], 0))
          return;
    }
 
index c8ec5c19f41151e12bebe9ca79c99509f522c9ba..6886f1439ec8acf8c7cf77c7c91b16d41995c1aa 100644 (file)
@@ -279,8 +279,8 @@ lower_ubo_reference_visitor::setup_for_load_or_store(ir_variable *var,
 
    /* Locate the ubo block by interface name */
    this->uniform_block = NULL;
-   for (unsigned i = 0; i < shader->NumUniformBlocks; i++) {
-      if (strcmp(field_name, shader->UniformBlocks[i].Name) == 0) {
+   for (unsigned i = 0; i < shader->NumBufferInterfaceBlocks; i++) {
+      if (strcmp(field_name, shader->BufferInterfaceBlocks[i].Name) == 0) {
 
          ir_constant *index = new(mem_ctx) ir_constant(i);
 
@@ -292,9 +292,9 @@ lower_ubo_reference_visitor::setup_for_load_or_store(ir_variable *var,
             this->uniform_block = index;
          }
 
-         this->is_shader_storage = shader->UniformBlocks[i].IsShaderStorage;
+         this->is_shader_storage = shader->BufferInterfaceBlocks[i].IsShaderStorage;
 
-         struct gl_uniform_block *block = &shader->UniformBlocks[i];
+         struct gl_uniform_block *block = &shader->BufferInterfaceBlocks[i];
 
          this->ubo_var = var->is_interface_instance()
             ? &block->Uniforms[0] : &block->Uniforms[var->data.location];
index 4b9201e2f601ba0388e9403360c8ebc958bb9881..6f67b1dae5b17a01318578b2105fef04f0a4a3d9 100644 (file)
@@ -152,7 +152,7 @@ glsl_to_nir(const struct gl_shader_program *shader_prog,
 
    shader->info.name = ralloc_asprintf(shader, "GLSL%d", sh->Name);
    shader->info.num_textures = num_textures;
-   shader->info.num_ubos = sh->NumUniformBlocks;
+   shader->info.num_ubos = sh->NumBufferInterfaceBlocks;
    shader->info.num_abos = shader_prog->NumAtomicBuffers;
    shader->info.num_ssbos = shader_prog->NumBufferInterfaceBlocks;
    shader->info.num_images = sh->NumImages;
index f08e2d5350633030d3229846218a111b2796591d..595279277763a20c7af10ea3ed771f5a973c2834 100644 (file)
@@ -107,8 +107,8 @@ _mesa_clear_shader_program_data(struct gl_shader_program *shProg)
    ralloc_free(shProg->InfoLog);
    shProg->InfoLog = ralloc_strdup(shProg, "");
 
-   ralloc_free(shProg->UniformBlocks);
-   shProg->UniformBlocks = NULL;
+   ralloc_free(shProg->BufferInterfaceBlocks);
+   shProg->BufferInterfaceBlocks = NULL;
    shProg->NumBufferInterfaceBlocks = 0;
    for (i = 0; i < MESA_SHADER_STAGES; i++) {
       ralloc_free(shProg->UniformBlockStageIndex[i]);
index 0f743fb43c1f3c5277890c3a844dc4ccff93192b..b41e842005adcee66f51d70867e50f1b82569e29 100644 (file)
@@ -1128,9 +1128,9 @@ brw_assign_common_binding_table_offsets(gl_shader_stage stage,
    next_binding_table_offset += num_textures;
 
    if (shader) {
-      assert(shader->NumUniformBlocks <= BRW_MAX_COMBINED_UBO_SSBO);
+      assert(shader->NumBufferInterfaceBlocks <= BRW_MAX_COMBINED_UBO_SSBO);
       stage_prog_data->binding_table.ubo_start = next_binding_table_offset;
-      next_binding_table_offset += shader->NumUniformBlocks;
+      next_binding_table_offset += shader->NumBufferInterfaceBlocks;
    } else {
       stage_prog_data->binding_table.ubo_start = 0xd0d0d0d0;
    }
index d73f657edc7cf934e0f47715f05924bea955b42f..3c0197716036dd4489b5a7ee1a3cc3bfc5c29534 100644 (file)
@@ -929,17 +929,17 @@ brw_upload_ubo_surfaces(struct brw_context *brw,
    uint32_t *surf_offsets =
       &stage_state->surf_offset[prog_data->binding_table.ubo_start];
 
-   for (int i = 0; i < shader->NumUniformBlocks; i++) {
+   for (int i = 0; i < shader->NumBufferInterfaceBlocks; i++) {
       struct intel_buffer_object *intel_bo;
 
       /* Because behavior for referencing outside of the binding's size in the
        * glBindBufferRange case is undefined, we can just bind the whole buffer
        * glBindBufferBase wants and be a correct implementation.
        */
-      if (!shader->UniformBlocks[i].IsShaderStorage) {
+      if (!shader->BufferInterfaceBlocks[i].IsShaderStorage) {
          struct gl_uniform_buffer_binding *binding;
          binding =
-            &ctx->UniformBufferBindings[shader->UniformBlocks[i].Binding];
+            &ctx->UniformBufferBindings[shader->BufferInterfaceBlocks[i].Binding];
          if (binding->BufferObject == ctx->Shared->NullBufferObj) {
             brw->vtbl.emit_null_surface_state(brw, 1, 1, 1, &surf_offsets[i]);
          } else {
@@ -956,7 +956,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw,
       } else {
          struct gl_shader_storage_buffer_binding *binding;
          binding =
-            &ctx->ShaderStorageBufferBindings[shader->UniformBlocks[i].Binding];
+            &ctx->ShaderStorageBufferBindings[shader->BufferInterfaceBlocks[i].Binding];
          if (binding->BufferObject == ctx->Shared->NullBufferObj) {
             brw->vtbl.emit_null_surface_state(brw, 1, 1, 1, &surf_offsets[i]);
          } else {
@@ -973,7 +973,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw,
       }
    }
 
-   if (shader->NumUniformBlocks)
+   if (shader->NumBufferInterfaceBlocks)
       brw->ctx.NewDriverState |= BRW_NEW_SURFACES;
 }
 
index 62eb592763757e975340a674e5254fd5837aaabd..f62ad3416ea127412db27c52a0f3fd9c2009892f 100644 (file)
@@ -2288,8 +2288,8 @@ struct gl_shader
     *
     * These fields are only set post-linking.
     */
-   unsigned NumUniformBlocks;
-   struct gl_uniform_block *UniformBlocks;
+   unsigned NumBufferInterfaceBlocks;
+   struct gl_uniform_block *BufferInterfaceBlocks;
 
    struct exec_list *ir;
    struct exec_list *packed_varyings;
@@ -2688,7 +2688,7 @@ struct gl_shader_program
    unsigned LastClipDistanceArraySize;
 
    unsigned NumBufferInterfaceBlocks;
-   struct gl_uniform_block *UniformBlocks;
+   struct gl_uniform_block *BufferInterfaceBlocks;
 
    /**
     * Indices into the _LinkedShaders's UniformBlocks[] array for each stage
index 324e1a68fa4fd19c31ea7c161717dc1ab71939a6..50b44fa9e164ad2c707cdc1abd685cd7876226a6 100644 (file)
@@ -927,7 +927,7 @@ program_resource_top_level_array_size(struct gl_shader_program *shProg,
    int array_size = -1;
    char *var_name = get_top_level_name(name);
    char *interface_name =
-      get_top_level_name(shProg->UniformBlocks[block_index].Name);
+      get_top_level_name(shProg->BufferInterfaceBlocks[block_index].Name);
 
    if (strcmp(var_name, interface_name) == 0) {
       /* Deal with instanced array of SSBOs */
@@ -997,7 +997,7 @@ program_resource_top_level_array_stride(struct gl_shader_program *shProg,
    int array_stride = -1;
    char *var_name = get_top_level_name(name);
    char *interface_name =
-      get_top_level_name(shProg->UniformBlocks[block_index].Name);
+      get_top_level_name(shProg->BufferInterfaceBlocks[block_index].Name);
 
    if (strcmp(var_name, interface_name) == 0) {
       /* Deal with instanced array of SSBOs */
index 9dd1054c8ee4820f3be0fcf3252731471187ef1c..6a2f60db77ecdf86549a722c36401c156e568319 100644 (file)
@@ -716,7 +716,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname,
       for (i = 0; i < shProg->NumBufferInterfaceBlocks; i++) {
         /* Add one for the terminating NUL character.
          */
-        const GLint len = strlen(shProg->UniformBlocks[i].Name) + 1;
+        const GLint len = strlen(shProg->BufferInterfaceBlocks[i].Name) + 1;
 
         if (len > max_len)
            max_len = len;
@@ -731,7 +731,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname,
 
       *params = 0;
       for (unsigned i = 0; i < shProg->NumBufferInterfaceBlocks; i++) {
-         if (!shProg->UniformBlocks[i].IsShaderStorage)
+         if (!shProg->BufferInterfaceBlocks[i].IsShaderStorage)
             (*params)++;
       }
       return;
index 4e85fda24b40e60d1373fe24c7ed9cac613ee0b6..ffc71931feccf66eafa1ffde3e70ca9be16bfed3 100644 (file)
@@ -290,8 +290,8 @@ _mesa_clear_shader_program_data(struct gl_shader_program *shProg)
    ralloc_free(shProg->InfoLog);
    shProg->InfoLog = ralloc_strdup(shProg, "");
 
-   ralloc_free(shProg->UniformBlocks);
-   shProg->UniformBlocks = NULL;
+   ralloc_free(shProg->BufferInterfaceBlocks);
+   shProg->BufferInterfaceBlocks = NULL;
    shProg->NumBufferInterfaceBlocks = 0;
    for (i = 0; i < MESA_SHADER_STAGES; i++) {
       ralloc_free(shProg->UniformBlockStageIndex[i]);
index 04cc81f98099c834d9d388200773f13958c9ecd5..bc235380d977c9b96403c78989475842457a5415 100644 (file)
@@ -1016,21 +1016,21 @@ _mesa_UniformBlockBinding(GLuint program,
       return;
    }
 
-   if (shProg->UniformBlocks[uniformBlockIndex].Binding !=
+   if (shProg->BufferInterfaceBlocks[uniformBlockIndex].Binding !=
        uniformBlockBinding) {
       int i;
 
       FLUSH_VERTICES(ctx, 0);
       ctx->NewDriverState |= ctx->DriverFlags.NewUniformBuffer;
 
-      shProg->UniformBlocks[uniformBlockIndex].Binding = uniformBlockBinding;
+      shProg->BufferInterfaceBlocks[uniformBlockIndex].Binding = uniformBlockBinding;
 
       for (i = 0; i < MESA_SHADER_STAGES; i++) {
         int stage_index = shProg->UniformBlockStageIndex[i][uniformBlockIndex];
 
         if (stage_index != -1) {
            struct gl_shader *sh = shProg->_LinkedShaders[i];
-           sh->UniformBlocks[stage_index].Binding = uniformBlockBinding;
+           sh->BufferInterfaceBlocks[stage_index].Binding = uniformBlockBinding;
         }
       }
    }
@@ -1069,21 +1069,21 @@ _mesa_ShaderStorageBlockBinding(GLuint program,
       return;
    }
 
-   if (shProg->UniformBlocks[shaderStorageBlockIndex].Binding !=
+   if (shProg->BufferInterfaceBlocks[shaderStorageBlockIndex].Binding !=
        shaderStorageBlockBinding) {
       int i;
 
       FLUSH_VERTICES(ctx, 0);
       ctx->NewDriverState |= ctx->DriverFlags.NewShaderStorageBuffer;
 
-      shProg->UniformBlocks[shaderStorageBlockIndex].Binding = shaderStorageBlockBinding;
+      shProg->BufferInterfaceBlocks[shaderStorageBlockIndex].Binding = shaderStorageBlockBinding;
 
       for (i = 0; i < MESA_SHADER_STAGES; i++) {
         int stage_index = shProg->UniformBlockStageIndex[i][shaderStorageBlockIndex];
 
         if (stage_index != -1) {
            struct gl_shader *sh = shProg->_LinkedShaders[i];
-           sh->UniformBlocks[stage_index].Binding = shaderStorageBlockBinding;
+           sh->BufferInterfaceBlocks[stage_index].Binding = shaderStorageBlockBinding;
         }
       }
    }
index 6affb4d84d5a96b31bdd71fba7bd87bdb75d0623..69e26cb6c261e74a5b81142114e0c48ae8fddcd0 100644 (file)
@@ -234,11 +234,11 @@ static void st_bind_ubos(struct st_context *st,
    if (!shader)
       return;
 
-   for (i = 0; i < shader->NumUniformBlocks; i++) {
+   for (i = 0; i < shader->NumBufferInterfaceBlocks; i++) {
       struct gl_uniform_buffer_binding *binding;
       struct st_buffer_object *st_obj;
 
-      binding = &st->ctx->UniformBufferBindings[shader->UniformBlocks[i].Binding];
+      binding = &st->ctx->UniformBufferBindings[shader->BufferInterfaceBlocks[i].Binding];
       st_obj = st_buffer_object(binding->BufferObject);
 
       cb.buffer = st_obj->buffer;
index cdd80f167d03ac1f964bc6416f533f68c9fdd7a2..06f510db536d6144677bf786ca8bee22d29977b7 100644 (file)
@@ -5388,10 +5388,10 @@ st_translate_program(
    }
 
    if (program->shader) {
-      unsigned num_ubos = program->shader->NumUniformBlocks;
+      unsigned num_ubos = program->shader->NumBufferInterfaceBlocks;
 
       for (i = 0; i < num_ubos; i++) {
-         unsigned size = program->shader->UniformBlocks[i].UniformBufferSize;
+         unsigned size = program->shader->BufferInterfaceBlocks[i].UniformBufferSize;
          unsigned num_const_vecs = (size + 15) / 16;
          unsigned first, last;
          assert(num_const_vecs > 0);