From 8ada7510bde01c68676a0632874f394fd9fde86a Mon Sep 17 00:00:00 2001 From: Dean Galvin Date: Tue, 29 Sep 2026 13:05:49 +1300 Subject: [PATCH] feat(agc): accept the dispatch tunnel hint DISPATCH_INITIATOR bit 13 (TUNNEL_ENABLE) asks the SPI to launch the dispatch's waves ahead of other work. It is a scheduling priority hint with no effect on the results, so direct and indirect dispatches accept it like the other ignored modifier bits. --- core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp | 4 ++-- core/libs/prx/libSceAgcDriver/tests/Pm4.cpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp b/core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp index ff230342a..5e588755f 100644 --- a/core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp +++ b/core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp @@ -286,10 +286,10 @@ void Validate(std::span packet, std::uint32_t queue) { require((packet[8] & 3u) == 0 && packet[8] >= (opcode == 0x2c ? 16u : 20u), "invalid indirect draw stride"); require((packet[9] & ~0x20u) == (opcode == 0x2c ? 2u : 0u), "unsupported indirect draw initiator"); break; - case 0x15: size(5); if ((packet[4] & ~0x8020u) != 0x41u) throw std::runtime_error("dispatch modifiers 0x" + ToHex(packet[4]) + " are not implemented"); break; + case 0x15: size(5); if ((packet[4] & ~0xa020u) != 0x41u) throw std::runtime_error("dispatch modifiers 0x" + ToHex(packet[4]) + " are not implemented"); break; case 0x16: require(packet.size() == 3 || packet.size() == 4, "invalid indirect dispatch size"); - require((packet.back() & ~0x8020u) == 0x41u, "indirect dispatch modifiers are not implemented"); + require((packet.back() & ~0xa020u) == 0x41u, "indirect dispatch modifiers are not implemented"); break; case 0x42: size(2); require(packet[1] == 0, "unsupported PFP_SYNC_ME payload"); break; case 0x46: { diff --git a/core/libs/prx/libSceAgcDriver/tests/Pm4.cpp b/core/libs/prx/libSceAgcDriver/tests/Pm4.cpp index 34198c47b..44f842d20 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Pm4.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Pm4.cpp @@ -119,6 +119,9 @@ void testContextAndBases() { packet = makePacket(0x16, {low(arguments.data()), high(arguments.data()), 0x41}); AgcDriver::Pm4::Validate(packet, 0x20); check(AgcDriver::Pm4::ResolveDispatch(packet, state)[3] == 9, "absolute indirect dispatch arguments changed"); + AgcDriver::Pm4::Validate(makePacket(0x15, {1, 1, 1, 0x2041}), 0); + AgcDriver::Pm4::Validate(makePacket(0x16, {0, 0xa041}), 0); + expectFailure([&] { AgcDriver::Pm4::Validate(makePacket(0x15, {1, 1, 1, 0x4041}), 0); }, "dispatch modifiers"); execute(state, makePacket(0x13, {32})); execute(state, makePacket(0x26, {0x1000, 1})); execute(state, makePacket(0x2a, {1}));