fix(shader): treat all-ones texture address as null binding #400

Closed
github-bot wants to merge 1 commit from gh-pr/400/head into gh-pr/400/base
Owner

@⁠YuhiAida on GitHub · 2026-08-29 15:29 UTC · original
YuhiAida:fix/317-null-texture-sentinel → main · +5 −1 · 1 files · 1 commits · closed without merging

Summary

Neptunia ReVerse (PPSA02721) crashes at the Idea Factory logo with:

unsupported texture mip view: base=7 last=1 ... dwords=ffffffff,ffffffff,...

in ResolveTexture() (descriptors.cpp).

Root cause: the PS5 texture descriptor uses 0xFFFFFFFFFF (40-bit all-ones) as the null-texture sentinel, matching the RDNA null-descriptor convention. ShaderTextureResource::IsNull() only checked Base40() == 0, so the all-ones sentinel was treated as a real texture. Mip-chain validation then failed and the emulator aborted.

Change

IsNull() now returns true for address 0 OR 0xFFFFFFFFFF. All-ones descriptors take the existing safe null-texture path instead of crashing.

Testing

  • Platform: Linux (CachyOS, x86_64).
  • Built locally (clang + ninja, Qt6) with the patch applied.
  • Neptunia ReVerse (PPSA02721) now boots past the Idea Factory logo and runs (verified stable for 1+ minute).
  • Stock builds (unpatched) reproduce the crash at the same point with the same dwords signature.
  • Formatting verified with clang-format using the repo style (src/.clang-format).

Risk

Low. IsNull() has a single call site (ResolveTexture). The change only adds a second accepted null value to an existing early exit. Games that already worked are unaffected; games that crashed with the all-ones descriptor now take the null path.

Fixes #317

**@⁠YuhiAida** on GitHub · 2026-08-29 15:29 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/400) `YuhiAida:fix/317-null-texture-sentinel` → `main` · +5 −1 · 1 files · 1 commits · closed without merging ## Summary Neptunia ReVerse (PPSA02721) crashes at the Idea Factory logo with: unsupported texture mip view: base=7 last=1 ... dwords=ffffffff,ffffffff,... in ResolveTexture() (descriptors.cpp). Root cause: the PS5 texture descriptor uses 0xFFFFFFFFFF (40-bit all-ones) as the null-texture sentinel, matching the RDNA null-descriptor convention. ShaderTextureResource::IsNull() only checked Base40() == 0, so the all-ones sentinel was treated as a real texture. Mip-chain validation then failed and the emulator aborted. ## Change IsNull() now returns true for address 0 OR 0xFFFFFFFFFF. All-ones descriptors take the existing safe null-texture path instead of crashing. ## Testing - Platform: Linux (CachyOS, x86_64). - Built locally (clang + ninja, Qt6) with the patch applied. - Neptunia ReVerse (PPSA02721) now boots past the Idea Factory logo and runs (verified stable for 1+ minute). - Stock builds (unpatched) reproduce the crash at the same point with the same dwords signature. - Formatting verified with clang-format using the repo style (src/.clang-format). ## Risk Low. IsNull() has a single call site (ResolveTexture). The change only adds a second accepted null value to an existing early exit. Games that already worked are unaffected; games that crashed with the all-ones descriptor now take the null path. Fixes #317
The PS5 texture descriptor uses 0xFFFFFFFFFF (40-bit all-ones) as the null-texture sentinel, matching RDNA null descriptor conventions. IsNull() only checked for address 0, so games binding the all-ones sentinel (e.g. Neptunia ReVerse, PPSA02721) hit EXIT in ResolveTexture() at the Idea Factory logo.

Also treat 0xFFFFFFFFFF as null so those descriptors take the safe null-texture path instead of crashing. Fixes #317.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:19:03 +00:00
github-bot closed this pull request 2026-11-26 09:19:03 +00:00
Author
Owner

@⁠YuhiAida on GitHub · 2026-08-30 18:34 UTC · original

Hi @⁠Nmzik can you take a look at this one is very small

**@⁠YuhiAida** on GitHub · 2026-08-30 18:34 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/400#issuecomment-5470518916) Hi @⁠Nmzik can you take a look at this one is very small
Author
Owner

@⁠Nmzik on GitHub · 2026-08-30 21:05 UTC · original · edited 2026-08-30 21:06 UTC

@⁠YuhiAida this is a hack that's why i won't accept it. RDNA2 doesn't say anything about 0xFFFFFFFFFF as a null value. Some corruption happens in pm4 packets. Thanks for understanding. When I have some time, I’ll research it and push it to the PR.

**@⁠Nmzik** on GitHub · 2026-08-30 21:05 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/400#issuecomment-5471252325) · edited 2026-08-30 21:06 UTC @⁠YuhiAida this is a hack that's why i won't accept it. RDNA2 doesn't say anything about 0xFFFFFFFFFF as a null value. Some corruption happens in pm4 packets. Thanks for understanding. When I have some time, I’ll research it and push it to the PR.
Author
Owner

@⁠Nmzik on GitHub · 2026-08-31 17:04 UTC · original

Fixed

**@⁠Nmzik** on GitHub · 2026-08-31 17:04 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/400#issuecomment-5481703847) Fixed

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.