summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2011-01-20 14:12:16 -0800
committerChad Versace <[email protected]>2011-01-21 14:06:28 -0800
commit01a584d09350d2c726312e2c9e88c5dbc54bdb70 (patch)
tree65fd9930298934b9208be590692df26e487bdae1 /src/glsl/ast_to_hir.cpp
parentf633b993b0d11cbc2880707405cf38201a5df61d (diff)
glsl: Mark 'in' variables at global scope as read-only
Fixes Piglit tests: spec/glsl-1.30/compiler/storage-qualifiers/static-write-centroid-in-01.frag spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-01.frag spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-02.frag
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 7a171f3a2bb..dfb016cf7d8 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -1809,7 +1809,6 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
}
}
- /* FINISHME: Mark 'in' variables at global scope as read-only. */
if (qual->flags.q.constant || qual->flags.q.attribute
|| qual->flags.q.uniform
|| (qual->flags.q.varying && (state->target == fragment_shader)))
@@ -2206,6 +2205,8 @@ ast_declarator_list::hir(exec_list *instructions,
mode, var->name, extra);
}
} else if (var->mode == ir_var_in) {
+ var->read_only = true;
+
if (state->target == vertex_shader) {
bool error_emitted = false;