You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/cuda-target.md
+11
Original file line number
Diff line number
Diff line change
@@ -301,6 +301,17 @@ There is potential to calculate the lane id using the [numthreads] markup in Sla
301
301
* Intrinsics which only work in pixel shaders
302
302
+ QuadXXXX intrinsics
303
303
304
+
OptiX Support
305
+
=============
306
+
307
+
Slang supports OptiX for raytracing. To compile raytracing programs, NVRTC must have access to the `optix.h` and dependent files that are typically distributed as part of the OptiX SDK. When Slang detects the use of raytracing in source, it will define `SLANG_CUDA_ENABLE_OPTIX` when `slang-cuda-prelude.h` is included. This will in turn try to include `optix.h`.
308
+
309
+
Slang tries several mechanisms to locate `optix.h` when NVRTC is initiated. The first mechanism is to look in the include paths that are passed to Slang. If `optix.h` can be found in one of these paths, no more searching will be performed.
310
+
311
+
If this fails, the default OptiX SDK install locations are searched. On Windows this is `%{PROGRAMDATA}\NVIDIA Corporation\OptiX SDK X.X.X\include`. On Linux this is `${HOME}/NVIDIA-OptiX-SDK-X.X.X-suffix`.
312
+
313
+
If OptiX headers cannot be found, compilation will fail.
Copy file name to clipboardexpand all lines: docs/user-guide/03-convenience-features.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -149,7 +149,7 @@ int rs = foo.staticMethod(a,b);
149
149
150
150
### Mutability of member function
151
151
152
-
For GPU performance considerations, the `this` argument in a member function is immutable by default. If you modify the content in `this`argument, the modification will be discarded after the call and does not affect the input object. If you intend to define a member function that mutates the object, use `[mutating]` attribute on the member function as shown in the following example.
152
+
For GPU performance considerations, the `this` argument in a member function is immutable by default. Attempting to modify `this` will result in a compile error. If you intend to define a member function that mutates the object, use `[mutating]` attribute on the member function as shown in the following example.
153
153
154
154
```hlsl
155
155
struct Foo
@@ -159,14 +159,14 @@ struct Foo
159
159
[mutating]
160
160
void setCount(int x) { count = x; }
161
161
162
-
void setCount2(int x) { count = x; }
162
+
// This would fail to compile.
163
+
// void setCount2(int x) { count = x; }
163
164
}
164
165
165
166
void test()
166
167
{
167
168
Foo f;
168
-
f.setCount(1); // f.count is 1 after the call.
169
-
f.setCount2(2); // f.count is still 1 after the call.
0 commit comments