summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2013-09-20 14:58:03 -0700
committerFrancisco Jerez <[email protected]>2013-10-29 12:40:55 -0700
commitcc744a0947e619a4350551f5e9d5e380ac8d9e23 (patch)
treececfc057f2e902860d770935396a1352f091bc43 /src/glsl/ast_to_hir.cpp
parent26db3b933f7fbc81d6c2bead2a8b0479a3691424 (diff)
glsl: Add type predicate to check whether a type contains any opaque types.
And use it to forbid comparisons of opaque operands. According to the GL 4.2 specification: > Except for array indexing, structure member selection, and > parentheses, opaque variables are not allowed to be operands in > expressions. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index fa0d8c94ade..71e57ec8cae 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -1238,6 +1238,10 @@ ast_expression::hir(exec_list *instructions,
!state->check_version(120, 300, &loc,
"array comparisons forbidden")) {
error_emitted = true;
+ } else if ((op[0]->type->contains_opaque() ||
+ op[1]->type->contains_opaque())) {
+ _mesa_glsl_error(&loc, state, "opaque type comparisons forbidden");
+ error_emitted = true;
}
if (error_emitted) {