summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.cpp
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2013-11-25 19:38:37 -0800
committerFrancisco Jerez <[email protected]>2014-02-12 18:44:05 +0100
commit7af167d2becc3ff7274350d8d29424ebf89aa6a9 (patch)
tree2d347b4a31a3f082fa8cb84c31337b0e142f5e4a /src/glsl/ir.cpp
parent2158749e522cb62d961d64d7b887cd730f915faa (diff)
glsl/ast: Generalize some sampler variable restrictions to all opaque types.
No opaque types may be statically initialized in the shader, all opaque variables must be declared uniform or be part of an "in" function parameter declaration, no opaque types may be used as the return type of a function. v2: Add explicit check for opaque types in interface blocks. Check for opaque types in ir_dereference::is_lvalue(). Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/ir.cpp')
-rw-r--r--src/glsl/ir.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 94e44ec6467..338f61b0daa 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -1311,13 +1311,13 @@ ir_dereference::is_lvalue() const
if ((var == NULL) || var->data.read_only)
return false;
- /* From page 17 (page 23 of the PDF) of the GLSL 1.20 spec:
+ /* From section 4.1.7 of the GLSL 4.40 spec:
*
- * "Samplers cannot be treated as l-values; hence cannot be used
- * as out or inout function parameters, nor can they be
- * assigned into."
+ * "Opaque variables cannot be treated as l-values; hence cannot
+ * be used as out or inout function parameters, nor can they be
+ * assigned into."
*/
- if (this->type->contains_sampler())
+ if (this->type->contains_opaque())
return false;
return true;