Multithreaded shader compilation #6132
Unanswered
daniilvinn
asked this question in
Q&A
Replies: 1 comment
-
At the moment we don't support calling global session functions concurrently, so you will still need to create one global session per thread, or use a pool of global sessions and ensure only one thread is using a global session at a time. We would like to improve this situation by allowing sharing a single global session, and allow working on different ISessions concurrently as the next step. However we don't have a timeline for this improvement. However, if anyone feel like contributing a patch to make the API more multi-threading friendly, we are happy to share more technical details and work together with you to make it happen sooner. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone! I am switching from
shaderc
toSlang
and want to know if it is possible to make a multithreaded compilation of multiple independent.slang
files (though they may share some other .slang file, sayCommon.slang
) using a single global session?On my machine, it takes from 0.18s to 0.5s to init a global session, and as I understand, the creation of a global session basically means loading a Slang.dll and other dynamic libraries.
Since global session init takes quite a lot of time, I wouldn't want to create a global session per shader, nor would I want to create a global session per thread (if it's even possible).
If I can safely reuse a single global session for concurrent shader compilation on multiple threads, do I need to create a local session per shader?
Beta Was this translation helpful? Give feedback.
All reactions