summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/shader-resource-return-type-multi.slang11
-rw-r--r--tests/shader-resource-return-type.slang11
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/shader-resource-return-type-multi.slang b/tests/shader-resource-return-type-multi.slang
new file mode 100644
index 000000000..847412549
--- /dev/null
+++ b/tests/shader-resource-return-type-multi.slang
@@ -0,0 +1,11 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -stage compute -entry testRWTexture
+
+// Test multiple resource types that should be rejected
+
+//CHECK: error 38011: entry point 'testRWTexture' cannot return type 'RWTexture2D<float>' that contains resource types
+[shader("compute")]
+RWTexture2D<float> testRWTexture(uint3 threadID : SV_DispatchThreadID)
+{
+ RWTexture2D<float> tex;
+ return tex;
+}
diff --git a/tests/shader-resource-return-type.slang b/tests/shader-resource-return-type.slang
new file mode 100644
index 000000000..d053f8173
--- /dev/null
+++ b/tests/shader-resource-return-type.slang
@@ -0,0 +1,11 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -stage compute -entry test1
+
+// Test that entry points cannot return resource types
+
+//CHECK: error 38011: entry point 'test1' cannot return type 'Texture2D<int>' that contains resource types
+[shader("compute")]
+Texture2D<int> test1(uint3 threadID : SV_DispatchThreadID)
+{
+ Texture2D<int> tex;
+ return tex;
+}