summaryrefslogtreecommitdiffstats
path: root/tools/render-test
diff options
context:
space:
mode:
authorAnders Leino <aleino@nvidia.com>2024-10-07 20:16:19 +0300
committerGitHub <noreply@github.com>2024-10-07 10:16:19 -0700
commit509409ef11e3b1abd1d7e1bfb540bc172aa1a817 (patch)
treea72725310c63b5224e76a79a4cb9b8ab9984cbc5 /tools/render-test
parentff51c21ba217fe18bf22fec7bf822cde779b265d (diff)
Add WGSL support for slang-test (#5174)
* Use the assembly description as target when disassembling I believe this is a bugfix. It seems to have worked before because up until the WGSL case, the disassembler has been the same executable as the one producing the binary to be disassembled. * Add Tint as a downstream compiler This closes issue #5104. * Add downstream compiler for Tint. * Tint is wrapped in a shared library, 'slang-tint' available from [1]. * The header file for slang-tint.dll is added in external/slang-tint-headers. * Add some boilerplate for WGSL targets. * Add an entry point test for WGSL. [1] https://github.com/shader-slang/dawn/releases/tag/slang-tint-0 * Add WGSL_SPIRV as supported target for Glslang * Add WebGPU support to slang-test This helps to address issue #5051. * Disable lots of crashing compute tests for 'wgpu' This closes issue #5051. --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tools/render-test')
-rw-r--r--tools/render-test/options.cpp1
-rw-r--r--tools/render-test/render-test-main.cpp6
2 files changed, 7 insertions, 0 deletions
diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp
index dc1850d37..07e8b0e2a 100644
--- a/tools/render-test/options.cpp
+++ b/tools/render-test/options.cpp
@@ -33,6 +33,7 @@ static rhi::DeviceType _toRenderType(Slang::RenderApiType apiType)
case RenderApiType::Metal: return rhi::DeviceType::Metal;
case RenderApiType::CPU: return rhi::DeviceType::CPU;
case RenderApiType::CUDA: return rhi::DeviceType::CUDA;
+ case RenderApiType::WebGPU: return rhi::DeviceType::WGPU;
default:
return rhi::DeviceType::Default;
}
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp
index 9e1d60155..31c24b028 100644
--- a/tools/render-test/render-test-main.cpp
+++ b/tools/render-test/render-test-main.cpp
@@ -1192,6 +1192,12 @@ static SlangResult _innerMain(Slang::StdWriters* stdWriters, SlangSession* sessi
nativeLanguage = SLANG_SOURCE_LANGUAGE_CUDA;
slangPassThrough = SLANG_PASS_THROUGH_NVRTC;
break;
+ case DeviceType::WGPU:
+ input.target = SLANG_WGSL;
+ input.profile = "";
+ nativeLanguage = SLANG_SOURCE_LANGUAGE_WGSL;
+ slangPassThrough = SLANG_PASS_THROUGH_NONE;
+ break;
default:
fprintf(stderr, "error: unexpected\n");