Skip to content

fix(shader): accept signed less-than in runtime SRT values - #3807

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
reyani-dev:fix/shader-srt-signed-less-than-uniform
Oct 11, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
reyani-dev:fix/shader-srt-signed-less-than-uniform

Conversation

@reyani-dev

Copy link
Copy Markdown
Contributor

What

#2072 taught the SRT evaluator (SrtEvaluator.cpp) to compute SLessThan32, but IsRuntimeUniformOp (SrtInstructionPredicates.cpp) still leaves it out. So the runtime validator (SrtRuntimeValidator.cpp) rejects any descriptor dword computed through a signed comparison before the evaluator ever sees it. SLessThan32 was the only op the evaluator handles that the validator neither lists nor handles itself. This adds it, the same way #2790 added SMin32.

Titles: EVO Player (PPSA99039), PS5VR (PPSA99177), Jelly5 (PPSA99505), Emby5 (PPSA99515) and Nuvio PS5 (PPSA99997) all stop here at their first draw, once #3496 gets them past sceAgcCreatePrimState (where they stop on main a11c8f7):

  what():  ShaderRecompiler::Recompile: GetImageResource dword 3 is not a valid runtime value; chain: SelectU32(SLessThan32(ReadConst(GetSrtResource, Immediate), Immediate), ReadConst(GetSrtResource, Immediate), BitwiseAnd32(ReadConst(GetSrtResource, Immediate), Immediate))

With this change on top of #3496:

  • PS5VR runs the full 60 s without an error and compiles 150 shaders.
  • The other four move on to AGC graphics: guest 2D texture descriptor has a nonzero depth or base array. That's a linear T# with its pitch in DEPTH; I have a separate branch for it and will open it after this one.

Tested

Windows 11 (26200), RTX 4070, WinLibs GCC 15.2.0 r7, Release, on main a11c8f7:

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: fix(agc): preserve hand-built user VGPR offsets #3496 (no code dependency; the titles reach this stop only after it)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

#2072 taught the SRT evaluator SLessThan32, but IsRuntimeUniformOp still
left it out, so the runtime validator rejected any descriptor dword computed
through a signed comparison before the evaluator could compute it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the build and agc_shader_memory on Linux with the PR merged onto main. The new validator check fails without the predicate change (SLessThan32 was the only op the evaluator computes that the validator neither lists nor handles), and passes with it; merging.

@adriadam10
adriadam10 merged commit 12d684f into boykopovar:main Oct 11, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants