summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2011-07-11 16:44:13 -0700
committerPaul Berry <[email protected]>2011-07-18 10:48:27 -0700
commitddc1c96390b685bb95f7431e862c3a64fcefa085 (patch)
tree2f4ea93355172c65be347efde33a76d7aff0df73 /src/glsl/ir.cpp
parent9b3ec69cf4b079fbe16293d8fbe13016f0d74951 (diff)
glsl: Move type_contains_sampler() into glsl_type for later reuse.
The new location, as a member function of glsl_type, is more consistent with queries like is_sampler(), is_boolean(), is_float(), etc. Placing the function inside glsl_type also makes it available to any code that uses glsl_types.
Diffstat (limited to 'src/glsl/ir.cpp')
-rw-r--r--src/glsl/ir.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 95689dc10b0..827fe8e17a7 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -1095,21 +1095,6 @@ ir_dereference_record::ir_dereference_record(ir_variable *var,
? this->record->type->field_type(field) : glsl_type::error_type;
}
-bool type_contains_sampler(const glsl_type *type)
-{
- if (type->is_array()) {
- return type_contains_sampler(type->fields.array);
- } else if (type->is_record()) {
- for (unsigned int i = 0; i < type->length; i++) {
- if (type_contains_sampler(type->fields.structure[i].type))
- return true;
- }
- return false;
- } else {
- return type->is_sampler();
- }
-}
-
bool
ir_dereference::is_lvalue()
{
@@ -1129,7 +1114,7 @@ ir_dereference::is_lvalue()
* as out or inout function parameters, nor can they be
* assigned into."
*/
- if (type_contains_sampler(this->type))
+ if (this->type->contains_sampler())
return false;
return true;