Skip to content

Commit

Permalink
squash merge from master and resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
fairywreath committed Jan 15, 2025
1 parent 3082473 commit 06db88e
Show file tree
Hide file tree
Showing 32 changed files with 755 additions and 162 deletions.
12 changes: 8 additions & 4 deletions cmake/SlangTarget.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,14 @@ function(slang_add_target dir type)
endif()
install(
TARGETS ${target} ${export_args}
ARCHIVE DESTINATION ${archive_subdir} ${ARGN}
LIBRARY DESTINATION ${library_subdir} ${ARGN}
RUNTIME DESTINATION ${runtime_subdir} ${ARGN}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${ARGN}
ARCHIVE DESTINATION ${archive_subdir}
${ARGN}
LIBRARY DESTINATION ${library_subdir}
${ARGN}
RUNTIME DESTINATION ${runtime_subdir}
${ARGN}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
${ARGN}
)
endmacro()

Expand Down
11 changes: 11 additions & 0 deletions docs/cuda-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,17 @@ There is potential to calculate the lane id using the [numthreads] markup in Sla
* Intrinsics which only work in pixel shaders
+ QuadXXXX intrinsics

OptiX Support
=============

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`.

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.

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`.

If OptiX headers cannot be found, compilation will fail.

Limitations
===========

Expand Down
8 changes: 4 additions & 4 deletions docs/user-guide/03-convenience-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ int rs = foo.staticMethod(a,b);

### Mutability of member function

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.
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.

```hlsl
struct Foo
Expand All @@ -159,14 +159,14 @@ struct Foo
[mutating]
void setCount(int x) { count = x; }
void setCount2(int x) { count = x; }
// This would fail to compile.
// void setCount2(int x) { count = x; }
}
void test()
{
Foo f;
f.setCount(1); // f.count is 1 after the call.
f.setCount2(2); // f.count is still 1 after the call.
f.setCount(1); // Compiles
}
```

Expand Down
2 changes: 1 addition & 1 deletion external/slang-rhi
Submodule slang-rhi updated 43 files
+17 −10 CMakeLists.txt
+0 −2 examples/surface/example-surface.cpp
+1 −1 external/vulkan-headers
+102 −53 include/slang-rhi.h
+4 −0 src/buffer-pool.h
+23 −0 src/core/platform.cpp
+3 −0 src/core/platform.h
+1 −3 src/cpu/cpu-device.cpp
+5 −1 src/cuda/cuda-acceleration-structure.cpp
+3 −1 src/cuda/cuda-acceleration-structure.h
+1 −1 src/cuda/cuda-api.h
+75 −21 src/cuda/cuda-device.cpp
+1 −1 src/cuda/cuda-device.h
+5 −0 src/cuda/cuda-pipeline.cpp
+6 −2 src/cuda/cuda-pipeline.h
+1 −3 src/d3d11/d3d11-device.cpp
+1 −0 src/d3d12/d3d12-command.cpp
+77 −20 src/d3d12/d3d12-device.cpp
+6 −1 src/d3d12/d3d12-device.h
+2 −2 src/d3d12/d3d12-shader-object-layout.cpp
+1 −1 src/debug-layer/debug-device.cpp
+1 −1 src/debug-layer/debug-device.h
+5 −9 src/metal/metal-device.cpp
+1 −13 src/metal/metal-device.h
+19 −15 src/rhi-shared.cpp
+17 −10 src/rhi-shared.h
+23 −21 src/slang-context.h
+1 −1 src/vulkan/vk-acceleration-structure.h
+5 −0 src/vulkan/vk-api.h
+3 −1 src/vulkan/vk-buffer.h
+1 −1 src/vulkan/vk-command-encoder.h
+26 −56 src/vulkan/vk-device.cpp
+6 −14 src/vulkan/vk-device.h
+9 −3 src/vulkan/vk-pipeline.h
+1 −1 src/vulkan/vk-sampler.h
+2 −2 src/vulkan/vk-shader-table.h
+1 −1 src/vulkan/vk-texture.h
+4 −9 src/wgpu/wgpu-device.cpp
+1 −1 src/wgpu/wgpu-device.h
+12 −0 tests/main.cpp
+1 −1 tests/test-ray-tracing.cpp
+6 −8 tests/test-shader-cache.cpp
+14 −27 tests/testing.cpp
Loading

0 comments on commit 06db88e

Please sign in to comment.