mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-01 23:12:35 +00:00
Fix TrackSharp
This commit is contained in:
parent
52650d2c55
commit
67dd111dcc
@ -244,16 +244,20 @@ SharpLocation TrackSharp(const IR::Inst* inst, const Shader::Info& info) {
|
|||||||
}
|
}
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
};
|
};
|
||||||
|
// We are not accounting for modifications to after the source.
|
||||||
const auto result = IR::BreadthFirstSearch(inst, pred);
|
const auto result = IR::BreadthFirstSearch(inst, pred);
|
||||||
ASSERT_MSG(result, "Unable to track sharp source");
|
ASSERT_MSG(result, "Unable to track sharp source");
|
||||||
inst = result.value();
|
inst = result.value();
|
||||||
if (inst->GetOpcode() == IR::Opcode::GetUserData) {
|
if (inst->GetOpcode() == IR::Opcode::GetUserData) {
|
||||||
return static_cast<u32>(inst->Arg(0).ScalarReg());
|
return static_cast<u32>(inst->Arg(0).ScalarReg());
|
||||||
} else {
|
} else if (inst->GetOpcode() == IR::Opcode::ReadConst) {
|
||||||
ASSERT_MSG(inst->GetOpcode() == IR::Opcode::ReadConst,
|
// Sharp is stored in the offset argument.
|
||||||
"Sharp load not from constant memory");
|
// The vale is not inmediate if ReadConst is inside of a loop
|
||||||
return inst->Flags<u32>();
|
// and the offset is different in each iteration. (we don't support this)
|
||||||
|
ASSERT(inst->Arg(1).IsImmediate());
|
||||||
|
return inst->Arg(1).U32();
|
||||||
}
|
}
|
||||||
|
UNREACHABLE_MSG("Sharp load not from constant memory or user data");
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 TryHandleInlineCbuf(IR::Inst& inst, Info& info, Descriptors& descriptors,
|
s32 TryHandleInlineCbuf(IR::Inst& inst, Info& info, Descriptors& descriptors,
|
||||||
|
Loading…
Reference in New Issue
Block a user