summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2015-10-01 09:08:20 +0200
committerIago Toral Quiroga <[email protected]>2015-10-14 08:11:13 +0200
commit27dccf097d053b085c498a7bcab47197a5e83525 (patch)
tree76d76a360c20638612405e323bc6d34149a2fd2a /src/mesa
parent9de651b261286f15ae000e4a698587b805b95d2b (diff)
mesa: Rename {Num}UniformBlocks to {Num}BufferInterfaceBlocks
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 <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c10
-rw-r--r--src/mesa/main/mtypes.h6
-rw-r--r--src/mesa/main/shader_query.cpp4
-rw-r--r--src/mesa/main/shaderapi.c4
-rw-r--r--src/mesa/main/shaderobj.c4
-rw-r--r--src/mesa/main/uniforms.c12
-rw-r--r--src/mesa/state_tracker/st_atom_constbuf.c4
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp4
9 files changed, 26 insertions, 26 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 0f743fb43c1..b41e842005a 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -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;
}
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index d73f657edc7..3c019771603 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -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;
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 62eb5927637..f62ad3416ea 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -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
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index 324e1a68fa4..50b44fa9e16 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -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 */
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 9dd1054c8ee..6a2f60db77e 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -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;
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 4e85fda24b4..ffc71931fec 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -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]);
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 04cc81f9809..bc235380d97 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -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;
}
}
}
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c
index 6affb4d84d5..69e26cb6c26 100644
--- a/src/mesa/state_tracker/st_atom_constbuf.c
+++ b/src/mesa/state_tracker/st_atom_constbuf.c
@@ -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;
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index cdd80f167d0..06f510db536 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -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);