From 66252cb316b26beb86b7c2b5fce2dacdcd2cf659 Mon Sep 17 00:00:00 2001 From: Elie Michel Date: Fri, 31 May 2024 00:58:58 +0200 Subject: 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> --- docs/user-guide/08-compiling.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs/user-guide/08-compiling.md') 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 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 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. -- cgit v1.2.3