mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 13:56:59 +01:00
shader: reject rejoining early-exit routes
This commit is contained in:
@@ -1803,7 +1803,8 @@ bool RouteOneSharedArm(Graph& graph, uint32_t original_block_count, uint32_t out
|
|||||||
|
|
||||||
const auto continuation = graph.FindNearestCommonPostDominator(shared, body);
|
const auto continuation = graph.FindNearestCommonPostDominator(shared, body);
|
||||||
const auto* continuation_block = graph.FindBlock(continuation);
|
const auto* continuation_block = graph.FindBlock(continuation);
|
||||||
if (continuation_block == nullptr || continuation == other) {
|
if (continuation_block == nullptr || continuation == other ||
|
||||||
|
CanReachBefore(graph, other, continuation, UINT32_MAX)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
std::vector<uint32_t> outer_predecessors;
|
std::vector<uint32_t> outer_predecessors;
|
||||||
|
|||||||
@@ -7686,14 +7686,23 @@ void TestNewShaderRecompilerCfgExecSccSharedArm() {
|
|||||||
|
|
||||||
void TestNewShaderRecompilerCfgNestedTailEarlyExit() {
|
void TestNewShaderRecompilerCfgNestedTailEarlyExit() {
|
||||||
const uint32_t shader[] = {
|
const uint32_t shader[] = {
|
||||||
EncodeSopc(0x06, 0, 0), // outer condition
|
EncodeSopc(0x06, 0, 0), // preceding outer condition
|
||||||
|
EncodeSopp(0x04, 6), // preceding outer -> shared tail or inner
|
||||||
|
EncodeSopc(0x06, 1, 1), // preceding inner condition
|
||||||
|
EncodeSopp(0x04, 2), // preceding inner -> body or arm
|
||||||
|
EncodeSMovB32(2, 129), // preceding arm
|
||||||
|
EncodeSopp(0x02, 0), // preceding arm -> body
|
||||||
|
EncodeSMovB32(3, 129), // preceding body
|
||||||
|
EncodeSopp(0x02, 0), // preceding body -> shared tail
|
||||||
|
EncodeSMovB32(4, 129), // preceding shared tail
|
||||||
|
EncodeSopc(0x06, 5, 5), // outer condition
|
||||||
EncodeSopp(0x04, 4), // outer -> right arm or inner condition
|
EncodeSopp(0x04, 4), // outer -> right arm or inner condition
|
||||||
EncodeSopc(0x06, 1, 1), // inner early-exit condition
|
EncodeSopc(0x06, 6, 6), // inner early-exit condition
|
||||||
EncodeSopp(0x04, 4), // inner -> exit or left arm
|
EncodeSopp(0x04, 4), // inner -> exit or left arm
|
||||||
EncodeSMovB32(2, 129), // left arm
|
EncodeSMovB32(7, 129), // left arm
|
||||||
EncodeSopp(0x02, 1), // left arm -> common tail
|
EncodeSopp(0x02, 1), // left arm -> common tail
|
||||||
EncodeSMovB32(3, 129), // right arm
|
EncodeSMovB32(8, 129), // right arm
|
||||||
EncodeSMovB32(4, 129), // common tail
|
EncodeSMovB32(9, 129), // common tail
|
||||||
0xbf810000u,
|
0xbf810000u,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user