Mesa (7.9): glsl: Mark 'in' variables at global scope as read-only

Ian Romanick idr at kemper.freedesktop.org
Sat Feb 5 00:14:06 UTC 2011


Module: Mesa
Branch: 7.9
Commit: 13711c8a5a9f755df935eada90ff8285487239d5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=13711c8a5a9f755df935eada90ff8285487239d5

Author: Chad Versace <chad.versace at intel.com>
Date:   Thu Jan 20 14:12:16 2011 -0800

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

(cherry picked from commit 01a584d09350d2c726312e2c9e88c5dbc54bdb70)

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/glsl/ast_to_hir.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index eca6504..d9f4ddb 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -1651,7 +1651,6 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
       }
    }
 
-   /* FINISHME: Mark 'in' variables at global scope as read-only. */
    if (qual->constant || qual->attribute || qual->uniform
        || (qual->varying && (state->target == fragment_shader)))
       var->read_only = 1;
@@ -1940,6 +1939,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;
 




More information about the mesa-commit mailing list