summaryrefslogtreecommitdiff
path: root/tests/metal/nested-parameter-block-reflection.slang
diff options
context:
space:
mode:
authorJames Helferty (NVIDIA) <jhelferty@nvidia.com>2025-09-30 14:21:27 -0400
committerGitHub <noreply@github.com>2025-09-30 18:21:27 +0000
commit8086adc90b69f3199767c0617e2c429ce6b27f67 (patch)
treecbc54d5dbb3ad13329abc49f3aabf25ee199b7d6 /tests/metal/nested-parameter-block-reflection.slang
parentee5adb87050ae7c0b96056a67dddc5d48174e695 (diff)
Enable metal tests (#8446)
Enables all tests/metal/ tests that can be easily enabled. These tests were not originally designed as render tests; they are generally being enabled for pipecleaning purposes, and will not be rigorously testing the corresponding funcitonality. Where they cannot be enabled as render tests, and a metallib test wasn't already enabled, a metallib test was enabled instead (where possible). Fixes #7892
Diffstat (limited to 'tests/metal/nested-parameter-block-reflection.slang')
-rw-r--r--tests/metal/nested-parameter-block-reflection.slang27
1 files changed, 17 insertions, 10 deletions
diff --git a/tests/metal/nested-parameter-block-reflection.slang b/tests/metal/nested-parameter-block-reflection.slang
index 91c07b9c8..b3db21bae 100644
--- a/tests/metal/nested-parameter-block-reflection.slang
+++ b/tests/metal/nested-parameter-block-reflection.slang
@@ -1,25 +1,28 @@
-//TEST:REFLECTION(filecheck=CHECK): -target metal
+//TEST:REFLECTION(filecheck=METAL): -target metal
+//TEST(compute, metal):COMPARE_COMPUTE(filecheck-buffer=BUF):-metal -slang -compute -output-using-type
+//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -slang -compute -output-using-type
+// METAL: "name": "gParams",
+// METAL: "binding": {"kind": "constantBuffer", "index": 0},
-// CHECK: "name": "gParams",
-// CHECK: "binding": {"kind": "constantBuffer", "index": 0},
-
-// CHECK:"name": "pdata",
-// CHECK:"binding": {"kind": "uniform", "offset": 0, "size": 16, "elementStride": 4}
-// CHECK:"name": "tex",
+// METAL:"name": "pdata",
+// METAL:"binding": {"kind": "uniform", "offset": 0, "size": 16, "elementStride": 4}
+// METAL:"name": "tex",
// Since we will apply MetalArgumentBufferTier2, 'tex' here will just be a uniform.
// The pdata is a nested parameter block, so it will be a 64-bit device pointer which take
// 8 bytes. So the offset of `tex` will be 8 bytes.
-// CHECK:"binding": {"kind": "uniform", "offset": 8, "size": 8, "elementStride": 0}
+// METAL:"binding": {"kind": "uniform", "offset": 8, "size": 8, "elementStride": 0}
// Check that there will be only two bindings.
//
-// CHECK: "name": "output",
-// CHECK: "binding": {"kind": "constantBuffer", "index": 1},
+// METAL: "name": "output",
+// METAL: "binding": {"kind": "constantBuffer", "index": 1},
//
+
+//TEST_INPUT: set gParams = new Params{new Data{{0,0,0}}, Texture2D(size=4, content=one)}
struct Data { int3 content; }
struct Params
{
@@ -27,9 +30,13 @@ struct Params
Texture2D tex;
}
ParameterBlock<Params> gParams;
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=output
RWStructuredBuffer<float4> output;
+
[numthreads(1,1,1)]
void computeMain()
{
+ // BUF-COUNT-4: 1.000000
output[0] = gParams.tex.Load(gParams.pdata.content);
}