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

rsx: Shaders cache fixes and optimizations #9530

Merged
merged 3 commits into from Jan 2, 2021
Merged

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Jan 2, 2021

Bugfixes

  • Fixed crash whenever files are missing from the cache.
  • Fixed crash whenever files are empty.
  • Fixed crash whenever file creation/overwrite of cache files failed. (handled by fs::write_file)
  • Fixed crash whenever there are any subdirectories inside the pipelines cache directories. (didnt check whether filesystem entry is a file or directory, treated directories as files)
  • Fixed shader cache of 2 or less pipelines.

Enhancements

  • Add some optimizations in compiling shaders. (move constructors, remove redundant copies of buffers, copy elision etc)
  • Overwrite invalid shader cache files if encountered such, restoring proper cache state and allowing the cache to be usable again.
  • Make FP shader data loading lock-free.

Fixes #9529

@MSuih MSuih requested a review from kd-11 January 2, 2021 05:21
@MSuih MSuih added the RSX label Jan 2, 2021
@elad335 elad335 force-pushed the rsx-shader branch 4 times, most recently from f681380 to 35057fa Compare January 2, 2021 05:58
@elad335
Copy link
Contributor Author

elad335 commented Jan 2, 2021

Fixed more filesystem bugs, added some optimization to quickly process RSX FP shaders critical section.

@elad335 elad335 force-pushed the rsx-shader branch 8 times, most recently from d7278a9 to c3d478c Compare January 2, 2021 07:20
@elad335
Copy link
Contributor Author

elad335 commented Jan 2, 2021

Fixed potential crash on the operation of saving shaders itself.

@elad335
Copy link
Contributor Author

elad335 commented Jan 2, 2021

Fix shader cache of 2 or less pipelines, funny bug but lets fix it.

Utilities/File.h Outdated Show resolved Hide resolved
Utilities/File.h Outdated Show resolved Hide resolved
@elad335 elad335 changed the title rsx: Fix creation of corrupted shaders rsx: Fix creation of corrupted shaders and optimizations Jan 2, 2021
@elad335
Copy link
Contributor Author

elad335 commented Jan 2, 2021

  • Make fp shader data loading lock-free.

rpcs3/Emu/RSX/rsx_cache.h Outdated Show resolved Hide resolved
@elad335 elad335 changed the title rsx: Fix creation of corrupted shaders and optimizations rsx: Shaders cache fixes and optimizations Jan 2, 2021
@elad335 elad335 force-pushed the rsx-shader branch 3 times, most recently from 03e7dde to 4dc4c65 Compare January 2, 2021 18:57
Utilities/File.h Outdated Show resolved Hide resolved
* Fixed crash whenever files are missing from the cache.
* Fixed crash whenever files are empty.
* Fixed crash whenever file creation/overwrite of cache files failed. (handled by fs::write_file)
* Fixed crash whenever there are any subdirectories inside the pipelines cache directories.
* Overwrite invalid shader cache files if encountered such.
* Optimizations have been added.
Copy link
Contributor

@kd-11 kd-11 left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shader cache loading will fail if corrupted shader is encountered
4 participants