Commit Graph
145 Commits
Author SHA1 Message Date
boykopovar df4d0beae6 fix(agc): restore geometry shader resource merging 2026-10-21 21:53:55 +03:00
boykopovar c311d6dc2a fix(agc): take offchip lds enable from the front shader half 2026-10-21 21:53:54 +03:00
boykopovar faebf639e9 fix(agc): restore semaphore memory clearing and errors 2026-10-21 21:53:53 +03:00
boykopovar d6966f9792 fix(agc): preserve wait packet control bits during patching 2026-10-21 21:53:52 +03:00
boykopovar 51d788e87c fix(agc): restore wait patch scalar argument widths 2026-10-21 21:53:51 +03:00
Adrià 5bd9912658 Merge pull request #8317 from hypermoist/feat/agc-static-buffers
feat(libSceAgc): implement static buffers and qwords
2026-10-21 15:32:19 +02:00
Adrià 275e896797 Merge pull request #7696 from MaxLikesCode/feat/agc-set-index-indirect-args
feat(libSceAgc): implement sceAgcDcbSetIndexIndirectArgs
2026-10-21 12:52:39 +02:00
Adrià 84be26d93e Merge pull request #7606 from hugodearaujo/fix/agc-register-range-any-alignment
fix(libSceAgc): accept register range values at any byte address, as the console does
2026-10-20 12:55:13 +02:00
hypermistandClaude Opus 5.5 fec563d92c feat(libSceAgc): implement static buffers and qwords
sceAgcSetStaticBuffer, sceAgcGetStaticBuffer, sceAgcSetStaticQword and
sceAgcGetStaticQword read and write the six 16-byte slots at 0xfe0040000
that the driver already maps for the fetch shader table, through a new
AgcDriverStaticTable_nid_postfix accessor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-20 22:52:52 +13:00
Adrià 9b34cba9ef Merge pull request #6794 from fma-rc/feat/agc-acb-set-flip
feat(libSceAgc): implement sceAgcAcbSetFlip and execute flips on compute queues
2026-10-19 20:42:20 +02:00
fogydes 093d6a3d4e fix(libSceAgc): align CB memory semaphore with console oracle and document debt 2026-10-19 13:46:46 +05:30
fogydes 82d93b09a8 test(libSceAgc): drop invalid clientCode rejection check in testMemSemaphore 2026-10-19 13:41:40 +05:30
fogydes dd3798ddeb feat(libSceAgc): implement CB memory semaphore and unversioned payload address 2026-10-19 13:41:40 +05:30
Adrià bda28c62c0 Merge pull request #6653 from JJenkx/fix/agc-fusion-offchip-lds
fix(agc): retain offchip LDS enable during shader fusion
2026-10-19 10:01:33 +02:00
fogydes cf994f1f60 feat(libSceAgc): implement DCB atomic GDS operations and correct size accessor 2026-10-19 04:37:29 +02:00
fogydes c2a158415d feat(libSceAgc): implement unversioned context state operations 2026-10-19 04:13:09 +02:00
MaxandClaude Opus 5.5 5140b08d82 feat(libSceAgc): implement sceAgcDcbSetIndexIndirectArgs
Write the INDEX_ATTRIBUTES_INDIRECT packet the console's builder writes,
as measured by the prosper console oracle, with OpenAGC's signature, and
report its measured size of 16 bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 02:53:01 +02:00
MarcZX10 0c2260e30a fix(libSceAgc): preserve versioned register defaults layout 2026-10-18 22:56:16 +00:00
Adrià 2da2284def Merge pull request #6270 from YossiYad/fix/agc-register-defaults-pairs
fix(libSceAgc): return the console's register-defaults table and type pairs
2026-10-18 23:14:29 +02:00
Adrià 09acc80f7e Merge pull request #6145 from MarcZX10/codex/fix-agc-atomic-gds-size
fix(libSceAgc): reserve complete atomic GDS packets
2026-10-18 19:28:01 +02:00
hugodearaujo 9895d130c4 fix(libSceAgc): accept register range values at any byte address, as the console does 2026-10-18 11:59:50 -03:00
fma-rc f60a86f27a feat(libSceAgc): implement sceAgcAcbSetFlip 2026-10-17 08:02:02 +02:00
Dean 16c607a937 Merge pull request #6925 from LeandroLP23/fix/agc-shader-helpers-shutdown
test(agc): shut libc down before agc_shader_helpers returns
2026-10-17 17:29:05 +13:00
Adrià f1dded21fe Merge pull request #6004 from XairRrR/fix/agc-empty-register-list
fix(agc): write nothing for an empty register list
2026-10-17 03:10:51 +02:00
LeandroLP23andClaude Opus 5.5 050f10053c test(agc): shut libc down before agc_shader_helpers returns
On Windows, agc_shader_helpers returned from main with the driver's
threads still running. ExitProcess ends them first, then the DLLs'
static destructors run and wait on what those threads left locked:
the async log's queue mutex in Driver::stop, DeviceUseGate's condition
variable in ~Driver, and condition variables in libkernel's statics.
The test hung after printing its result in about one ctest run of
three on a Radeon 860M (#6791).

Like the other driver tests, it now runs LibcRunShutdown_nid_postfix
before returning, which stops the driver while its threads are alive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 20:56:41 +02:00
JJenkx 522696d1ce fix(agc): retain front-half offchip LDS enable during shader fusion 2026-10-15 21:42:43 -04:00
Adrià ab88420409 Merge pull request #5845 from pushkarreddyy/feat/libSceAgc-default-cx-state-flat
feat(libSceAgc): implement sceAgcGetDefaultCxStateFlat
2026-10-15 23:00:59 +02:00
Adrià 8b99f0177c Merge pull request #5848 from wachi35676/refactor/libSceAgc-name-interpolant-mapping-10000
refactor(agc): name dbOlWdppb4o and vieBRwlh1Lw the _10000 interpolant mappings
2026-10-15 23:00:46 +02:00
Adrià Franch 6ebab0e73b test(libSceAgc): declare the invalid-argument constant, restore the register defaults version checks 2026-10-15 15:36:49 +02:00
pushkarreddyy fd90df41b6 feat(libSceAgc): implement sceAgcGetDefaultCxStateFlat 2026-10-15 15:36:43 +02:00
Yossi Yadgar 52e288ef43 test(libSceAgc): find the MRT0 colour-target defaults the way a title does
Reads the root at its byte offsets, walks the type table as key and
bank-index pairs and checks that the MRT0 key leads to the sixteen
colour-target registers: block 78 of the table sceAgcGetRegisterDefaults
returns, block 73 of version 10, and a valid block in every version from
4. Fails on the compact entries and on the version 0 legacy table.
2026-10-15 11:04:32 +03:00
XairRrR f991052cfd test(agc): an empty register list into a null buffer still throws
AI-assisted: yes
2026-10-15 02:54:50 +02:00
MarcZX100 7918cfc49a fix(libSceAgc): reserve complete atomic GDS packets 2026-10-14 23:21:34 +00:00
XairRrR cf914b5102 fix(agc): write nothing for an empty register list
sceAgcCbSetShRegistersDirect and the other register list writers threw on
a count of 0 although the matching size functions report 0 words for it.
PPSA05684 calls the writer with an empty list at its main menu and
terminated. An empty list now writes no packet and returns the cursor,
as its size says; a null buffer still throws.

AI-assisted: yes
2026-10-14 20:50:00 +02:00
Muhammad Wasif Ali WasifandClaude Opus 5.5 a0fc988a53 refactor(agc): name dbOlWdppb4o and vieBRwlh1Lw the _10000 interpolant mappings
The names hash to the NIDs dbOlWdppb4o and vieBRwlh1Lw that the exports
carried as sceAgcUnknownCreateInterpolantMapping and
sceAgcUnknown_vieBRwlh1Lw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 18:44:16 +05:00
Maz eb1b9eca96 fix(agc): return 0 for out-of-range sceAgcInit without table lookup
Pointer-shaped calls match the #4808 console probe (success, no writes); selecting table 13 for those values was unsupported.
2026-10-14 11:38:52 +04:00
mazen 9d412df7b5 fix(agc): fall back out-of-range sceAgcInit versions to table 13
Pointer-shaped NID kW3GLb7QfPg calls from public homebrew succeed on console; returning an error left those titles failing init after #4835.
2026-10-14 11:30:49 +04:00
Dean 107190d11d Merge pull request #5573 from fma-rc/fix/agc-fuse-halves-scratch
fix(agc): keep fused geometry programs out of the caller's memory
2026-10-14 19:25:23 +13:00
pushkarreddyy fbf619ef0d feat(libSceAgc): ignore address argument on non-sample-dump events in sceAgcDcbEventWrite 2026-10-14 07:37:02 +05:30
fma-rc d6f67d1be2 fix(agc): keep fused geometry programs out of the caller's memory
sceAgcFuseShaderHalves copied both halves' code, the fused header and its
tables into the caller's memory and registered the program at that
address. PPSA02100 fuses different halves into the same memory a few
calls apart, while draws that use the earlier result are still queued.
The registry keeps one program per code address, so those draws were
compiled from the later program: its code read a user-data word the
bound layout does not have, and the device reported "BDA access failed"
for the mesh stage.

The PS5 5.02 module writes only the back half's register list into that
memory (sceAgcGetFusedShaderSize reports eight bytes per register,
alignment 4) and leaves the code where the halves are.

The fused code, header and tables now live in memory libSceAgc owns, one
program per distinct pair of halves, registered once. The caller's
memory receives the fused register list and the size query reports that
list. A second fusion of the same halves returns the same program; halves
whose contents changed get a new one.

The driver looked a header up by comparing its fields with the
registered header, including the register list's address. A header whose
register list is a copy elsewhere with the same contents now matches
too, which is what the title passes after a fusion.
2026-10-14 02:08:21 +02:00
David 352d04e8dc feat(libSceAgc): implement sceAgcSetAmmSemaphoreMemory and sceAgcGetSemaphoreLabel
sceAgcSetAmmSemaphoreMemory(memory, sizeInBytes) registers the AMM semaphore memory once and zeroes the first 8 bytes of each 32-byte label; sceAgcGetSemaphoreLabel(index, label) writes memory + 32 * index for an index inside the registered memory.

Unblocks New Joe & Mac Caveman Ninja (PPSA02801) which imports both symbols. Matches OpenAGC and sharpemu agreements on signatures, 16 KiB alignment, 32-byte stride, and zeroed label counters.
2026-10-13 15:01:43 +02:00
Dean 501f4f5aa7 Merge pull request #4835 from MarcZX100/fix/agc-init-version-error-4808
fix(agc): return error for unsupported init versions
2026-10-13 22:00:27 +13:00
MarcZX100 cbd615bb42 fix(agc): return error for unsupported init versions 2026-10-12 23:15:39 +00:00
winstrexandClaude Opus 5.5 cb6866653c feat(libSceAgc): implement sceAgcGetGsPrimPayload
Report the 8-byte GS primitive payload when the shader's context registers
set SPI_SHADER_IDX_FORMAT.IDX0_EXPORT_FORMAT to SPI_SHADER_2COMP, and 0
otherwise. The search runs over every context register, so an earlier
SPI_SHADER_IDX_FORMAT entry with another format does not end it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 19:46:20 -03:00
fdfawef324andClaude Opus 5.5 f8257a112b feat(agc): return null from the workload builders for unregistered streams
sceAgcDcbSetWorkloadStreamInactive and the three ACB workload builders
(sceAgcAcbSetWorkloadsActive, sceAgcAcbSetWorkloadComplete,
sceAgcAcbSetWorkloadStreamInactive) threw for every call, and
sceAgcDcbSetWorkloadsActive read the workload ids before it checked the
stream.

The prosper console oracle (mattias800/prosper df074498,
prosper/tests/data/console_oracle/agcbuild.golden.tsv lines 48-56 and
196-204) measured all six calls on a PS5 with three argument patterns
and no workload stream registered: each returned null and wrote nothing.
Pattern b passes stream 1 with the workload ids at address 2, so the
console checks the stream before it reads the ids; here that call read
address 2 and crashed.

The four builders now return null for a null command buffer or a stream
that is not registered, and still throw for a registered stream: the
packet a registered stream gets is not measured, KytyPS5 has no body for
them, and its IT_NOP layout for the DCB calls differs from the
SET_UCONFIG_REG, WRITE_DATA and SET_WORKLOAD sequence OpenAGC
(3c7e8072, src/agc_workload_packet.c) derives from the driver. The
signatures are OpenAGC's DCB ones (src/game_compat.c), which says the
ACB calls use the same driver builders. sceAgcDcbSetWorkloadsActive now
checks the stream before the ids, as OpenAGC does. Recorded in
docs/dev/debt/libSceAgc.md.

agc_commands gains testWorkloadStreams: the three measured patterns for
all six calls (null, buffer untouched), an exhausted and a null buffer,
and a registered stream that throws without touching the buffer. On
upstream/main it fails with "sceAgcDcbSetWorkloadStreamInactive not
implemented", and the DCB active pattern b alone segfaults reading
0x2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 15:22:21 -04:00
Dean 2dfde65fa1 Merge pull request #3789 from xXPBSXx/fix/agc-workload-nop-packets
fix(libSceAgc): emit NOP packets for the DCB workload calls
2026-10-13 00:44:27 +13:00
Utku Halis 661f8e1e7c feat(libSceAgc): implement sceAgcAcbWaitUntilSafeForRendering 2026-10-12 08:26:47 +03:00
xXPBSXxandClaude Sonnet 5.5 2a7b38ab75 fix(libSceAgc): write the KytyPS5 workload packets and return null for unregistered streams
sceAgcDcbSetWorkloadsActive writes an 18-dword IT_NOP packet (stream id, 64-bit workload mask) and sceAgcDcbSetWorkloadComplete a 12-dword one (stream id, workload id, 64-bit clear mask), following KytyPS5. Both return null for a null buffer, an unregistered or out-of-range stream, a workload id above 63, and for active a duplicate id or a count of 0 or above 63. sceAgcDriverRegisterWorkloadStream and sceAgcDriverUnregisterWorkloadStream now record the stream ids the DCB calls check.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-12 01:37:56 +02:00
xXPBSXxandClaude Sonnet 5.5 45fcf734ab fix(libSceAgc): emit NOP packets for the DCB workload calls
sceAgcDcbSetWorkloadsActive and sceAgcDcbSetWorkloadComplete threw. They now write a plain two-dword NOP and keep no workload state.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-12 01:36:51 +02:00
Adrià 6dbc0ea66a Merge pull request #3829 from YossiYad/carry/agc-vieBRwlh1Lw
feat(libSceAgc): implement the vieBRwlh1Lw interpolant mapping update
2026-10-12 00:39:58 +02:00