mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 05:20:09 +01:00
ir_to_mesa: Add support for conditional discards.
NOTE: This is a candidate for the 7.9 branch. Signed-off-by: Marek Olšák <maraeo@gmail.com> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
2ca9256911
commit
ead2ea89f4
1 changed files with 7 additions and 2 deletions
|
|
@ -2166,9 +2166,14 @@ ir_to_mesa_visitor::visit(ir_discard *ir)
|
|||
{
|
||||
struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog;
|
||||
|
||||
assert(ir->condition == NULL); /* FINISHME */
|
||||
if (ir->condition) {
|
||||
ir->condition->accept(this);
|
||||
this->result.negate = ~this->result.negate;
|
||||
ir_to_mesa_emit_op1(ir, OPCODE_KIL, ir_to_mesa_undef_dst, this->result);
|
||||
} else {
|
||||
ir_to_mesa_emit_op0(ir, OPCODE_KIL_NV);
|
||||
}
|
||||
|
||||
ir_to_mesa_emit_op0(ir, OPCODE_KIL_NV);
|
||||
fp->UsesKill = GL_TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue