summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/glsl_to_nir.cpp1
-rw-r--r--src/compiler/glsl/link_uniforms.cpp4
-rw-r--r--src/compiler/glsl/linker.cpp14
-rw-r--r--src/compiler/glsl/lower_ubo_reference.cpp2
4 files changed, 10 insertions, 11 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index 4e0a33a9e74..2620b417498 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -150,7 +150,6 @@ glsl_to_nir(const struct gl_shader_program *shader_prog,
if (shader_prog->Label)
shader->info->label = ralloc_strdup(shader, shader_prog->Label);
shader->info->num_textures = util_last_bit(sh->Program->SamplersUsed);
- shader->info->num_ubos = sh->NumUniformBlocks;
shader->info->num_ssbos = sh->NumShaderStorageBlocks;
shader->info->clip_distance_array_size = sh->Program->ClipDistanceArraySize;
shader->info->cull_distance_array_size = sh->Program->CullDistanceArraySize;
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index cd00837cca9..fd8331be497 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -901,7 +901,7 @@ link_update_uniform_buffer_variables(struct gl_linked_shader *shader,
var->data.mode == ir_var_shader_storage);
unsigned num_blocks = var->data.mode == ir_var_uniform ?
- shader->NumUniformBlocks : shader->NumShaderStorageBlocks;
+ shader->Program->info.num_ubos : shader->NumShaderStorageBlocks;
struct gl_uniform_block **blks = var->data.mode == ir_var_uniform ?
shader->UniformBlocks : shader->ShaderStorageBlocks;
@@ -1330,7 +1330,7 @@ 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++) {
+ for (unsigned i = 0; i < sh->Program->info.num_ubos; i++) {
sh->num_combined_uniform_components +=
sh->UniformBlocks[i]->UniformBufferSize / 4;
}
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 13fbb30b27b..332b799145c 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -1140,7 +1140,7 @@ interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog,
prog->_LinkedShaders[i]->NumShaderStorageBlocks;
} else {
max_num_buffer_blocks +=
- prog->_LinkedShaders[i]->NumUniformBlocks;
+ prog->_LinkedShaders[i]->Program->info.num_ubos;
}
}
}
@@ -1161,7 +1161,7 @@ interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog,
sh_num_blocks = prog->_LinkedShaders[i]->NumShaderStorageBlocks;
sh_blks = sh->ShaderStorageBlocks;
} else {
- sh_num_blocks = prog->_LinkedShaders[i]->NumUniformBlocks;
+ sh_num_blocks = prog->_LinkedShaders[i]->Program->info.num_ubos;
sh_blks = sh->UniformBlocks;
}
@@ -2278,7 +2278,7 @@ link_intrastage_shaders(void *mem_ctx,
for (unsigned i = 0; i < num_ubo_blocks; i++) {
linked->UniformBlocks[i] = &ubo_blocks[i];
}
- linked->NumUniformBlocks = num_ubo_blocks;
+ linked->Program->info.num_ubos = num_ubo_blocks;
/* Copy ssbo blocks to linked shader list */
linked->ShaderStorageBlocks =
@@ -3100,14 +3100,14 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
}
total_shader_storage_blocks += sh->NumShaderStorageBlocks;
- total_uniform_blocks += sh->NumUniformBlocks;
+ total_uniform_blocks += sh->Program->info.num_ubos;
const unsigned max_uniform_blocks =
ctx->Const.Program[i].MaxUniformBlocks;
- if (max_uniform_blocks < sh->NumUniformBlocks) {
+ if (max_uniform_blocks < sh->Program->info.num_ubos) {
linker_error(prog, "Too many %s uniform blocks (%d/%d)\n",
- _mesa_shader_stage_to_string(i), sh->NumUniformBlocks,
- max_uniform_blocks);
+ _mesa_shader_stage_to_string(i),
+ sh->Program->info.num_ubos, max_uniform_blocks);
}
const unsigned max_shader_storage_blocks =
diff --git a/src/compiler/glsl/lower_ubo_reference.cpp b/src/compiler/glsl/lower_ubo_reference.cpp
index eafa1dd7525..985ecea554e 100644
--- a/src/compiler/glsl/lower_ubo_reference.cpp
+++ b/src/compiler/glsl/lower_ubo_reference.cpp
@@ -292,7 +292,7 @@ lower_ubo_reference_visitor::setup_for_load_or_store(void *mem_ctx,
num_blocks = shader->NumShaderStorageBlocks;
blocks = shader->ShaderStorageBlocks;
} else {
- num_blocks = shader->NumUniformBlocks;
+ num_blocks = shader->Program->info.num_ubos;
blocks = shader->UniformBlocks;
}
this->uniform_block = NULL;