From: Iago Toral Quiroga Date: Mon, 23 Mar 2015 10:19:12 +0000 (+0100) Subject: glsl: Identify active uniform blocks that are buffer blocks as such. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=df89ed1591c9d1c55e79fe8effb976c21b172a7d;p=mesa.git glsl: Identify active uniform blocks that are buffer blocks as such. Reviewed-by: Jordan Justen --- diff --git a/src/glsl/link_uniform_block_active_visitor.cpp b/src/glsl/link_uniform_block_active_visitor.cpp index ddfd2b23748..510294783a0 100644 --- a/src/glsl/link_uniform_block_active_visitor.cpp +++ b/src/glsl/link_uniform_block_active_visitor.cpp @@ -44,6 +44,7 @@ process_block(void *mem_ctx, struct hash_table *ht, ir_variable *var) b->type = block_type; b->has_instance_name = var->is_interface_instance(); + b->is_shader_storage = var->data.mode == ir_var_shader_storage; if (var->data.explicit_binding) { b->has_binding = true; diff --git a/src/glsl/link_uniform_block_active_visitor.h b/src/glsl/link_uniform_block_active_visitor.h index e5ea501553c..b663a884db4 100644 --- a/src/glsl/link_uniform_block_active_visitor.h +++ b/src/glsl/link_uniform_block_active_visitor.h @@ -38,6 +38,7 @@ struct link_uniform_block_active { bool has_instance_name; bool has_binding; + bool is_shader_storage; }; class link_uniform_block_active_visitor : public ir_hierarchical_visitor { diff --git a/src/glsl/link_uniform_blocks.cpp b/src/glsl/link_uniform_blocks.cpp index 898544bea82..4df39e200d5 100644 --- a/src/glsl/link_uniform_blocks.cpp +++ b/src/glsl/link_uniform_blocks.cpp @@ -293,6 +293,8 @@ link_uniform_blocks(void *mem_ctx, blocks[i].NumUniforms = (unsigned)(ptrdiff_t)(&variables[parcel.index] - blocks[i].Uniforms); + blocks[i].IsShaderStorage = b->is_shader_storage; + i++; } } else { @@ -311,6 +313,8 @@ link_uniform_blocks(void *mem_ctx, blocks[i].NumUniforms = (unsigned)(ptrdiff_t)(&variables[parcel.index] - blocks[i].Uniforms); + blocks[i].IsShaderStorage = b->is_shader_storage; + i++; } } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 9ec342bea48..86508c36f6a 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2564,6 +2564,11 @@ struct gl_uniform_block */ GLuint UniformBufferSize; + /** + * Is this actually an interface block for a shader storage buffer? + */ + bool IsShaderStorage; + /** * Layout specified in the shader *