summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-12-12 16:29:51 -0800
committerGitHub <noreply@github.com>2023-12-12 16:29:51 -0800
commit6cbe215e58eeb8edc53d71e8f315e2fb55c0eeee (patch)
treece82de695b51ba7882253dec74fc675dcaf07a9e /tests/diagnostics
parent92f21de580e16a37600f082c0968913111f5ef91 (diff)
Define `Texture::Sample` for float element types only. (#3403)
* Define `Texture::Sample` for float element types only. * Fixes #490. * Fix checking of groupshared. * Add test. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/diagnostics')
-rw-r--r--tests/diagnostics/groupshared-local.slang10
-rw-r--r--tests/diagnostics/int-texture-sample.slang7
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/diagnostics/groupshared-local.slang b/tests/diagnostics/groupshared-local.slang
new file mode 100644
index 000000000..02198320e
--- /dev/null
+++ b/tests/diagnostics/groupshared-local.slang
@@ -0,0 +1,10 @@
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
+
+// CHECK-NOT: ([[# @LINE+1]]): error 31201
+groupshared int b;
+
+int test()
+{
+ // CHECK: ([[# @LINE+1]]): error 31201
+ groupshared int a;
+}
diff --git a/tests/diagnostics/int-texture-sample.slang b/tests/diagnostics/int-texture-sample.slang
new file mode 100644
index 000000000..696e13a60
--- /dev/null
+++ b/tests/diagnostics/int-texture-sample.slang
@@ -0,0 +1,7 @@
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
+
+void test(Texture2D<int4> itex, SamplerState s)
+{
+ // CHECK: ([[# @LINE+1]]): error
+ itex.Sample(s, float2(0.0, 0.0));
+}