summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cross-compile/rw-buffer.slang19
-rw-r--r--tests/hlsl-intrinsic/shader-execution-reordering/hit-object-assign.slang1
-rw-r--r--tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-hit.slang16
-rw-r--r--tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-miss.slang1
-rw-r--r--tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-nop.slang1
-rw-r--r--tests/hlsl-intrinsic/shader-execution-reordering/hit-object-output.slang1
-rw-r--r--tests/hlsl-intrinsic/shader-execution-reordering/hit-object-reorder-thread.slang1
-rw-r--r--tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-motion-ray.slang1
-rw-r--r--tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-ray.slang1
-rw-r--r--tests/spirv/bool-vector.slang25
10 files changed, 56 insertions, 11 deletions
diff --git a/tests/cross-compile/rw-buffer.slang b/tests/cross-compile/rw-buffer.slang
index f5246ed78..7cd04e93f 100644
--- a/tests/cross-compile/rw-buffer.slang
+++ b/tests/cross-compile/rw-buffer.slang
@@ -2,13 +2,26 @@
// Confirm that writing into a `RWBuffer` generates appropriate GLSL/SPIR-V.
-//TEST:CROSS_COMPILE: -profile ps_5_0 -entry main -target spirv-assembly
+//TEST:SIMPLE(filecheck=CHECK): -profile ps_5_0 -entry main -target spirv-assembly
+//TEST:SIMPLE(filecheck=CHECK): -profile ps_5_0 -entry main -target spirv-assembly -emit-spirv-directly
RWBuffer<float> buffer;
-
+Buffer<float> inBuffer;
float4 main(float u : U, int idx : IDX) : SV_Target
{
- buffer[idx] = u;
+ // CHECK-DAG: OpImageQuerySize
+
+ // CHECK-DAG: OpImageRead
+
+ // CHECK-DAG: OpImageFetch
+
+ // CHECK-DAG: OpImageWrite
+
+ uint s1, s2;
+ buffer.GetDimensions(s1);
+ buffer.GetDimensions(s2);
+
+ buffer[idx] = buffer[idx] + inBuffer[idx] + s1 + s2;
return u;
}
diff --git a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-assign.slang b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-assign.slang
index 49fef7a4c..89b3b6b44 100644
--- a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-assign.slang
+++ b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-assign.slang
@@ -2,6 +2,7 @@
//TEST:SIMPLE: -target dxil -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -DNV_SHADER_EXTN_SLOT=u0
//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -profile glsl_460+GL_EXT_ray_tracing -O0 -line-directive-mode none
+//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -O0 -emit-spirv-directly
//DISABLE_TEST:COMPARE_COMPUTE_EX:-slang -compute -dx12 -output-using-type -profile sm_6_5 -nvapi-slot u0
//DISABLE_TEST(compute):COMPARE_COMPUTE:-d3d12 -output-using-type -use-dxil -profile sm_6_5 -render-feature ray-query
diff --git a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-hit.slang b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-hit.slang
index 8fea9cf67..73278b6d2 100644
--- a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-hit.slang
+++ b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-hit.slang
@@ -1,8 +1,8 @@
// hit-object-make-hit.slang
//TEST:SIMPLE: -target dxil -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -DNV_SHADER_EXTN_SLOT=u0
-//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -line-directive-mode none
-
+//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -line-directive-mode none -O0
+//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -emit-spirv-directly
//DISABLE_TEST(compute):COMPARE_COMPUTE:-d3d12 -output-using-type -use-dxil -profile sm_6_5 -render-feature ray-query
//DISABLE_TEST(compute):COMPARE_COMPUTE:-vk -output-using-type -render-feature ray-query
@@ -22,12 +22,12 @@ struct SomeValues
uint calcValue(HitObject hit)
{
// SPIRV-DAG: OpHitObjectIsHitNV
- // SPIRV: OpHitObjectGetInstanceCustomIndexNV
- // SPIRV: OpHitObjectGetInstanceIdNV
- // SPIRV: OpHitObjectGetGeometryIndexNV
- // SPIRV: OpHitObjectGetPrimitiveIndexNV
- // SPIRV: OpHitObjectGetHitKindNV
- // SPIRV: OpHitObjectIsMissNV
+ // SPIRV-DAG: OpHitObjectGetInstanceCustomIndexNV
+ // SPIRV-DAG: OpHitObjectGetInstanceIdNV
+ // SPIRV-DAG: OpHitObjectGetGeometryIndexNV
+ // SPIRV-DAG: OpHitObjectGetPrimitiveIndexNV
+ // SPIRV-DAG: OpHitObjectGetHitKindNV
+ // SPIRV-DAG: OpHitObjectIsMissNV
uint r = 0;
if (hit.IsHit())
diff --git a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-miss.slang b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-miss.slang
index 9aea89573..83e665069 100644
--- a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-miss.slang
+++ b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-miss.slang
@@ -2,6 +2,7 @@
//TEST:SIMPLE: -target dxil -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -DNV_SHADER_EXTN_SLOT=u0
//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -line-directive-mode none
+//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -emit-spirv-directly
//DISABLE_TEST:COMPARE_COMPUTE_EX:-slang -compute -dx12 -output-using-type -profile sm_6_5 -nvapi-slot u0
//DISABLE_TEST(compute):COMPARE_COMPUTE:-d3d12 -output-using-type -use-dxil -profile sm_6_5 -render-feature ray-query
diff --git a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-nop.slang b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-nop.slang
index e8c88e1ad..b8b91c90b 100644
--- a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-nop.slang
+++ b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-nop.slang
@@ -2,6 +2,7 @@
//TEST:SIMPLE: -target dxil -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -DNV_SHADER_EXTN_SLOT=u0
//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -line-directive-mode none
+//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -emit-spirv-directly
//DISABLE_TEST(compute):COMPARE_COMPUTE:-d3d12 -output-using-type -use-dxil -profile sm_6_5 -render-feature ray-query
//DISABLE_TEST(compute):COMPARE_COMPUTE:-vk -output-using-type -render-feature ray-query
diff --git a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-output.slang b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-output.slang
index e06e63693..ba493ba08 100644
--- a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-output.slang
+++ b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-output.slang
@@ -5,6 +5,7 @@
//TEST:SIMPLE: -target dxil -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -DNV_SHADER_EXTN_SLOT=u0
//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -line-directive-mode none
+//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -emit-spirv-directly
//DISABLE_TEST(compute):COMPARE_COMPUTE:-d3d12 -output-using-type -use-dxil -profile sm_6_5 -render-feature ray-query
//DISABLE_TEST(compute):COMPARE_COMPUTE:-vk -output-using-type -render-feature ray-query
diff --git a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-reorder-thread.slang b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-reorder-thread.slang
index 8498b9304..0d455df72 100644
--- a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-reorder-thread.slang
+++ b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-reorder-thread.slang
@@ -2,6 +2,7 @@
//TEST:SIMPLE: -target dxil -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -DNV_SHADER_EXTN_SLOT=u0
//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -line-directive-mode none
+//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -emit-spirv-directly
//DISABLE_TEST(compute):COMPARE_COMPUTE:-d3d12 -output-using-type -use-dxil -profile sm_6_5 -render-feature ray-query
//DISABLE_TEST(compute):COMPARE_COMPUTE:-vk -output-using-type -render-feature ray-query
diff --git a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-motion-ray.slang b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-motion-ray.slang
index 4e8d52e10..4255a3936 100644
--- a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-motion-ray.slang
+++ b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-motion-ray.slang
@@ -3,6 +3,7 @@
// Motion rays not supported on HLSL impl currently
//DISABLE_TEST:SIMPLE: -target dxil -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -DNV_SHADER_EXTN_SLOT=u0
//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -line-directive-mode none
+//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -emit-spirv-directly
//DISABLE_TEST(compute):COMPARE_COMPUTE:-d3d12 -output-using-type -use-dxil -profile sm_6_6 -render-feature ray-query
//DISABLE_TEST(compute):COMPARE_COMPUTE:-vk -output-using-type -render-feature ray-query
diff --git a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-ray.slang b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-ray.slang
index c1a29d647..0f60e3cf5 100644
--- a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-ray.slang
+++ b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-ray.slang
@@ -2,6 +2,7 @@
//TEST:SIMPLE: -target dxil -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -DNV_SHADER_EXTN_SLOT=u0
//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -profile sm_6_5 -line-directive-mode none
+//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry rayGenerationMain -stage raygeneration -emit-spirv-directly
//DISABLE_TEST(compute):COMPARE_COMPUTE:-d3d12 -output-using-type -use-dxil -profile sm_6_6 -render-feature ray-query
//DISABLE_TEST(compute):COMPARE_COMPUTE:-vk -output-using-type -render-feature ray-query
diff --git a/tests/spirv/bool-vector.slang b/tests/spirv/bool-vector.slang
new file mode 100644
index 000000000..17c58a29a
--- /dev/null
+++ b/tests/spirv/bool-vector.slang
@@ -0,0 +1,25 @@
+// bool-vector.slang
+
+//TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-vk -compute -output-using-type
+
+// Test direct SPIR-V emit on arrays in uniforms.
+
+//TEST_INPUT:set resultBuffer = out ubuffer(data=[0 0 0 0], stride=4)
+RWStructuredBuffer<uint> resultBuffer;
+
+struct Data
+{
+ bool4 bv;
+};
+
+//TEST_INPUT:set dataBuffer = ubuffer(data=[0 1 1 0], stride=4)
+RWStructuredBuffer<Data> dataBuffer;
+
+[numthreads(1, 1, 1)]
+void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID)
+{
+ // CHECK: 0
+ // CHECK: 100
+ resultBuffer[0] = dataBuffer[0].bv.x;
+ resultBuffer[1] = dataBuffer[0].bv.y ? 100 : 0;
+}