summaryrefslogtreecommitdiffstats
path: root/tests/metal/vector-argument-buffer-layout.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/metal/vector-argument-buffer-layout.slang')
-rw-r--r--tests/metal/vector-argument-buffer-layout.slang23
1 files changed, 14 insertions, 9 deletions
diff --git a/tests/metal/vector-argument-buffer-layout.slang b/tests/metal/vector-argument-buffer-layout.slang
index 5e45e3a01..dcc89be7c 100644
--- a/tests/metal/vector-argument-buffer-layout.slang
+++ b/tests/metal/vector-argument-buffer-layout.slang
@@ -1,17 +1,19 @@
-//TEST:REFLECTION(filecheck=CHECK): -target metal
+//TEST:REFLECTION(filecheck=METAL): -target metal
+//TEST(compute, metal):COMPARE_COMPUTE(filecheck-buffer=BUF):-metal -compute -entry computeMain -output-using-type
+//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -output-using-type
-//CHECK: "name": "o",
-//CHECK: "binding": {"kind": "constantBuffer", "index": 0},
+//METAL: "name": "o",
+//METAL: "binding": {"kind": "constantBuffer", "index": 0},
-//CHECK: "name": "gParams",
-//CHECK: "binding": {"kind": "constantBuffer", "index": 1},
+//METAL: "name": "gParams",
+//METAL: "binding": {"kind": "constantBuffer", "index": 1},
-//CHECK: "dir"
-//CHECK: "binding": {"kind": "uniform", "offset": 0, "size": 16, "elementStride": 4}
-//CHECK: "color"
-//CHECK: "binding": {"kind": "uniform", "offset": 16, "size": 16, "elementStride": 4}
+//METAL: "dir"
+//METAL: "binding": {"kind": "uniform", "offset": 0, "size": 16, "elementStride": 4}
+//METAL: "color"
+//METAL: "binding": {"kind": "uniform", "offset": 16, "size": 16, "elementStride": 4}
struct Params
{
@@ -19,11 +21,14 @@ struct Params
float4 color;
}
+//TEST_INPUT: ubuffer(data=[0.0], stride=4):out,name o
RWStructuredBuffer<float> o;
+//TEST_INPUT: set gParams = new Params{{3.0, 4.0, 5.0}, {6.0, 7.0 ,8.0, 9.0}}
ParameterBlock<Params> gParams;
[numthreads(1,1,1)]
void computeMain()
{
+ // BUF: 3.0
o[0] = gParams.dir.x;
}