From 6cbe215e58eeb8edc53d71e8f315e2fb55c0eeee Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 12 Dec 2023 16:29:51 -0800 Subject: 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 --- tests/diagnostics/groupshared-local.slang | 10 ++++++++++ tests/diagnostics/int-texture-sample.slang | 7 +++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/diagnostics/groupshared-local.slang create mode 100644 tests/diagnostics/int-texture-sample.slang (limited to 'tests/diagnostics') 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 itex, SamplerState s) +{ + // CHECK: ([[# @LINE+1]]): error + itex.Sample(s, float2(0.0, 0.0)); +} -- cgit v1.2.3