summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2024-09-17 13:51:08 -0700
committerGitHub <noreply@github.com>2024-09-17 13:51:08 -0700
commit07166468c6fa706b7f35d3422e4966f62e7b86d2 (patch)
treea468216dc2414d5a870be9ac1b4446823ee951da /tools
parent25d155937402120292cff9e6f5a31c1d45a2ecbf (diff)
Implement math intrinsics for WGSL (#5078)
* Implement math intrinsics for WGSL This commit implements math related intrinsics and a few others for WGSL. The implementation is based on the following doc, https://www.w3.org/TR/WGSL slang-test was looking for the downstream compiler for WGSL even though it is not used. This commit adds a minimal change to avoid the crash.
Diffstat (limited to 'tools')
-rw-r--r--tools/slang-test/slang-test-main.cpp5
-rw-r--r--tools/slang-test/test-context.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index b49d7be73..cac694f77 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -993,6 +993,11 @@ static PassThroughFlags _getPassThroughFlagsForTarget(SlangCompileTarget target)
return PassThroughFlag::Metal;
}
+ case SLANG_WGSL:
+ {
+ return PassThroughFlag::WGSL;
+ }
+
case SLANG_SHADER_HOST_CALLABLE:
case SLANG_HOST_HOST_CALLABLE:
diff --git a/tools/slang-test/test-context.h b/tools/slang-test/test-context.h
index 28d39b064..314ec2803 100644
--- a/tools/slang-test/test-context.h
+++ b/tools/slang-test/test-context.h
@@ -37,7 +37,8 @@ struct PassThroughFlag
Generic_C_CPP = 1 << int(SLANG_PASS_THROUGH_GENERIC_C_CPP),
NVRTC = 1 << int(SLANG_PASS_THROUGH_NVRTC),
LLVM = 1 << int(SLANG_PASS_THROUGH_LLVM),
- Metal = 1 << int(SLANG_PASS_THROUGH_METAL)
+ Metal = 1 << int(SLANG_PASS_THROUGH_METAL),
+ WGSL = 1 << int(SLANG_PASS_THROUGH_WGSL)
};
};