diff options
| author | Elie Michel <eliemichel@users.noreply.github.com> | 2024-05-31 00:58:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-30 15:58:58 -0700 |
| commit | 66252cb316b26beb86b7c2b5fce2dacdcd2cf659 (patch) | |
| tree | ceab6578c5bfeed7cd0de48cf0f12e18c6769e9f /docs/user-guide | |
| parent | 1995721c2b3ad38dd58967ad4dac4480a1086b97 (diff) | |
Various issues in code snippets (#4247)
Fixed as I was testing release `v2024.1.17` (latest)
Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
Diffstat (limited to 'docs/user-guide')
| -rw-r--r-- | docs/user-guide/08-compiling.md | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/user-guide/08-compiling.md b/docs/user-guide/08-compiling.md index 5701354a6..c9771a89e 100644 --- a/docs/user-guide/08-compiling.md +++ b/docs/user-guide/08-compiling.md @@ -319,8 +319,10 @@ A Slang _global session_ uses the interface `slang::IGlobalSession` and it repre A global session is created using the function `slang::createGlobalSession()`: ```c++ +using namespace slang; + Slang::ComPtr<IGlobalSession> globalSession; -slang::createGlobalSession(globalSession.writeRef()); +createGlobalSession(globalSession.writeRef()); ``` When a global session is created, the Slang system will load its internal representation of the _standard library_ that the compiler provides to user code. @@ -413,7 +415,7 @@ For example: ```c++ TargetDesc targetDesc; -targetDesc.format = SLANG_FORMAT_SPIRV; +targetDesc.format = SLANG_SPIRV; ``` The `profile` field must be set with the ID of one of the profiles supported by the Slang compiler. @@ -463,7 +465,7 @@ of the `SessionDesc` or `TargetDesc` structures. See the [Compiler Options](#com The simplest way to load code into a session is with `ISession::loadModule()`: ```c++ -Slang::ComPtr<IModule> module = session->loadModule("MyShaders"); +IModule* module = session->loadModule("MyShaders"); ``` Executing `loadModule("MyShaders")` in host C++ code is similar to using `import MyShaders` in Slang code. |
