mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
aco: remove special handling of load_helper_invocation
These should now behave the same as is_helper_invocation. Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9058>
This commit is contained in:
parent
2e6c9e54f1
commit
29b866fef6
3 changed files with 5 additions and 25 deletions
|
|
@ -43,7 +43,6 @@ enum mask_type : uint8_t {
|
|||
mask_type_exact = 1 << 1,
|
||||
mask_type_wqm = 1 << 2,
|
||||
mask_type_loop = 1 << 3, /* active lanes of a loop */
|
||||
mask_type_initial = 1 << 4, /* initially active lanes */
|
||||
};
|
||||
|
||||
struct wqm_ctx {
|
||||
|
|
@ -386,7 +385,7 @@ unsigned add_coupling_code(exec_ctx& ctx, Block* block,
|
|||
}
|
||||
|
||||
if (ctx.handle_wqm) {
|
||||
ctx.info[0].exec.emplace_back(Temp(0, bld.lm), mask_type_global | mask_type_exact | mask_type_initial);
|
||||
ctx.info[0].exec.emplace_back(Temp(0, bld.lm), mask_type_global | mask_type_exact);
|
||||
/* if this block only needs WQM, initialize already */
|
||||
if (ctx.info[0].block_needs == WQM)
|
||||
transition_to_WQM(ctx, bld, 0);
|
||||
|
|
@ -696,7 +695,7 @@ void process_instructions(exec_ctx& ctx, Block* block,
|
|||
state = Exact;
|
||||
}
|
||||
|
||||
if (instr->opcode == aco_opcode::p_is_helper || instr->opcode == aco_opcode::p_load_helper) {
|
||||
if (instr->opcode == aco_opcode::p_is_helper) {
|
||||
Definition dst = instr->definitions[0];
|
||||
assert(dst.size() == bld.lm.size());
|
||||
if (state == Exact) {
|
||||
|
|
@ -705,19 +704,6 @@ void process_instructions(exec_ctx& ctx, Block* block,
|
|||
instr->definitions[0] = dst;
|
||||
} else {
|
||||
std::pair<Temp, uint8_t>& exact_mask = ctx.info[block->index].exec[0];
|
||||
if (instr->opcode == aco_opcode::p_load_helper &&
|
||||
!(ctx.info[block->index].exec[0].second & mask_type_initial)) {
|
||||
/* find last initial exact mask */
|
||||
for (int i = block->index; i >= 0; i--) {
|
||||
if (ctx.program->blocks[i].kind & block_kind_top_level &&
|
||||
ctx.info[i].exec[0].second & mask_type_initial) {
|
||||
exact_mask = ctx.info[i].exec[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assert(instr->opcode == aco_opcode::p_is_helper || exact_mask.second & mask_type_initial);
|
||||
assert(exact_mask.second & mask_type_exact);
|
||||
|
||||
instr.reset(create_instruction<SOP2_instruction>(bld.w64or32(Builder::s_andn2), Format::SOP2, 2, 2));
|
||||
|
|
@ -729,7 +715,6 @@ void process_instructions(exec_ctx& ctx, Block* block,
|
|||
} else if (instr->opcode == aco_opcode::p_demote_to_helper) {
|
||||
/* turn demote into discard_if with only exact masks */
|
||||
assert((ctx.info[block->index].exec[0].second & (mask_type_exact | mask_type_global)) == (mask_type_exact | mask_type_global));
|
||||
ctx.info[block->index].exec[0].second &= ~mask_type_initial;
|
||||
|
||||
int num;
|
||||
Temp cond, exit_cond;
|
||||
|
|
|
|||
|
|
@ -8560,14 +8560,10 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr)
|
|||
emit_wqm(bld, wqm_tmp, dst);
|
||||
break;
|
||||
}
|
||||
case nir_intrinsic_load_helper_invocation: {
|
||||
Temp dst = get_ssa_temp(ctx, &instr->dest.ssa);
|
||||
bld.pseudo(aco_opcode::p_load_helper, Definition(dst));
|
||||
ctx->block->kind |= block_kind_needs_lowering;
|
||||
ctx->program->needs_exact = true;
|
||||
break;
|
||||
}
|
||||
case nir_intrinsic_load_helper_invocation:
|
||||
case nir_intrinsic_is_helper_invocation: {
|
||||
/* load_helper() after demote() get lowered to is_helper().
|
||||
* Otherwise, these two behave the same. */
|
||||
Temp dst = get_ssa_temp(ctx, &instr->dest.ssa);
|
||||
bld.pseudo(aco_opcode::p_is_helper, Definition(dst));
|
||||
ctx->block->kind |= block_kind_needs_lowering;
|
||||
|
|
|
|||
|
|
@ -281,7 +281,6 @@ opcode("p_end_linear_vgpr")
|
|||
|
||||
opcode("p_wqm")
|
||||
opcode("p_discard_if")
|
||||
opcode("p_load_helper")
|
||||
opcode("p_demote_to_helper")
|
||||
opcode("p_is_helper")
|
||||
opcode("p_exit_early_if")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue