diff options
author | Kenneth Graunke <[email protected]> | 2010-09-05 01:48:11 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2010-09-07 17:30:38 -0700 |
commit | f412fac5b46eb274cbed8e62234d5dbfd859f1fe (patch) | |
tree | 89bbe21c6ba90bdfc59e850ebda738e329fc1fff /src/glsl/ir.cpp | |
parent | c98deb18d5836f75cf62562f9304e4d90e0ea920 (diff) |
glsl: Move is_builtin flag back to ir_function_signature.
This effectively reverts b6f15869b324ae64a00d0fe46fa3c8c62c1edb6c.
In desktop GLSL, defining a function with the same name as a built-in
hides that built-in function completely, so there would never be
built-in and user function signatures in the same ir_function.
However, in GLSL ES, overloading built-ins is allowed, and does not
hide the built-in signatures - so we're back to needing this.
Diffstat (limited to 'src/glsl/ir.cpp')
-rw-r--r-- | src/glsl/ir.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index 6d727253740..9ac24858958 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -1073,6 +1073,7 @@ ir_function_signature::ir_function_signature(const glsl_type *return_type) : return_type(return_type), is_defined(false), _function(NULL) { this->ir_type = ir_type_function_signature; + this->is_builtin = false; } @@ -1124,7 +1125,18 @@ ir_function::ir_function(const char *name) { this->ir_type = ir_type_function; this->name = talloc_strdup(this, name); - this->is_builtin = false; +} + + +bool +ir_function::has_builtin_signature() +{ + foreach_list(n, &this->signatures) { + ir_function_signature *const sig = (ir_function_signature *) n; + if (sig->is_builtin) + return true; + } + return false; } |