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

[Feature Request] Multithreaded shader compilation ingame #8767

Closed
RainbowCookie32 opened this issue Aug 23, 2020 · 3 comments
Closed

[Feature Request] Multithreaded shader compilation ingame #8767

RainbowCookie32 opened this issue Aug 23, 2020 · 3 comments
Assignees

Comments

@RainbowCookie32
Copy link
Contributor

Quick summary

Allow the usage of multiple threads to compile new shaders ingame.

Details

While shaders are compiled using all threads when launching a game, this isn't the case when new ones are found ingame.
In some games this isn't a big problem since shaders are compiled fast enough, but others, with more complex or just a larger amount of shaders, can take a fair amount of time to compile. This leads the usual compilation issues to stay around for a while (missing graphics or low performance). By allowing compilation to make use of multiple threads, it could speed up the process a fair bit, improving user experience.

This could also make the shader interpreter a more viable option. Since shaders would be compiled faster the interpreter would need to do less work, which would avoid low performance for long periods of time (especially annoying with a clean cache).

Since a fair amount of users don't have a lot of threads to spare, this should probably be implemented either as a toggle in settings, or hardcoded to only be used on high thread count CPUs (like #7887).

@kd-11
Copy link
Contributor

kd-11 commented Aug 23, 2020

This is scheduled for the shader compiler upgrade coming up in the next few weeks as well as interpreter cleanup and polishing.

@kd-11 kd-11 self-assigned this Sep 2, 2020
@kd-11 kd-11 added the In Progress This issue is actively being investigated at the moment. label Sep 22, 2020
@kd-11
Copy link
Contributor

kd-11 commented Oct 25, 2020

This is being handled in 2 steps:

  • Centralized shader compiler for each backend. All shaders should be generated from one "factory" and unless "legacy" mode is in use, the main renderer thread should never compile shaders itself.
  • Configuration to support multithreaded compiler backend and the actual thread-scaling also implemented.

@kd-11 kd-11 removed the In Progress This issue is actively being investigated at the moment. label Nov 21, 2020
@kd-11
Copy link
Contributor

kd-11 commented Nov 21, 2020

Implemented by #9312

@AniLeo AniLeo closed this as completed Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants