diff options
author | Paul Berry <[email protected]> | 2011-08-02 14:34:17 -0700 |
---|---|---|
committer | Paul Berry <[email protected]> | 2011-08-15 17:23:01 -0700 |
commit | 67b5a3267d639c31d3ac4073be877ffb0f5637d3 (patch) | |
tree | dc5f17260302ad8e3678975bb67bbe78a8a52f83 /src/glsl/ir.h | |
parent | c548192cafdf7dfab4cf7e0a0734417ee16f1c94 (diff) |
glsl: Perform implicit type conversions on function call out parameters.
When an out parameter undergoes an implicit type conversion, we need
to store it in a temporary, and then after the call completes, convert
the resulting value. In other words, we convert code like the
following:
void f(out int x);
float value;
f(value);
Into IR that's equivalent to this:
void f(out int x);
float value;
int out_parameter_conversion;
f(out_parameter_conversion);
value = float(out_parameter_conversion);
This transformation needs to happen during ast-to-IR convertion (as
opposed to, say, a lowering pass), because it is invalid IR for formal
and actual parameters to have types that don't match.
Fixes piglit tests
spec/glsl-1.20/compiler/qualifiers/out-conversion-int-to-float.vert and
spec/glsl-1.20/execution/qualifiers/vs-out-conversion-*.shader_test,
and bug 39651.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39651
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/glsl/ir.h')
0 files changed, 0 insertions, 0 deletions