Commit Graph
4978 Commits
Author SHA1 Message Date
Yunus Shaikh 5be005ea13 fix(agc): sample a native multisample depth target through a descriptor without HTILE
Once its D32S8 target imports, The Grinch: Christmas Adventures
(PPSA07656) samples the depth plane through a T# with no metadata
(META_DATA_ADDRESS 0, not pipe-aligned) while the target has its HTILE.
The pipe/bank XOR and ITERATE_256 match. CheckResource required the
descriptor's metadata to be the target's HTILE and stopped the title
with "native multisample depth sampled metadata or XOR mismatch".

The host image keeps the depth decompressed, so a descriptor that reads
the plane without metadata reads the values a metadata-aware one does.
CheckResource now accepts a descriptor with no metadata at all beside
one naming the target's HTILE, when its address, format, XOR and
ITERATE_256 match. A descriptor with any other metadata keeps refusing.

Assumption: on hardware such a read returns the decompressed depth only
once the guest has expanded the plane (an in-place expand with
compression disabled). Main draws an in-place expand as an ordinary draw
that writes the depth attachment (DB_RENDER_CONTROL compress-disable bits
are not refused), over a host image that already holds the decompressed
depth, and has no out-of-place expand for multisampled planes. Nothing
here observes whether the guest expanded first; a title that samples the
plane unexpanded gets the decompressed values instead of the raw plane.

Tested: agc_driver_native_depth_separate_stencil samples the separate
stencil target through a descriptor without metadata, before and after
raster writes and after a depth-only HTILE fill, and gets the depth.
The same descriptor with another XOR and one naming other metadata are
refused. Without the change the first sample refuses "native
multisample depth sampled metadata or XOR mismatch".
2026-10-21 23:03:54 +00:00
Yunus Shaikh 7d6e968d6b fix(agc): import native multisample D32S8 targets with a separate cleared stencil plane
The Grinch: Christmas Adventures (PPSA07656) binds a two-sample
D32_SFLOAT_S8_UINT target whose stencil is a plane of its own and whose
HTILE is depth-only (DB_STENCIL_INFO.TILE_STENCIL_DISABLE), so HTILE
holds no stencil state. Every byte of that plane is the clear stencil
when the target is first bound. The import refused it ("native
multisample stencil import requires HTILE stencil metadata") and the
title stopped before its first present.

With a depth-only HTILE the stencil is uncompressed in its plane, so the
plane is its own proof: the import scans it once and accepts the target
when every byte equals DB_STENCIL_CLEAR. The depth keeps its HTILE clear
proof. The plane is already one of the import's ranges, accessible,
watched, generation-checked, guarded from guest publication and kept
apart from the depth and HTILE ranges, so a later CPU or GPU write to it
refuses sampling like a write to the depth. The host image is created
cleared to the clear stencil. The plane's base keeps the 64 KiB
alignment of the depth plane: both use SW_64KB_Z_X, the decode takes
the pipe/bank XOR from the depth base's low 16 bits and masks both bases.

A whole HTILE fill of such a target is proven for the depth only and
clears only the host depth: the stencil plane is untouched by the fill
and still proven unchanged since the import.

A stencil plane that is not all clear, a stencil in neither HTILE nor
its own plane, D16S8 and HTILE words that do not prove a clear keep
their refusals.

Tested: agc_driver_native_depth_separate_stencil imports a four-sample
target (two and eight where the device has them), samples the clear
depth, stencil-tests the clear stencil, and refills a depth-only HTILE
keeping a replaced stencil; one stencil byte not clear, a later stencil
write and an unwatched plane are refused. Without the import change the
target refuses "native multisample stencil import requires HTILE
stencil metadata"; without the fill change the refilled target loses
its stencil.
2026-10-21 22:55:19 +00:00
Yunus Shaikh 8eba29aeef Merge main into fix/agc-msaa-d32s8-separate-stencil
Brings upstream main a6dcea927 under #6300's two commits.

Conflicts:
- DepthSurface.cpp prepareDepthSampling: #6300's stencil checks are kept
  and main's 752cca10f drops the ITERATE_256 requirement, so the HTILE
  check is main's line ("requires pipe-aligned HTILE without VRS").
- DepthSurface.cpp NoteHtileDepthClear and NoteDepthMetadataFill: #6300's
  clear and fill proofs are kept, written with main's first-refusal-wins
  DepthSamplingState::Refuse. After the proven whole-fill branch, the
  remaining fills take main's ForgetClear/NoteHtileClear and single-sample
  plane-fill paths.
- NativeMultisampleDepth.cpp CheckDepthTarget takes both #6300's
  ClearSource and main's iterate256, in that order; main's ITERATE_256
  call passes ClearSource::HtileDispatch.
- docs/dev/debt/libSceAgcDriver.md: one entry with #6300's stencil and
  fill text and main's ITERATE_256 text.

Adapted to main: main samples a native multisampled depth target
through a shadow copy that is refreshed when the sampled view is looked
up (1912045c1, 5a0a00f42). CheckStencilTarget recorded its raster and
the fetch in one batch, so the fetch read the shadow from before the
raster ("native depth-stencil sampled fetch lost a depth sample or a
stencil test outcome"). It now submits the raster, looks the view up
again and syncs before the fetch, as main's CheckDepthTarget does.
2026-10-21 22:49:54 +00:00
boykopovar a6dcea9279 Merge pull request #9137 from boykopovar/fix/funcs-abi-debt-2026-10-20
fix(libs): libs funcs abi debt 2026 10 20
Corrected signatures or behaviour of 1,702 existing exported functions across 96 libraries. Added 85 typed export wrappers. Unimplemented functions retain NotImplemented_nid_no_patch(__func__).
2026-10-22 00:32:11 +03:00
Adrià 0c6a5bd593 Merge pull request #8519 from MarrasFederico/fix/agc-zero-stride-oob-select
fix(agc): follow RDNA 2's range checks for zero-stride vertex fetches
2026-10-21 21:54:30 +02:00
Adrià 415fd7136b Merge pull request #8991 from Tamalero/fix/shader-image-table-split-tsharp-halves
fix(recompiler): match image-table T# halves offset before and after readfirstlane
2026-10-21 21:53:27 +02:00
Dean 3594eee9f3 Merge pull request #6604 from notaxeltv/fix/recompiler-default-past-num-interp
fix(recompiler): fill missing pixel interpolators as DEFAULT
2026-10-22 08:31:15 +13:00
Adrià f0de89a506 Merge pull request #9026 from milescoviello/perf/depth-plane-unit-stores
perf(agc): store only the depth plane units a read overlaps
2026-10-21 21:29:26 +02:00
Adrià 1698d1ea6a Merge pull request #8642 from MarcZX10/codex/color-compare-format-support-7934
fix(agc): match measured color comparison formats
2026-10-21 21:02:30 +02:00
boykopovar 2f678e9046 docs: record retained activation and pad no-op behavior 2026-10-21 21:56:06 +03:00
boykopovar 6036bc6512 fix(zlib): restore validation errors and finalization behavior 2026-10-21 21:56:06 +03:00
boykopovar 8b75d497c0 fix(kernel): reject unimplemented internal pool statistics 2026-10-21 21:56:05 +03:00
boykopovar 77835951cd fix(ssl): defer private key parsing and allow separate identity loads 2026-10-21 21:56:04 +03:00
boykopovar 350c6eb323 fix(font): restore typography validation and reject unsupported shaping 2026-10-21 21:56:03 +03:00
boykopovar e7a1e5594a fix(ssl): restore ca query errors and sdk unload boundary 2026-10-21 21:56:02 +03:00
boykopovar 1e6077d1fa fix(voice): restore port info frame sizes and output bounds 2026-10-21 21:56:00 +03:00
boykopovar 09fb692fa1 fix(voice): restore port format validation and resource limits 2026-10-21 21:55:34 +03:00
boykopovar 0f668a2ea8 fix(voice): restore start memory checks and lifecycle errors 2026-10-21 21:55:33 +03:00
boykopovar f4447aa252 fix(kernel): restore coredump registration and file flag validation 2026-10-21 21:55:33 +03:00
boykopovar b9fb0d2897 fix(kernel): restore signed coredump attachment lengths 2026-10-21 21:55:32 +03:00
boykopovar f76db36d9f fix(hmd2): restore buffer size query pair return type 2026-10-21 21:55:31 +03:00
boykopovar fe4016f612 fix(voice): restore initialization and thread parameter validation 2026-10-21 21:55:30 +03:00
boykopovar ee76c0cd98 fix(kernel): restore coredump buffer validation and data type argument 2026-10-21 21:55:30 +03:00
boykopovar cf717cd80f fix(videorecording): restore info selectors and unopened errors 2026-10-21 21:55:26 +03:00
boykopovar c54adfb288 fix(ult): restore thread diagnostic context and fiber callback type 2026-10-21 21:55:09 +03:00
boykopovar 90e4e930ae fix(audiopropagation): define source and system diagnostic layouts 2026-10-21 21:55:09 +03:00
boykopovar f2ee3065f1 fix(videorecording): define query parameter output layout 2026-10-21 21:55:07 +03:00
boykopovar 2411c836ce fix(videorecording): type native video output mode query 2026-10-21 21:54:56 +03:00
boykopovar 2ee0131006 fix(vrsetupdialog): restore result type and error precedence 2026-10-21 21:54:55 +03:00
boykopovar b35e344585 fix(systemservice): restore browser launch signature and validation 2026-10-21 21:54:54 +03:00
boykopovar b4ac752769 fix(ssl): implement native peek reads and flag validation 2026-10-21 21:54:52 +03:00
boykopovar 31925119d5 fix(ssl): bind certificate name views to certificate lifetime 2026-10-21 21:54:31 +03:00
boykopovar d33bde8ed3 fix(ssl): restore validity and fingerprint validation order 2026-10-21 21:54:30 +03:00
boykopovar e37638505d fix(ssl): restore native pem encoding and buffer semantics 2026-10-21 21:54:29 +03:00
boykopovar 060a3b6bf9 fix(ssl): restore certificate name copy bounds and errors 2026-10-21 21:54:27 +03:00
boykopovar 83f1f63e85 fix(ssl): restore serial number truncation and errors 2026-10-21 21:54:25 +03:00
boykopovar 2ee602e66f fix(ssl): restore alpn clearing and validation 2026-10-21 21:54:24 +03:00
boykopovar 34123d4e29 fix(font): restore encoded glyph identifiers and validation 2026-10-21 21:54:23 +03:00
boykopovar 512ae7f80f fix(font): use 32-bit resolution in driver callbacks 2026-10-21 21:54:22 +03:00
boykopovar 5f980378c4 fix(font): restore device cache ownership and detach outputs 2026-10-21 21:54:22 +03:00
boykopovar f55e936f92 fix(appcontent): validate entitlement padding by sdk version 2026-10-21 21:54:21 +03:00
boykopovar 20a2488b4b fix(appcontent): restore initialization guards and validation 2026-10-21 21:54:20 +03:00
boykopovar dd5b81e1df fix(netctlapdialog): restore parameter and lifecycle validation 2026-10-21 21:54:20 +03:00
boykopovar 94e579a37a fix(netctlap): restore option and result validation order 2026-10-21 21:54:19 +03:00
boykopovar ff128a51a1 fix(logindialog): restore validation and result layout 2026-10-21 21:54:18 +03:00
boykopovar d109d51f43 fix(opus): restore decoder validation errors and precedence 2026-10-21 21:54:18 +03:00
boykopovar f414adb3d6 docs(kernel): close thread sanitizer signature debt 2026-10-21 21:54:17 +03:00
boykopovar 340429d151 fix(videorecording): restore parameter layouts and handle widths 2026-10-21 21:54:16 +03:00
boykopovar b688c4044b fix(share): validate extended capture parameters 2026-10-21 21:54:03 +03:00
boykopovar 39cb8593f3 fix(usbstoragedialog): restore parameters and result contract 2026-10-21 21:54:02 +03:00