diff options
author | Samuel Iglesias Gonsalvez <[email protected]> | 2015-09-11 12:29:37 +0200 |
---|---|---|
committer | Samuel Iglesias Gonsalvez <[email protected]> | 2015-09-29 10:03:47 +0200 |
commit | 6668eb5a451c43ac78a784711cf239fdf7ca75ef (patch) | |
tree | 7aa0ccde2859f251a99ea65d12554cd36ab6eaa0 /src/glsl | |
parent | 38004eb17ce9663a4343bae4e783e97e73596e9c (diff) |
mesa: rename gl_shader_program's NumUniformBlocks to NumBufferInterfaceBlocks
Because it counts shader storage blocks too.
v2:
- Use NumBufferInterfaceBlocks instead (Jordan).
Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/link_uniform_initializers.cpp | 2 | ||||
-rw-r--r-- | src/glsl/link_uniforms.cpp | 4 | ||||
-rw-r--r-- | src/glsl/linker.cpp | 10 | ||||
-rw-r--r-- | src/glsl/standalone_scaffolding.cpp | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/glsl/link_uniform_initializers.cpp b/src/glsl/link_uniform_initializers.cpp index 05000fc39ef..34830829b4a 100644 --- a/src/glsl/link_uniform_initializers.cpp +++ b/src/glsl/link_uniform_initializers.cpp @@ -48,7 +48,7 @@ static unsigned get_uniform_block_index(const gl_shader_program *shProg, const char *uniformBlockName) { - for (unsigned i = 0; i < shProg->NumUniformBlocks; i++) { + for (unsigned i = 0; i < shProg->NumBufferInterfaceBlocks; i++) { if (!strcmp(shProg->UniformBlocks[i].Name, uniformBlockName)) return i; } diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 94d7287221a..47d49c84e65 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp @@ -500,7 +500,7 @@ public: if (var->is_interface_instance() && var->type->is_array()) { unsigned l = strlen(var->get_interface_type()->name); - for (unsigned i = 0; i < prog->NumUniformBlocks; i++) { + for (unsigned i = 0; i < prog->NumBufferInterfaceBlocks; i++) { if (strncmp(var->get_interface_type()->name, prog->UniformBlocks[i].Name, l) == 0 @@ -510,7 +510,7 @@ public: } } } else { - for (unsigned i = 0; i < prog->NumUniformBlocks; i++) { + for (unsigned i = 0; i < prog->NumBufferInterfaceBlocks; i++) { if (strcmp(var->get_interface_type()->name, prog->UniformBlocks[i].Name) == 0) { ubo_block_index = i; diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 75396fb3936..9bacd22b9d4 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -1187,7 +1187,7 @@ interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog) for (unsigned int j = 0; j < sh->NumUniformBlocks; j++) { int index = link_cross_validate_uniform_block(prog, &prog->UniformBlocks, - &prog->NumUniformBlocks, + &prog->NumBufferInterfaceBlocks, &sh->UniformBlocks[j]); if (index == -1) { @@ -2802,7 +2802,7 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog) unsigned shader_blocks[MESA_SHADER_STAGES] = {0}; unsigned total_shader_storage_blocks = 0; - for (unsigned i = 0; i < prog->NumUniformBlocks; i++) { + 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) { @@ -2836,7 +2836,7 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog) if (total_uniform_blocks > ctx->Const.MaxCombinedUniformBlocks) { linker_error(prog, "Too many combined uniform blocks (%d/%d)\n", - prog->NumUniformBlocks, + prog->NumBufferInterfaceBlocks, ctx->Const.MaxCombinedUniformBlocks); } else { for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { @@ -2939,7 +2939,7 @@ check_image_resources(struct gl_context *ctx, struct gl_shader_program *prog) total_image_units += sh->NumImages; - for (unsigned j = 0; j < prog->NumUniformBlocks; j++) { + for (unsigned j = 0; j < prog->NumBufferInterfaceBlocks; j++) { int stage_index = prog->UniformBlockStageIndex[i][j]; if (stage_index != -1 && sh->UniformBlocks[stage_index].IsShaderStorage) total_shader_storage_blocks++; @@ -3418,7 +3418,7 @@ build_program_resource_list(struct gl_shader_program *shProg) } /* Add program uniform blocks and shader storage blocks. */ - for (unsigned i = 0; i < shProg->NumUniformBlocks; i++) { + for (unsigned i = 0; i < shProg->NumBufferInterfaceBlocks; i++) { bool is_shader_storage = shProg->UniformBlocks[i].IsShaderStorage; GLenum type = is_shader_storage ? GL_SHADER_STORAGE_BLOCK : GL_UNIFORM_BLOCK; if (!add_program_resource(shProg, type, diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp index e52869f288e..ea9334fd7b7 100644 --- a/src/glsl/standalone_scaffolding.cpp +++ b/src/glsl/standalone_scaffolding.cpp @@ -101,7 +101,7 @@ _mesa_clear_shader_program_data(struct gl_shader_program *shProg) ralloc_free(shProg->UniformBlocks); shProg->UniformBlocks = NULL; - shProg->NumUniformBlocks = 0; + shProg->NumBufferInterfaceBlocks = 0; for (i = 0; i < MESA_SHADER_STAGES; i++) { ralloc_free(shProg->UniformBlockStageIndex[i]); shProg->UniformBlockStageIndex[i] = NULL; |