Skip to content

V_CMP_U64 semantics - #4561

Open
w1naenator wants to merge 38 commits into
shadps4-emu:mainfrom
w1naenator:knack2-menu-fixes
Open

V_CMP_U64 semantics#4561
w1naenator wants to merge 38 commits into
shadps4-emu:mainfrom
w1naenator:knack2-menu-fixes

Conversation

@w1naenator

Copy link
Copy Markdown
Contributor

Make Knack 2 menu fully operational.

@w1naenator

Copy link
Copy Markdown
Contributor Author
CUSA07670_20260612_103459_611_game_000000 CUSA07670_20260612_103508_455_game_000001 CUSA07670_20260612_103602_671_game_000002

@georgemoralis

Copy link
Copy Markdown
Collaborator

one more time cmp , @raphaelthegreat should check that :D

@raphaelthegreat

Copy link
Copy Markdown
Contributor

I don't think this is correct, CMP_U64 is most often a thread-bit compare that will not work with U64 src. Did you confirm this is what the shader uses?

@w1naenator

Copy link
Copy Markdown
Contributor Author

I don't think this is correct, CMP_U64 is most often a thread-bit compare that will not work with U64 src. Did you confirm this is what the shader uses?

AMD GCN3 ISA: https://docs.amd.com/v/u/en-US/gcn3-instruction-set-architecture
Vulkan subgroup docs: https://docs.vulkan.org/guide/latest/subgroups.html

AMD's GCN3 ISA documents V_CMP_U64 as a VOPC compare on unsigned 64-bit integers (PDF p. 228 / printed p. 12-122), and section Vector Compares: VCC and VCCZ defines vector compares as per-lane writes to VCC[n] = EXEC[n] & test (PDF p. 32 / printed p. 3-8). The ISA also notes that VCC physically resides in the SGPR register file and counts against SGPR sourcing limits (PDF p. 32), which explains why thread-bit idioms can happen, but does not make V_CMP_U64 itself a special thread-bit compare instruction.

So for the ISA semantics, the generic U64 compare lowering is justified. However, your question about the specific Knack 2 shader is fair: I do not yet have shader-specific proof from a dump/disassembly showing whether this instance is using a full 64-bit compare or a VCC/thread-bit idiom.

@Parotaku

Parotaku commented Jun 12, 2026

Copy link
Copy Markdown

Once again, fixing V_CMP_U64 helps NO STRAIGHT ROADS too, showing videos & going further...

image

@tochnonechelovek

Copy link
Copy Markdown

KNACK™ 2 Demo - CUSA09687 goes ingame, just doesn't show graphics properly. Menus work as intended.
CUSA09687.log
изображение

RESIDENT EVIL 3 "Raccoon City Demo" - CUSA17925 also requires V_CMP_U64, but still crashes at launch, now on this error:
[Debug] <Critical> (GameThread) signals.cpp:70 SignalHandler: Unhandled Exception code 0xc0000005 at 0x802ad2a5b
CUSA17925.log

@gandalfthewhite19890404

Copy link
Copy Markdown

[Debug] <Critical> (GameThread) signals.cpp:70 SignalHandler... means nothing, honestly

@w1naenator

Copy link
Copy Markdown
Contributor Author

KNACK™ 2 Demo - CUSA09687 goes ingame, just doesn't show graphics properly. Menus work as intended. CUSA09687.log изображение

RESIDENT EVIL 3 "Raccoon City Demo" - CUSA17925 also requires V_CMP_U64, but still crashes at launch, now on this error: [Debug] <Critical> (GameThread) signals.cpp:70 SignalHandler: Unhandled Exception code 0xc0000005 at 0x802ad2a5b CUSA17925.log

Good, I'll check!

@Parotaku

Copy link
Copy Markdown

Resident Evil 4 (remake) also required V_CMP_U64 so now it crashes with:
[Debug] (shadPS4:GpuCommandProcessor) resource_tracking_pass.cpp:411 FindSharpSources: Unreachable code!
Bindless sharp access detected pc=0x14b8

shad_log.txt

@Parotaku

Copy link
Copy Markdown

Same error with Street Fighter 6 now:

shad_log.zip

@w1naenator

Copy link
Copy Markdown
Contributor Author

Same error with Street Fighter 6 now:

shad_log.zip

Did it work on main branch binary?

@Parotaku

Parotaku commented Jun 14, 2026

Copy link
Copy Markdown

No, I meant both crash on V_CMP_U64 error on Main (that's the reason I tested them on this PR), so I guess that a progress: now they crash at another type of error... ^^

@w1naenator

Copy link
Copy Markdown
Contributor Author

No, I meant both crash on V_CMP_U64 error on Main (that's the reason I tested them on this PR), so I guess that a progress: now they crash at another type of error... ^^

I agree!

@w1naenator

Copy link
Copy Markdown
Contributor Author

@Parotaku I do not have RE3 Demo, can you please test with this?
https://github.com/w1naenator/shadPS4/actions/runs/28056599939

@tochnonechelovek

Copy link
Copy Markdown

@Parotaku I do not have RE3 Demo, can you please test with this? https://github.com/w1naenator/shadPS4/actions/runs/28056599939

Not sure if Parotaku has it, but my tests aren't different.
CUSA17925.log

@Parotaku

Copy link
Copy Markdown

@Parotaku I do not have RE3 Demo, can you please test with this? https://github.com/w1naenator/shadPS4/actions/runs/28056599939

Not sure if Parotaku has it, but my tests aren't different. CUSA17925.log

Yeah, sorry... I don't have RE3 demo... but I tested with RE4 remake & Street Fighter 6 and there are no changes... :-/
shad_log.txt
shad_log.zip

@Hog185

Hog185 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor
CUSA01127_20260622_122005_097_game_000000 no diff in PT CUSA01127_20260624_111949_823_game_000001 CUSA01127_20260624_111952_589_game_000002 CUSA01127_20260624_111237_420_game_000000 CUSA01127_20260624_111938_656_game_000000

@Randomuser8219

Copy link
Copy Markdown
Contributor
image KNACK 2 still works with the rebase.

@Parotaku

Parotaku commented Jul 2, 2026

Copy link
Copy Markdown

With your update from Main, now No Straight Roads goes ingame everytime...
image

@Parotaku

Copy link
Copy Markdown

I don't know if this is still WIP, but now would be a good time to update it from Main (because of all the fixes for UE & others...). It might help new games go further?

@w1naenator

Copy link
Copy Markdown
Contributor Author

I don't know if this is still WIP, but now would be a good time to update it from Main (because of all the fixes for UE & others...). It might help new games go further?

Yes, a lot of games need this.

@tochnonechelovek

tochnonechelovek commented Jul 25, 2026

Copy link
Copy Markdown

Tested on the latest version of this PR, it's the same as the previous report.

RESIDENT EVIL 3 "Raccoon City Demo":
CUSA17925.log
[Debug] <Critical> (GameThread) signals.cpp:70 SignalHandler: Unhandled Exception code 0xc0000005 at 0x802ad2a5b

KNACK™ 2 Demo:
CUSA09687.log

@w1naenator

Copy link
Copy Markdown
Contributor Author

Tested on the latest version of this PR, it's the same as the previous report.

RESIDENT EVIL 3 "Raccoon City Demo": CUSA17925.log [Debug] <Critical> (GameThread) signals.cpp:70 SignalHandler: Unhandled Exception code 0xc0000005 at 0x802ad2a5b

KNACK™ 2 Demo: CUSA09687.log

I will check later.
I’m currently working on memory tracking. It seems to fix the vertex explosions in Ratchet & Clank on Intel 10th-generation CPUs and newer.

@georgemoralis

Copy link
Copy Markdown
Collaborator

rebased

@Gih-pt

Gih-pt commented Aug 7, 2026

Copy link
Copy Markdown

This should also improve Resident Evil Village, Resident Evil Resistance, and STAR WARS Jedi: Fallen Order.

shadps4-compatibility/shadps4-game-compatibility#2597
shadps4-compatibility/shadps4-game-compatibility#314
shadps4-compatibility/shadps4-game-compatibility#1303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants