[Mesa-dev] [PATCH 05/74] glsl: Identify active uniform blocks that are buffer blocks as such.
Iago Toral Quiroga
itoral at igalia.com
Thu May 14 07:06:08 PDT 2015
---
src/glsl/link_uniform_block_active_visitor.cpp | 1 +
src/glsl/link_uniform_block_active_visitor.h | 1 +
src/glsl/link_uniform_blocks.cpp | 4 ++++
src/mesa/main/mtypes.h | 5 +++++
4 files changed, 11 insertions(+)
diff --git a/src/glsl/link_uniform_block_active_visitor.cpp b/src/glsl/link_uniform_block_active_visitor.cpp
index 292cde3..9f3b0d6 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_buffer = var->data.mode == ir_var_buffer;
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 e5ea501..311c5d5 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_buffer;
};
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 898544b..a39e1a1 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].IsBuffer = b->is_buffer;
+
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].IsBuffer = b->is_buffer;
+
i++;
}
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 631e01b..c4fa05d 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2577,6 +2577,11 @@ struct gl_uniform_block
GLuint UniformBufferSize;
/**
+ * Is this actually an interface block for a shader storage buffer?
+ */
+ bool IsBuffer;
+
+ /**
* Layout specified in the shader
*
* This isn't accessible through the API, but it is used while
--
1.9.1
More information about the mesa-dev
mailing list