glsl: Add a lowering pass to move discards out of if-statements.
This should allow lower_if_to_cond_assign to work in the presence of discards, fixing bug #31690 and likely #31983. NOTE: This is a candidate for the 7.9 branch.
This commit is contained in:
@@ -2858,8 +2858,10 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
|
||||
progress = lower_quadop_vector(ir, true) || progress;
|
||||
|
||||
if (options->EmitNoIfs)
|
||||
if (options->EmitNoIfs) {
|
||||
progress = lower_discard(ir) || progress;
|
||||
progress = do_if_to_cond_assign(ir) || progress;
|
||||
}
|
||||
|
||||
if (options->EmitNoNoise)
|
||||
progress = lower_noise(ir) || progress;
|
||||
|
Reference in New Issue
Block a user