diff options
author | Kenneth Graunke <[email protected]> | 2012-10-24 13:17:24 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2012-10-25 14:53:39 -0700 |
commit | b45a68eebf3cf7227fc70082cb1e796041fc81ab (patch) | |
tree | fcc6f0307067e885ab00b854ab29469578590b32 /src/gallium/drivers/r300 | |
parent | 03ea156f1b3e57ef223c0340afb49e513fa0b407 (diff) |
glsl: Allow ir_if in the linker's move_non_declarations function.
Global initializers using the ?: operator with at least one non-constant
operand generate ir_if statements. For example,
float foo = some_boolean ? 0.0 : 1.0;
becomes:
(declare (temporary) float conditional_tmp)
(if (var_ref some_boolean)
((assign (x) (var_ref conditional_tmp) (constant float (0.0))))
((assign (x) (var_ref conditional_tmp) (constant float (1.0)))))
This pattern is necessary because the second or third arguments could be
function calls, which create statements (not expressions).
The linker moves these global initializers into the main() function.
However, it incorrectly had an assertion that global initializer
statements were only assignments, calls, or temporary variable
declarations. As demonstrated above, they can be if statements too.
Other than the assertion, everything works fine. So remove it.
Fixes new Piglit test condition-08.vert, as well as an upcoming
game that will be released on Steam.
NOTE: This is a candidate for stable release branches.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r300')
0 files changed, 0 insertions, 0 deletions