diff options
Diffstat (limited to 'docs/user-guide/08-compiling.md')
| -rw-r--r-- | docs/user-guide/08-compiling.md | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/user-guide/08-compiling.md b/docs/user-guide/08-compiling.md index 147bc8144..c600b8cbb 100644 --- a/docs/user-guide/08-compiling.md +++ b/docs/user-guide/08-compiling.md @@ -589,12 +589,16 @@ A global session is created using the function `slang::createGlobalSession()`: using namespace slang; Slang::ComPtr<IGlobalSession> globalSession; -createGlobalSession(globalSession.writeRef()); +SlangGlobalSessionDesc desc = {}; +createGlobalSession(&desc, globalSession.writeRef()); ``` When a global session is created, the Slang system will load its internal representation of the _core module_ that the compiler provides to user code. The core module can take a significant amount of time to load, so applications are advised to use a single global session if possible, rather than creating and then disposing of one for each compile. +If you want to enable GLSL compatibility mode, you need to set `SlangGlobalSessionDesc::enableGLSL` to `true` when calling `createGlobalSession()`. This will load the necessary GLSL intrinsic module +for compiling GLSL code. Without this setting, compiling GLSL code will result in an error. + > #### Note #### > Currently, the global session type is *not* thread-safe. > Applications that wish to compile on multiple threads will need to ensure that each concurrent thread compiles with a distinct global session. @@ -874,6 +878,7 @@ The only functions which are currently thread safe are ```C++ SlangSession* spCreateSession(const char* deprecated); SlangResult slang_createGlobalSession(SlangInt apiVersion, slang::IGlobalSession** outGlobalSession); +SlangResult slang_createGlobalSession2(const SlangGlobalSessionDesc* desc, slang::IGlobalSession** outGlobalSession); SlangResult slang_createGlobalSessionWithoutCoreModule(SlangInt apiVersion, slang::IGlobalSession** outGlobalSession); ISlangBlob* slang_getEmbeddedCoreModule(); SlangResult slang::createGlobalSession(slang::IGlobalSession** outGlobalSession); |
