Skip to content

Commit

Permalink
update slang-rhi + fix nvrtc options (#6080)
Browse files Browse the repository at this point in the history
* update slang-rhi

* pass --dopt=on to nvrtc when enabling debug information

* fix leaks in slang-rhi

* update slang-rhi

* only use --dopt when available

---------

Co-authored-by: Yong He <[email protected]>
  • Loading branch information
skallweitNV and csyonghe authored Jan 14, 2025
1 parent 11575d2 commit d98e3f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
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
11 changes: 11 additions & 0 deletions source/compiler-core/slang-nvrtc-compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,9 @@ SlangResult NVRTCDownstreamCompiler::compile(

CommandLine cmdLine;

// --dopt option is only available in CUDA 11.7 and later
bool hasDoptOption = m_desc.version >= SemanticVersion(11, 7);

switch (options.debugInfoType)
{
case DebugInfoType::None:
Expand All @@ -952,12 +955,20 @@ SlangResult NVRTCDownstreamCompiler::compile(
default:
{
cmdLine.addArg("--device-debug");
if (hasDoptOption)
{
cmdLine.addArg("--dopt=on");
}
break;
}
case DebugInfoType::Maximal:
{
cmdLine.addArg("--device-debug");
cmdLine.addArg("--generate-line-info");
if (hasDoptOption)
{
cmdLine.addArg("--dopt=on");
}
break;
}
}
Expand Down

0 comments on commit d98e3f3

Please sign in to comment.