aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2015-03-15 13:53:06 -0700
committerJordan Justen <[email protected]>2015-11-09 17:21:12 -0800
commit8b28b3553139c19efed6d54d0a21315867371864 (patch)
treec825b8c3e81f9f7d584d6f3a23fbf2c1b5c9ca8c /src/glsl/ast_to_hir.cpp
parenta4a46fe3fa566b2918f7323e7f0eede17f118f03 (diff)
glsl: Parse shared keyword for compute shader variables
v2: * Move shared parsing under storage qualifiers (tarceri) * Fail to compile if shared is used in non-compute shader (tarceri) * Use separate shared_storage bit for shared variables (tarceri) Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 5a22820c692..a8eaecc54c3 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -3089,6 +3089,12 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
"members");
}
+ if (qual->flags.q.shared_storage && state->stage != MESA_SHADER_COMPUTE) {
+ _mesa_glsl_error(loc, state,
+ "the shared storage qualifiers can only be used with "
+ "compute shaders");
+ }
+
if (qual->flags.q.row_major || qual->flags.q.column_major) {
validate_matrix_layout_for_type(state, loc, var->type, var);
}