• Kenneth Graunke's avatar
    glsl: Allow ir_if in the linker's move_non_declarations function. · 895a5873
    Kenneth Graunke authored
    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's avatarKenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
    (cherry picked from commit b45a68ee)
    895a5873
Name
Last commit
Last update
bin Loading commit data...
configs Loading commit data...
docs Loading commit data...
doxygen Loading commit data...
include Loading commit data...
m4 Loading commit data...
scons Loading commit data...
src Loading commit data...
.dir-locals.el Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
Android.common.mk Loading commit data...
Android.mk Loading commit data...
Makefile.am Loading commit data...
SConstruct Loading commit data...
acinclude.m4 Loading commit data...
autogen.sh Loading commit data...
common.py Loading commit data...
configure.ac Loading commit data...