Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shader_recompiler: Improvements to buffer addressing implementation. #2123

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

squidbus
Copy link
Collaborator

@squidbus squidbus commented Jan 11, 2025

Adds a new common buffer addressing implementation, accounting for all of the different components:

  • Fixes handling of index_stride and element_size which need to be converted into their actual value from bit field.
  • Texture buffers still have some limitations, asserted on specially before calling this new function.
  • Parameters from sharp needed for swizzle_enable added to specialization.

And misc related improvements:

  • Add multiply by 1 case to constant propagation pass to help optimize new buffer address logic.
  • Clean up buffer load/store instructions to pass through all the MUBUF/MTBUF flags and let the tracking pass take care of what is and isn't supported in one place.

Fixes some shaders in CUSA05637 that use swizzle addressing.

@rafael-57
Copy link
Contributor

rafael-57 commented Jan 11, 2025

Since I saw swizzle changes I tested for #1858, no changes for that issue.
image

@squidbus
Copy link
Collaborator Author

Since I saw swizzle changes I tested for #1858, no changes for that issue.

Different kind of swizzle.

@diegolix29
Copy link

diegolix29 commented Jan 11, 2025

im having like 3 fps less on dlc BB with this pr but dont now it maybe load to pc but tested on main and the fps where more by 3-4 i know is not a big difference but its the only thing i noticed changed with this pr on bb

i9 intel 12900k
nvidia 3080 12gb
64 Ram
windows 10

@squidbus
Copy link
Collaborator Author

im having like 3 fps less on dlc BB with this pr but dont now it maybe load to pc but tested on main and the fps where more by 3-4 i know is not a big difference but its the only thing i noticed changed with this pr on bb

If I had to guess any differences to performance should be either down to shader recompiles because of the changes which would be temporary as your GPU driver shader cache updates, or due to specialization fixes making more variants which is unavoidable for correctness.

@squidbus
Copy link
Collaborator Author

I removed the uniform size fix for specialization for now as I'm still having some issues with excessive shader recompiles from buffer sizes, now it's just the buffer addressing changes.

@meijjaa
Copy link

meijjaa commented Jan 13, 2025

Hi Squidbus, thanks for the hard word so far!
I was just testing with CUSA03745 v1.03 and noticed the
"Unsupported texture buffer address mode." Assert due to swizzle_enable == 1. Is this something you'll be working on? Or can I help in any way? I have setup a debug environment for easy testing.

@squidbus
Copy link
Collaborator Author

Hi Squidbus, thanks for the hard word so far! I was just testing with CUSA03745 v1.03 and noticed the "Unsupported texture buffer address mode." Assert due to swizzle_enable == 1. Is this something you'll be working on? Or can I help in any way? I have setup a debug environment for easy testing.

It's going to require a lot more work to implement the rest of addressing for texture buffers, since we can't offset them at the sub-texel level.

@squidbus squidbus force-pushed the buffers branch 2 times, most recently from 87050a9 to 44f1c6b Compare January 14, 2025 07:24
@ArbestRi02
Copy link

we should rebase again
the hedgehog engine 2 post processing fix has been added to main

@squidbus
Copy link
Collaborator Author

we should rebase again

Sure, done

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.

5 participants