uint8_t needs;
bool has_divergent_break;
bool has_divergent_continue;
- bool has_discard;
+ bool has_discard; /* has a discard or demote */
loop_info(Block* b, uint16_t num, uint8_t needs, bool breaks, bool cont, bool discard) :
loop_header(b), num_exec_masks(num), needs(needs), has_divergent_break(breaks),
has_divergent_continue(cont), has_discard(discard) {}
ever_again_needs |= exec_ctx.info[i].block_needs & ~Exact_Branch;
if (block.kind & block_kind_discard ||
- block.kind & block_kind_uses_discard_if)
+ block.kind & block_kind_uses_discard_if ||
+ block.kind & block_kind_uses_demote)
ever_again_needs |= Exact;
/* don't propagate WQM preservation further than the next top_level block */
(ctx.info[block->index].block_needs & state) !=
(ctx.info[block->index].block_needs & (WQM | Exact))) ||
block->kind & block_kind_uses_discard_if ||
+ block->kind & block_kind_uses_demote ||
block->kind & block_kind_needs_lowering;
if (!process) {
std::vector<aco_ptr<Instruction>>::iterator it = std::next(block->instructions.begin(), idx);
needs |= ctx.info[i].block_needs;
if (loop_block.kind & block_kind_uses_discard_if ||
- loop_block.kind & block_kind_discard)
+ loop_block.kind & block_kind_discard ||
+ loop_block.kind & block_kind_uses_demote)
has_discard = true;
if (loop_block.loop_nest_depth != loop_nest_depth)
continue;
}
case nir_intrinsic_demote:
bld.pseudo(aco_opcode::p_demote_to_helper);
- ctx->block->kind |= block_kind_needs_lowering;
+ ctx->block->kind |= block_kind_uses_demote;
ctx->program->needs_exact = true;
break;
case nir_intrinsic_demote_if: {
as_divergent_bool(ctx, get_ssa_temp(ctx, instr->src[0].ssa), false),
Operand(exec, s2));
bld.pseudo(aco_opcode::p_demote_to_helper, cond);
- ctx->block->kind |= block_kind_needs_lowering;
+ ctx->block->kind |= block_kind_uses_demote;
ctx->program->needs_exact = true;
break;
}