diff options
author | Kenneth Graunke <[email protected]> | 2011-11-11 00:43:06 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2011-11-14 17:18:12 -0800 |
commit | f1a677cefbe91a5c1a72dbeda94d2f13a9369e54 (patch) | |
tree | e30489d625296580d9664d8061d805e38bfa5473 /src/glsl/opt_dead_code.cpp | |
parent | cdc94082664c329e6c55cf6053893360946275bf (diff) |
glsl: Always search for an exact function signature match.
Previously, we would fail to compile the following shader due to a bug
in lazy built-in importing:
#version 130
void main() {
float f = abs(5.0);
int i = abs(5);
}
The first call, abs(5.0), would fail to find a local signature, look
through the built-ins, and import "float abs(float)".
The second call, abs(5), would find the newly imported float signature
in the local shader, and settle for that. Unfortunately, it failed to
search the built-ins for the correct/exact signature, "int abs(int)".
Thus, abs(5) ended up being a float, causing a bizarre type error when
we tried to assign it to an int.
Fixes piglit test builtin-overload-matching.frag.
This is /not/ a candidate for stable branches, as it should only be
possible to trigger this bug using GLSL 1.30's built-in functions that
take integer arguments. Plus, the changes are fairly invasive.
Signed-off-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/opt_dead_code.cpp')
0 files changed, 0 insertions, 0 deletions