summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2013-11-22 15:17:05 -0800
committerFrancisco Jerez <[email protected]>2014-02-12 18:44:05 +0100
commit2158749e522cb62d961d64d7b887cd730f915faa (patch)
treed93a908a80f2bcdfc55d525906965593b439d270 /src/glsl
parent6b28528d1c206a9b0c962a1e35ed177db7818cfa (diff)
glsl/ast: Forbid declaration of image variables in structures and uniform blocks.
Aggregating images inside uniform blocks is explicitly disallowed by the standard, aggregating them inside structures is not (as of GL 4.4), but there is a similar problem as with atomic counters: image uniform declarations require either a "writeonly" memory qualifier or an explicit format qualifier, which are explicitly forbidden in structure member declarations. In the resolution of Khronos bug #10903 the same wording applied to atomic counters was decided to mean that they're not allowed inside structures -- Rejecting image member declarations within structures seems the most reasonable option for now. Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ast_to_hir.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index f552b47d343..ab4cef20401 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -4777,6 +4777,16 @@ ast_process_structure_or_interface_block(exec_list *instructions,
"uniform block");
}
+ if (field_type->contains_image()) {
+ /* FINISHME: Same problem as with atomic counters.
+ * FINISHME: Request clarification from Khronos and add
+ * FINISHME: spec quotation here.
+ */
+ YYLTYPE loc = decl_list->get_location();
+ _mesa_glsl_error(&loc, state,
+ "image in structure or uniform block");
+ }
+
const struct ast_type_qualifier *const qual =
& decl_list->type->qualifier;
if (qual->flags.q.std140 ||