summaryrefslogtreecommitdiff
path: root/source/slang/core.meta.slang
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2024-06-10 13:29:02 -0700
committerGitHub <noreply@github.com>2024-06-10 13:29:02 -0700
commit72016f9201e4d7820f62e7ef78cee98ed1fc4da0 (patch)
treeb8d78b954791afd8ad409074cfd6cca96a6d6c79 /source/slang/core.meta.slang
parent712ce653d4c3d7284dd71389f31540d0da7f144e (diff)
Partial implementation of static_assert (#4294)
* Error out for types not supported by texture sample functions This commit prints errors with a new keyword, `static_assert`, when the given texture type is not supported for the target. * Moving the check to linkAndOptimizeIR after specialization is done * Remove unnecessary change * Adding test * Remove kIROp_StaticAssert once processed * Do not remove StaticAssert because it is needed for the next specialization * Remove after iteration of child is done --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/core.meta.slang')
-rw-r--r--source/slang/core.meta.slang3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang
index 272e95c85..fcb08984b 100644
--- a/source/slang/core.meta.slang
+++ b/source/slang/core.meta.slang
@@ -244,6 +244,9 @@ void __requirePrelude(constexpr String preludeText);
__intrinsic_op($(kIROp_RequireGLSLExtension))
void __requireGLSLExtension(constexpr String preludeText);
+__intrinsic_op($(kIROp_StaticAssert))
+void static_assert(constexpr bool condition, NativeString errorMessage);
+
/// Interface to denote types as differentiable.
/// Allows for user-specified differential types as
/// well as automatic generation, for when the associated type