Set variables with the sampler base type to read only.
authorEric Anholt <eric@anholt.net>
Fri, 26 Mar 2010 23:37:53 +0000 (16:37 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Sat, 27 Mar 2010 00:51:41 +0000 (17:51 -0700)
Fixes increment3.frag.

ir.cpp

diff --git a/ir.cpp b/ir.cpp
index 4c1f307e8afc5908cc77d9b3b5c45e39742074b7..90df67bbf1dcd8388d0186661b2ec790bd0bc0dd 100644 (file)
--- a/ir.cpp
+++ b/ir.cpp
@@ -240,6 +240,9 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name)
 {
    this->type = type;
    this->name = name;
+
+   if (type && type->base_type == GLSL_TYPE_SAMPLER)
+      this->read_only = true;
 }