mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-02 19:07:34 +00:00
add guards per subgroups support and remove forced turnip enabled on GS
This commit is contained in:
@@ -36,15 +36,14 @@ void RewriteAtomic(IR::Block& block, IR::Inst& inst) {
|
||||
|
||||
const IR::U32 amount{inst.Arg(2)};
|
||||
const IR::U32 primitive_id{ir.GetAttributeU32(IR::Attribute::PrimitiveId)};
|
||||
const IR::U32 new_index{ir.IMul(primitive_id, amount)};
|
||||
const IR::U32 new_atomic_value{ir.IAdd(new_index, amount)};
|
||||
const IR::U1 reserves_slot{ir.INotEqual(amount, ir.Imm32(0u))};
|
||||
const IR::U32 slot_end{ir.IAdd(primitive_id, ir.Imm32(1u))};
|
||||
const IR::U32 high_water{IR::U32{ir.Select(reserves_slot, slot_end, ir.Imm32(0u))}};
|
||||
|
||||
const IR::Value umax_result{&*block.PrependNewInst(
|
||||
insert_point, IR::Opcode::StorageAtomicUMax32,
|
||||
{inst.Arg(0), inst.Arg(1), new_atomic_value})};
|
||||
static_cast<void>(umax_result);
|
||||
block.PrependNewInst(insert_point, IR::Opcode::StorageAtomicUMax32,
|
||||
{inst.Arg(0), inst.Arg(1), high_water});
|
||||
|
||||
inst.ReplaceUsesWith(new_index);
|
||||
inst.ReplaceUsesWith(primitive_id);
|
||||
}
|
||||
|
||||
} // Anonymous namespace
|
||||
@@ -58,6 +57,9 @@ void CompactionFallbackPass(IR::Program& program, const HostTranslateInfo& host_
|
||||
if (inst.GetOpcode() != IR::Opcode::StorageAtomicIAdd32) {
|
||||
continue;
|
||||
}
|
||||
if (!inst.HasUses()) {
|
||||
continue;
|
||||
}
|
||||
if (!DependsOnSubgroupBallot(inst.Arg(2), 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user