Skip to content

RSX: Use AVX-512-ICL in vertex shader hashing and comparisons - #16780

Merged
elad335 merged 2 commits into
RPCS3:masterfrom
Whatcookie:LTO
Mar 2, 2025
Merged

elad335 merged 2 commits into
RPCS3:masterfrom
Whatcookie:LTO

Conversation

@Whatcookie

Copy link
Copy Markdown
Member
  • Code is about 4 times as fast on my zen4 machine
  • Should be twice as fast on zen5 machines with full width AVX-512
  • Code operates without a separate remainder-masking loop, since the instruction_mask bits can be used to avoid loading out of bounds data.

This code uses vpermt2b, and needs full length AVX-512 to function, so this won't work for skylake-x nor avx10-256.

Before: (194 avg)
image
After: (204 avg)
image

Before:
image
After:
image

image

@Whatcookie

Copy link
Copy Markdown
Member Author

Pushed another commit which resolves an issue where the compiler was loading a value from memory every loop. Somehow the compiler inexplicably failed to calculate the loop conditions before the loop, and just placing them in a "length" variable resolves this.

Adds another few fps:
image

Xcedf pushed a commit to Xcedf/rpcs3 that referenced this pull request Feb 28, 2025
@cipherxof

Copy link
Copy Markdown
Contributor

Comically faster in some situations. Haven't noticed much of a difference in actual rendered scenes for MGS4/MGO2, even in RSX bottlenecked areas.

Before:
Screenshot From 2025-02-28 15-07-05

After:
Screenshot From 2025-02-28 14-20-36

Before:
Screenshot From 2025-02-28 15-07-48

After:
Screenshot From 2025-02-28 14-22-40

Comment thread rpcs3/Emu/RSX/Program/ProgramStateCache.cpp Outdated
Comment thread rpcs3/Emu/RSX/Program/ProgramStateCache.cpp Outdated

@kd-11 kd-11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't prove or disprove the correctness of the avx512 stuff without an avx512 cpu and we have no unit tests, so I guess just yolo and bulk-revert if a regression occurs.

@Jonathan44062

Copy link
Copy Markdown

7 FPS Extra in Sonic Unleashed
Master
Captura de pantalla 2025-03-01 133014

PR
Captura de pantalla 2025-03-01 133207

…rtex_program_compare

- Code is about 4 times as fast on my zen4 machine
- Should be twice as fast on zen5 machines with full width AVX-512
@elad335

elad335 commented Mar 3, 2025 •

Copy link
Copy Markdown
Contributor

@cipherxof Can you disable locally this pr and apply #16797 and test it? it applies a similar improvement to non-avx512 users as well.

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

Labels

CPU Optimization Optimizes existing code RSX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants