diff --git a/core/libs/prx/libSceAgc/DcbState/src/ContextState.cpp b/core/libs/prx/libSceAgc/DcbState/src/ContextState.cpp index c0bff226ea99..f69c6f6f5eec 100644 --- a/core/libs/prx/libSceAgc/DcbState/src/ContextState.cpp +++ b/core/libs/prx/libSceAgc/DcbState/src/ContextState.cpp @@ -9,7 +9,13 @@ extern "C" { uint32_t* APS5_VABI sceAgcDcbContextStateOp(CommandBuffer* buf, uint32_t operation) { - return sceAgcDcbContextStateOp_0100(buf, operation); + if (operation != 1) { + return sceAgcDcbContextStateOp_0100(buf, operation); + } + Agc::Command::Reserve(buf, 5, __func__); + auto* first = Agc::Command::Emit(buf, 0x28u, {0u, 0x80018001u}, __func__); + Agc::Command::Emit(buf, 0x12u, {operation}, __func__); + return first; } uint64_t APS5_VABI sceAgcDcbContextStateOpGetSize(uint32_t operation) { diff --git a/core/libs/prx/libSceAgc/tests/ContextStateSize.cpp b/core/libs/prx/libSceAgc/tests/ContextStateSize.cpp index 1e40ae3b6694..db6bceced81e 100644 --- a/core/libs/prx/libSceAgc/tests/ContextStateSize.cpp +++ b/core/libs/prx/libSceAgc/tests/ContextStateSize.cpp @@ -3,6 +3,7 @@ #include "prx/libc/include/general/VabiMacros.hpp" #include "prx/libc/include/Shutdown.hpp" +#include #include #include #include @@ -35,6 +36,9 @@ void testSizes() { check(sceAgcDcbContextStateOp_0100(&buffer, operation) == words.data(), "context state op did not start at the cursor"); const auto written = static_cast(buffer.cursor_up - words.data()) * sizeof(std::uint32_t); check(written == sizes[operation], "context state size differs from the written packets"); + if (operation == 1) { + continue; + } std::array unversionedWords{}; CommandBuffer unversionedBuffer{unversionedWords.data(), unversionedWords.data() + unversionedWords.size(), @@ -47,6 +51,22 @@ void testSizes() { } } +void testConsolePush() { + std::array words{}; + words.fill(0xdeadbeefu); + CommandBuffer buffer{words.data(), words.data() + words.size(), words.data(), words.data() + words.size(), nullptr, nullptr, 0}; + const std::array expected{0xc0012800u, 0, 0x80018001u, 0xc0001200u, 1}; + check(sceAgcDcbContextStateOp(&buffer, 1) == words.data(), "console context push did not start at the cursor"); + check(std::equal(expected.begin(), expected.end(), words.begin()), "console context push packet mismatch"); + check(buffer.cursor_up == words.data() + expected.size() && words[expected.size()] == 0xdeadbeefu, "console context push cursor advance mismatch"); + check(sceAgcDcbContextStateOpGetSize(1) >= expected.size() * sizeof(std::uint32_t), "console context push is larger than its reported size"); + std::array small{}; + CommandBuffer full{small.data(), small.data() + small.size(), small.data(), small.data() + small.size(), nullptr, nullptr, 0}; + expectFailure([&] { sceAgcDcbContextStateOp(&full, 1); }); + check(full.cursor_up == small.data(), "a refused console context push advanced the cursor"); + expectFailure([] { sceAgcDcbContextStateOp(nullptr, 1); }); +} + void testInvalidOperations() { for (const std::uint32_t operation : {4u, 15u, 16u, 0xffu, 0x100u, 0x103u, 0xffffffffu}) { check(sceAgcDcbContextStateOpGetSize(operation) == 0, "an invalid context state operation did not return size 0"); @@ -61,6 +81,7 @@ void testInvalidOperations() { int main() { try { testSizes(); + testConsolePush(); testInvalidOperations(); LibcRunShutdown_nid_postfix(); std::puts("AGC context state size tests passed"); diff --git a/core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp b/core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp index 06333599db48..ae97049c70eb 100644 --- a/core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp +++ b/core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp @@ -313,6 +313,7 @@ std::string_view UnsupportedReason(std::uint32_t header) { } constexpr std::uint32_t ConditionCachePolicy = 3u << 25u; +constexpr std::uint32_t ContextStateShadowControl = 0x80018001u; constexpr std::uint32_t ConditionalWordsMask = 0x3fffu; constexpr std::uint32_t DmaSourceCachePolicy = 3u << 13u; constexpr std::uint32_t DmaDestinationCachePolicy = 3u << 25u; @@ -380,7 +381,7 @@ void Validate(std::span packet, std::uint32_t queue) { size(4); require((packet[1] & 0xffff0000u) == 0, "CONTEXT_REG_RMW reserved offset bits are not implemented"); break; - case 0x12: graphics(); size(2); require((packet[1] & ~0xfu) == 0, "unsupported CLEAR_STATE payload bits"); break; + case 0x12: graphics(); size(2); require(packet[1] <= 3, "CLEAR_STATE commands above 3 are not implemented"); break; case 0x20: { graphics(); size(4); @@ -460,7 +461,7 @@ void Validate(std::span packet, std::uint32_t queue) { case 0x28: graphics(); size(3); - require((packet[1] & 0x7fffffffu) == 0 && (packet[2] & 0x7fffffffu) == 0, "CONTEXT_CONTROL register loading and shadowing are not implemented"); + require((packet[1] & 0x7fffffffu) == 0 && ((packet[2] & 0x7fffffffu) == 0 || packet[2] == ContextStateShadowControl), "CONTEXT_CONTROL register loading and shadowing are not implemented"); break; case 0x46: { const auto eventType = packet[1] & 0x3fu; @@ -1162,6 +1163,21 @@ void executeIndexAttributes(const IndexAttributes& attributes, QueueState& queue queue.indexType = attributes.words[3]; } +void ApplyContextState(std::uint32_t operation, QueueState& queue) { + switch (operation) { + case 0: queue.ClearContext(); break; + case 1: case 3: + require(!queue.savedContext.has_value(), "context state is already pushed"); + queue.PushContext(); + if (operation == 3) queue.ClearContext(); + break; + case 2: + require(queue.savedContext.has_value(), "context state has not been pushed"); + queue.PopContext(); + break; + } +} + } void Execute(std::span packet, QueueState& queue) { @@ -1178,18 +1194,7 @@ void Execute(std::span packet, QueueState& queue) { case 0x1a: if (TraceContextState()) std::fprintf(stderr, "[context] op %u: %zu registers, saved %d, cb0 %x info %x mask %x\n", packet[1], queue.context.size(), queue.savedContext.has_value() ? 1 : 0, queue.context.contains(0x318) ? queue.context.at(0x318) : 0u, queue.context.contains(0x31c) ? queue.context.at(0x31c) : 0u, queue.context.contains(0x8e) ? queue.context.at(0x8e) : 0u); APS5_LOG_OUT_DEBUG("CONTEXT_STATE operation=%u targetMaskBefore=0x%x shaderMaskBefore=0x%x", packet[1], queue.context.contains(0x8e) ? queue.context.at(0x8e) : 0u, queue.context.contains(0x8f) ? queue.context.at(0x8f) : 0u); - switch (packet[1]) { - case 0: queue.ClearContext(); break; - case 1: case 3: - require(!queue.savedContext.has_value(), "context state is already pushed"); - queue.PushContext(); - if (packet[1] == 3) queue.ClearContext(); - break; - case 2: - require(queue.savedContext.has_value(), "context state has not been pushed"); - queue.PopContext(); - break; - } + ApplyContextState(packet[1], queue); APS5_LOG_OUT_DEBUG("CONTEXT_STATE done operation=%u targetMaskAfter=0x%x shaderMaskAfter=0x%x", packet[1], queue.context.contains(0x8e) ? queue.context.at(0x8e) : 0u, queue.context.contains(0x8f) ? queue.context.at(0x8f) : 0u); return; default: throw std::runtime_error("custom packet requires driver execution"); @@ -1199,7 +1204,7 @@ void Execute(std::span packet, QueueState& queue) { return; case 0x12: APS5_LOG_OUT_DEBUG("CLEAR_STATE targetMaskBefore=0x%x shaderMaskBefore=0x%x", queue.context.contains(0x8e) ? queue.context.at(0x8e) : 0u, queue.context.contains(0x8f) ? queue.context.at(0x8f) : 0u); - queue.ClearContext(); return; + ApplyContextState(packet[1], queue); return; case 0x13: queue.indexBufferSize = packet[1]; return; case 0x20: { const auto operation = (packet[1] >> 16u) & 7u; diff --git a/core/libs/prx/libSceAgcDriver/tests/Pm4.cpp b/core/libs/prx/libSceAgcDriver/tests/Pm4.cpp index 12323cb81df0..a91b4dc173d6 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Pm4.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Pm4.cpp @@ -173,6 +173,8 @@ void testRegisters() { expectFailure([&] { execute(state, makePacket(0x7a, {0x20000242, 1})); }, "bank selection"); execute(state, makePacket(0x28, {0x80000000, 0x80000000})); execute(state, makePacket(0x28, {0, 0})); + execute(state, makePacket(0x28, {0, 0x80018001u})); + expectFailure([&] { AgcDriver::Pm4::Validate(makePacket(0x28, {0, 0x80018003u}), 0); }, "shadowing"); expectFailure([&] { AgcDriver::Pm4::Validate(makePacket(0x28, {0x80000001, 0x80000000}), 0); }, "shadowing"); expectFailure([&] { AgcDriver::Pm4::Validate(makePacket(0x28, {0x80000000, 0x80000002}), 0); }, "shadowing"); expectFailure([&] { AgcDriver::Pm4::Validate(makePacket(0x28, {0x80000000, 0x80000000}), 0x20); }, "compute queue"); @@ -268,6 +270,19 @@ void testContextAndBases() { check(state.context.at(0x280) == 0x00080008u && state.context.at(0x281) == 0xffff0000u, "context pop did not restore saved point size and limits"); check(state.context.at(0x10) == 17, "pop did not restore context"); expectFailure([&] { execute(state, makePacket(0x10, {2, 0}, 0x68)); }, "not been pushed"); + execute(state, makePacket(0x69, {0x10, 23})); + execute(state, makePacket(0x12, {1})); + check(state.savedContext.has_value() && state.context.at(0x10) == 23, "CLEAR_STATE push changed the context or did not save it"); + expectFailure([&] { execute(state, makePacket(0x12, {1})); }, "already pushed"); + execute(state, makePacket(0x69, {0x10, 29})); + execute(state, makePacket(0x12, {2})); + check(!state.savedContext.has_value() && state.context.at(0x10) == 23, "CLEAR_STATE pop did not restore the pushed context"); + expectFailure([&] { execute(state, makePacket(0x12, {2})); }, "not been pushed"); + execute(state, makePacket(0x12, {3})); + check(state.savedContext.has_value() && state.context == AgcDriver::ClearStateContextRegisters(), "CLEAR_STATE push-clear did not save and clear the context"); + execute(state, makePacket(0x12, {2})); + check(state.context.at(0x10) == 23, "pop after CLEAR_STATE push-clear did not restore the context"); + for (const auto command : {4u, 0xfu}) expectFailure([&] { AgcDriver::Pm4::Validate(makePacket(0x12, {command}), 0); }, "commands above 3"); alignas(8) std::array arguments{7, 8, 9, 0}; execute(state, makePacket(0x11, {1, low(arguments.data()), high(arguments.data())}, 2)); auto packet = makePacket(0x16, {0, 0x8041}); diff --git a/core/libs/prx/libSceAgcDriver/tests/Submit.cpp b/core/libs/prx/libSceAgcDriver/tests/Submit.cpp index 3b6e736e264b..c85916eb742e 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Submit.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Submit.cpp @@ -210,10 +210,14 @@ void testClearState() { packet.dw_num = 1; expectFailure([&] { sceAgcDriverSubmitDcb(&packet); }); packet.dw_num = 2; - for (std::uint32_t state = 0; state <= 0xf; ++state) { + for (const std::uint32_t state : {0u, 1u, 2u, 3u, 2u}) { words[1] = state; check(sceAgcDriverSubmitDcb(&packet) == 0, "CLEAR_STATE submit failed"); } + for (const std::uint32_t state : {4u, 0xfu}) { + words[1] = state; + expectFailure([&] { sceAgcDriverSubmitDcb(&packet); }); + } AgcDriverWaitIdle_nid_postfix(); } diff --git a/docs/dev/debt/libSceAcm.md b/docs/dev/debt/libSceAcm.md index ec92cb9cc24b..e8a911d9e911 100644 --- a/docs/dev/debt/libSceAcm.md +++ b/docs/dev/debt/libSceAcm.md @@ -40,7 +40,7 @@ ### Additional callable exports -- [Additional callable exports](../../../core/libs/prx/libSceAcm/Export.cpp) - 4 entries present in both version-labelled images are import-resolution declarations only. Neither label independently authenticates retail firmware provenance. Parameter lists, return types and behavior are unverified; parameterless `int` declarations are placeholders, not verified ABI contracts. Every entry throws through `NotImplemented_nid_no_patch`. Unidentified names use literal NID aliases. No runtime functionality is implemented. Data exports require separate layout and ownership analysis. Identified candidate names match their NIDs in the [public symbol database](https://github.com/zecoxao/sce_symbols/blob/2883963a0a514ba6e77407a08ef4730a65e88254/aerolib.csv) or [supplemental catalog](https://github.com/claimore22/ps5rs/blob/2304be5131221bae0dac24b9767cabffda33f747/data/nids.csv). +- [Unnamed firmware 13.42 exports](../../../core/libs/prx/libSceAcm/Export.cpp) - 44 function NIDs that firmware 13.42's `system/common/lib/libSceAcm.sprx` exports (read from its export table) are import-resolution declarations only. The [firmware 13.60 inventory](https://github.com/xdCloudy/PS5-13.60-Function-Stub-Library/blob/bfec40deb4c47a17d7603ee2bc79aa6862c0c56b/data/firmware-13.60/libsceacm-a3566cc281.jsonl) lists the same NIDs as defined function exports with no name, and none is in the [public symbol database](https://github.com/zecoxao/sce_symbols/blob/2883963a0a514ba6e77407a08ef4730a65e88254/aerolib.csv). Names, parameter lists, return types and behavior are unknown; parameterless `int` declarations are placeholders, not verified ABI contracts, and every entry throws through `NotImplemented_nid_no_patch`. | Name | NID | | --- | --- | @@ -51,7 +51,6 @@ - [Unknown NID `9+f3tPdeyP0`](../../../core/libs/prx/libSceAcm/Export.cpp) (libSceAcm) - its name and the structure it advances are unknown; the parameter and result types come from the body, not a prototype, and nothing is claimed about the object beyond the fields used. Firmware 13.42 `libSceAcm.sprx` (`0x8190`, disassembly only, not run on a console) returns null for a null argument. Otherwise it reads a base pointer at `+0` and 32-bit fields at `+8`, `+0xc` and `+0x10`, raises `+0xc` to at most `+8`, moves `+0x10` to the next slot (0 after an empty state, 0 again at `+8`) and returns the base plus 1024 bytes per slot, with the slot shifted by 8 in 32 bits. Only null is checked; a bad pointer faults there too. -- [Unnamed firmware 13.42 exports](../../../core/libs/prx/libSceAcm/Export.cpp) - 44 function NIDs that firmware 13.42's `system/common/lib/libSceAcm.sprx` exports (read from its export table) are import-resolution declarations only. The [firmware 13.60 inventory](https://github.com/xdCloudy/PS5-13.60-Function-Stub-Library/blob/bfec40deb4c47a17d7603ee2bc79aa6862c0c56b/data/firmware-13.60/libsceacm-a3566cc281.jsonl) lists the same NIDs as defined function exports with no name, and none is in the [public symbol database](https://github.com/zecoxao/sce_symbols/blob/2883963a0a514ba6e77407a08ef4730a65e88254/aerolib.csv). Names, parameter lists, return types and behavior are unknown; parameterless `int` declarations are placeholders, not verified ABI contracts, and every entry throws through `NotImplemented_nid_no_patch`. | Name | NID | | --- | --- | diff --git a/docs/dev/debt/libSceAgc.md b/docs/dev/debt/libSceAgc.md index c6a373db0fb5..829628c8a467 100644 --- a/docs/dev/debt/libSceAgc.md +++ b/docs/dev/debt/libSceAgc.md @@ -23,6 +23,7 @@ - [sceAgcDcbAtomicGds_0900](../../../core/libs/prx/libSceAgc/DcbFlow/src/Control.cpp) (libSceAgc) - and `sceAgcDcbAtomicGds` (forwards to it with control bit 7 cleared; the unversioned exports mask the op to seven bits) - the leading `engine` argument (ENGINE_SEL, bits 30-31) and the register/stack argument order are not measured on a console; the 11-dword ATOMIC_GDS (0x1d) layout and control/mode bit mapping follow the clean-room [OpenAGC](https://github.com/OpenAGC/OpenAGC/blob/3c7e8072f0d7684e930454794fd5c02056946d73/src/game_compat.c) only; KytyPS5 and shadPS4 have no body for it. `sceAgcAcbAtomicGds` (forwards to `sceAgcAcbAtomicGds_0900` with control bit 7 cleared) takes the same arguments. Not confirmed on a title, and the driver has no ATOMIC_GDS handler - [sceAgcGetFusedShaderSize](../../../core/libs/prx/libSceAgc/Misc/src/ShaderFusion.cpp) (libSceAgc) - follows the firmware body (read from disassembly, not measured on a console): it checks the halves and writes `back->num_sh_registers * 8` and a 32-bit alignment of 4 itself, without the geometry layout `sceAgcGetFusedShaderSize_0080` computes. The firmware dereferences null pointers; here a null shader, or a null output with valid halves, is rejected instead - [sceAgcGetIsTrinityMode](../../../core/libs/prx/libSceAgc/Misc/src/Platform.cpp) (libSceAgc) - signature from PPSA26344 (a pointer to a one-byte flag, result ignored); a null or unwritable output pointer throws (rejecting unwritable memory is a host-safety fallback; console fault handling is unmeasured). The SDK 9.04 module stores `sceKernelIsTrinityMode`'s byte result through the pointer and returns it without an error path, so a console faults on null. Six more disassembled titles (PPSA01494, PPSA18194, PPSA21564, PPSA30839, PPSA31162, PPSA34502) call it once from an initializer with a static byte and check `flag != 0` without passing null +- [sceAgcDcbContextStateOp](../../../core/libs/prx/libSceAgc/DcbState/src/ContextState.cpp) (libSceAgc) - operation 1 writes the console's `CONTEXT_CONTROL` (load 0, shadow `0x80018001`) and `CLEAR_STATE` 1 and returns the first packet, as measured by `agcbuild_DcbContextStateOp_b`; `sceAgcDcbContextStateOpGetSize(1)` still reports KytyPS5's 108 bytes, more than the 20 written. Operations 0, 2 and 3 delegate to `sceAgcDcbContextStateOp_0100` (same packets as KytyPS5's `AgcDcbContextStateOp`) and were not compared with a real console. For operations above 3 the console writes only `CLEAR_STATE` with the low bits of the operation and returns null (`_a`, `_c`: 1 and 2, which do not tell a 2-bit from a 4-bit mask); here it throws - [sceAgcDcbSet{Cf,Cx,Sh,Uc}RegisterDirect, sceAgcCbSet{Sh,Uc}RegisterRangeDirect](../../../core/libs/prx/libSceAgc/DcbState/src/Registers.cpp) (libSceAgc) - follow prosper's console measurements (`agcbuild_DcbSet{Cf,Cx,Sh,Uc}RegisterDirect_a/c`, `agcbuild_CbSet{Sh,Uc}RegisterRangeDirect_c`): a direct write keeps the low bits of the register offset (0x11111111 wrote 0x1111, 0x22222222 wrote 0x2222), and a CB range with no values writes its header and offset only. The measured offsets never set bits 14 or 15, so a 14-bit mask would fit them too; the 16-bit field width is used. Not measured: offset 0xffffffff, which the driver treats as naming no register; a `sceAgcDcbSetCfRegisterRangeDirect` with no values, which still throws; and a range with values whose offset does not fit, which still throws. - [sceAgcDcbContextStateOp](../../../core/libs/prx/libSceAgc/DcbState/src/ContextState.cpp) (libSceAgc) - delegates to `sceAgcDcbContextStateOp_0100` (same packets as KytyPS5's `AgcDcbContextStateOp`); KytyPS5 returns nullptr for an operation above 3, here it throws; the packet words were not compared with a real console - [sceAgcBranchPatchSetThenTarget_0300, sceAgcBranchPatchSetElseTarget_0300](../../../core/libs/prx/libSceAgc/Patch/src/Branch.cpp) (libSceAgc) - names from their NIDs (`7Wa3aeJgeVU`, `rP5xLdOf26k`); the `(packet, cachePolicy, target, sizeInDwords)` signature is inferred from PPSA28416's calls (a branch packet, 0, an aligned target, 4), with the policy stored where `sceAgcCbBranch` puts it diff --git a/docs/dev/debt/libSceAgcDriver.md b/docs/dev/debt/libSceAgcDriver.md index 173437805cc9..418c26bf90b2 100644 --- a/docs/dev/debt/libSceAgcDriver.md +++ b/docs/dev/debt/libSceAgcDriver.md @@ -361,6 +361,7 @@ Eligible single-sample draws retain native finite bounds inside [0, 1] and use a - [4_4_4_4 partial writes, measured hardware](../../../core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444MultisamplePartialWrite.cpp) (libSceAgcDriver) - the single-sample merges and the 2-, 4- and 8-sample staged merges are measured only on an NVIDIA RTX 4070 SUPER, not on other host GPUs or a PS5. - [COPY_DATA from the GPU clock](../../../core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp) (libSceAgcDriver, `SRC_SEL` 9) writes the host steady clock in 10 ns ticks when the packet runs, the same counter as the `RELEASE_MEM` timestamp. On a PS5 (firmware 13.40, measured 2026-10-19 on the GPU through `sceAgcDriverSubmitDcb` from inside a retail title) `SRC_SEL` 9 and the `RELEASE_MEM` DATA_SEL 3 timestamp were the same counter (0x1C and 0x5C ticks apart within one buffer), and it ran at 98.0 and 99.8 MHz over two 1.1 s intervals timed by the CPU, i.e. 100 MHz within the submission jitter, as the 10 ns ticks here; only its starting value is the host's. The `COPY_DATA` cache policy fields are accepted and have no effect. - [COPY_DATA from a register](../../../core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp) (libSceAgcDriver, `SRC_SEL` 0) copies the value the queue holds for a shader, context or user config register (`COUNT_SEL` two consecutive ones) and throws for a register with no value. A dispatch records `COMPUTE_DISPATCH_INITIATOR` and, for `DISPATCH_DIRECT`, `COMPUTE_DIM_X/Y/Z` in the shader registers; `DISPATCH_INDIRECT` clears the three counts. Neither the register values the CP writes nor the copy's ordering against in-flight dispatches have been measured on hardware. +- [CLEAR_STATE commands and CONTEXT_CONTROL shadowing](../../../core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp) (libSceAgcDriver, opcodes 0x12 and 0x28) - `CLEAR_STATE` command 0 clears the context, 1 pushes it, 2 pops it and 3 pushes and clears it, as the `CONTEXT_STATE` NOP operations do. That reading is inferred, not measured: the console's `sceAgcDcbContextStateOp(1)`, which AnyPS5 runs as a push, writes `CLEAR_STATE` 1 (`agcbuild_DcbContextStateOp_b`). Commands 4 to 15 are refused. `CONTEXT_CONTROL` accepts the shadow-control word `0x80018001` that packet carries and keeps no shadow memory, since no load is requested - [CONTEXT_REG_RMW](../../../core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp) (libSceAgcDriver, opcode 0x51) throws `CONTEXT_REG_RMW register has no known value` for a context register the queue holds no value for, since the result keeps the old value's unmasked bits. Of the registers PAL c5e80007 modifies with this packet, `CB_COLORn_INFO`, `DB_RENDER_OVERRIDE` and `DB_Z_INFO` have a starting and `CLEAR_STATE` value in the model; `CB_COLORn_DCC_CONTROL` (0x31e + 0xf * n), `DB_COUNT_CONTROL` (0x001) and `DB_RESERVED_REG_2` (0x00f) have none, so an RMW of one of them throws until the queue writes it. Their console reset values have not been measured. - [DRAW_INDEX_MULTI_INST](../../../core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp) (libSceAgcDriver, opcode 0x3a) - refused. Which fields hold the instance count, object ID address, index base and index count is not confirmed (see `sceAgcDcbDrawIndexMultiInstanced` in libSceAgc's debt), and neither is how the object IDs reach the shaders or which instance ID each instance sees when the initiator sets `UNROLLED_INST` (bit 7 in [gc_10_1_0_sh_mask.h](https://github.com/torvalds/linux/blob/0fcb05b72344f40806cbe810de8872f1698bf053/drivers/gpu/drm/amd/include/asic_reg/gc/gc_10_1_0_sh_mask.h#L24281)), as the console's builder always does. - [EVENT_WRITE stream-out statistics events](../../../core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp) (libSceAgcDriver, opcode 0x46) - `SAMPLE_STREAMOUTSTATS1`-`3` and `SAMPLE_STREAMOUTSTATS` (event types 0x01-0x03 and 0x20 in [navi10_enum.h](https://github.com/torvalds/linux/blob/0fcb05b72344f40806cbe810de8872f1698bf053/drivers/gpu/drm/amd/include/navi10_enum.h#L14155-L14188)) are accepted on the graphics queue as a 2-dword packet with event index 0 and do nothing. [nvd.h](https://github.com/torvalds/linux/blob/0fcb05b72344f40806cbe810de8872f1698bf053/drivers/gpu/drm/amd/amdgpu/nvd.h#L326-L347) documents these events only with the sampling index (3, or `EVENT_INDEX__SAMPLE_STREAMOUTSTATS*` 8-11 on gfx10); the index-0 packet has no destination dwords, and what the CP does with it is neither documented nor measured on hardware. AnyPS5 does not emulate the VGT stream-out counters, so there is nothing to sample. The sampling indices throw that sampling to memory is not implemented, and other indices, other sizes and the compute queue throw. [sceAgcDcbEventWrite](../../../core/libs/prx/libSceAgc/DcbFlow/src/Sync.cpp) ignores the address for every event type except 0x38 and 0x39, so a call with one of these event types and an address builds the index-0 packet: nothing is written and nothing throws. Whether the console's builder emits a sampling packet for an address is not known. diff --git a/tools/library-oracle/known.tsv b/tools/library-oracle/known.tsv index cff088625b84..90449f2ba92e 100644 --- a/tools/library-oracle/known.tsv +++ b/tools/library-oracle/known.tsv @@ -45,7 +45,6 @@ agcbuild_DcbAtomicMem_a diff more than six arguments; the console's stack argume agcbuild_DcbAtomicMem_b diff more than six arguments; the console's stack arguments are not known agcbuild_DcbAtomicMem_c diff more than six arguments; the console's stack arguments are not known agcbuild_DcbContextStateOp_a throw AnyPS5 throws for arguments the console encodes -agcbuild_DcbContextStateOp_b diff the packet differs from the console's; not yet analysed agcbuild_DcbContextStateOp_c throw AnyPS5 throws for arguments the console encodes agcbuild_DcbCopyData_a diff the recording passes six of the export's nine arguments; the console's item size and write confirm are not recorded agcbuild_DcbCopyData_b diff the recording passes six of the export's nine arguments; the console's item size and write confirm are not recorded