mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-24 21:06:55 +02:00
gpu: compile RDNA2 tessellation through native LS HS and TES stages
This commit is contained in:
@@ -228,6 +228,15 @@ void FoldInstruction(Block& block, Block::iterator instruction,
|
||||
const auto offset = Arg(inst, 1);
|
||||
const auto count = Arg(inst, 2);
|
||||
auto* source = value.TryInstruction();
|
||||
if (source != nullptr && source->GetOpcode() == ValueOpcode::ShiftLeftLogical32 &&
|
||||
IsImmediate(offset, Type::U32) && IsImmediate(count, Type::U32)) {
|
||||
const auto shift = Arg(*source, 1);
|
||||
if (IsImmediate(shift, Type::U32) && shift.U32() < 32u &&
|
||||
offset.U32() <= shift.U32() && count.U32() <= shift.U32() - offset.U32()) {
|
||||
Replace(inst, Value(0u));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (source != nullptr && source->GetOpcode() == ValueOpcode::GetBuiltin &&
|
||||
source->Arg(0) == Value(static_cast<uint32_t>(StageInputKind::PackedAncillary)) &&
|
||||
IsImmediate(offset, Type::U32) && IsImmediate(count, Type::U32) && count.U32() != 0u) {
|
||||
|
||||
Reference in New Issue
Block a user