RSX: Use checksum with rotated inputs for shader hashing instead of FNV#16708
Conversation
|
What does this look like on arm64? Use godbolt to verify it doesn't spit out emulated stuff. Min target is cortex-a78. |
- Raises FPS from ~180 to ~200 in Ninja Gaiden
|
Pushed another commit with another 1% performance uplift: In vertex _program_compare we checked if both data streams have the same instruction mask. But if the instruction masks differed, it would've appeared in the previous iteration of the loop, where the instructions would've compared differently. So skip comparing the instruction masks. Also added a silly microptimization with is_pair_constant that saves 1 instruction per loop. |
- Eliminate some redundant checks in fragment and vertex comparison functions - Add is_any_src_constant optimization, eliminates 1 instruction per loop
|
Probably better to test in production here. |


Raises FPS from ~180 to ~200 in Ninja Gaiden Sigma
It's difficult to verify how good the hashing is myself, so please test with a lot of games, checking for any visual issues and performance improvements. I do think that simpler hashes should be sufficient when we are hashing valid opcodes instead of random data though.
Before:


After:
Note: The functions are small enough now that the compiler decided to inline them. In the before screenshot
get_vertex_program_ucode_hashis using 1.65% of cpu time. In the after screenshot, the function is inlined intovertex_program_storage_hashand the combined code is only taking up 0.56% of cpu time.NoteNote: I tested without the rotation, and none of my games had issues, but I was nervous about instructions getting swapped around, so I added the rotation step.
NoteNoteNote: This code could be trivially vectorized with AVX10 or AVX-512, with masked loads and rotates. (AVX2 doesn't have rotates!)