Mesa (master): glsl: Add shared variable type

Jordan Justen jljusten at kemper.freedesktop.org
Tue Nov 10 01:32:32 UTC 2015


Module: Mesa
Branch: master
Commit: 32746fc9b49db5eccdc228e12cbce4734f1020f9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=32746fc9b49db5eccdc228e12cbce4734f1020f9

Author: Jordan Justen <jordan.l.justen at intel.com>
Date:   Tue Jul 28 14:56:49 2015 -0700

glsl: Add shared variable type

Shared variables are stored in a common pool accessible by all threads
in a compute shader local work group.

These variables are similar to OpenCL's local/__local variables.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>

---

 src/glsl/ir.h                 |    1 +
 src/glsl/ir_print_visitor.cpp |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index e576db5..32a766e 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -325,6 +325,7 @@ enum ir_variable_mode {
    ir_var_auto = 0,             /**< Function local variables and globals. */
    ir_var_uniform,              /**< Variable declared as a uniform. */
    ir_var_shader_storage,       /**< Variable declared as an ssbo. */
+   ir_var_shader_shared,        /**< Variable declared as shared. */
    ir_var_shader_in,
    ir_var_shader_out,
    ir_var_function_in,
diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp
index 211ac76..42b03fd 100644
--- a/src/glsl/ir_print_visitor.cpp
+++ b/src/glsl/ir_print_visitor.cpp
@@ -174,7 +174,7 @@ void ir_print_visitor::visit(ir_variable *ir)
    const char *const patc = (ir->data.patch) ? "patch " : "";
    const char *const inv = (ir->data.invariant) ? "invariant " : "";
    const char *const mode[] = { "", "uniform ", "shader_storage ",
-                                "shader_in ", "shader_out ",
+                                "shader_shared ", "shader_in ", "shader_out ",
                                 "in ", "out ", "inout ",
 			        "const_in ", "sys ", "temporary " };
    STATIC_ASSERT(ARRAY_SIZE(mode) == ir_var_mode_count);




More information about the mesa-commit mailing list