diff options
| author | kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> | 2025-06-10 12:35:01 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-10 10:35:01 -0700 |
| commit | d93c71d53f969e5cd3911fbada0e566cd1887ec1 (patch) | |
| tree | 46c5923e8a0af79af9875c2bd47038f86abebbd8 /tests/metal/nested-parameter-block-reflection.slang | |
| parent | 3fa382505271834514d47612efee8e51a06204c5 (diff) | |
Fix reflection to json issue (#7379)
Apply argument buffer tier2 rule when using parameter block for Metal target.
Close #6803.
Diffstat (limited to 'tests/metal/nested-parameter-block-reflection.slang')
| -rw-r--r-- | tests/metal/nested-parameter-block-reflection.slang | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/metal/nested-parameter-block-reflection.slang b/tests/metal/nested-parameter-block-reflection.slang index 8282f5573..a294755da 100644 --- a/tests/metal/nested-parameter-block-reflection.slang +++ b/tests/metal/nested-parameter-block-reflection.slang @@ -1,10 +1,27 @@ //TEST:REFLECTION(filecheck=CHECK): -target metal + + +// CHECK: "name": "gParams", +// CHECK: "binding": {"kind": "constantBuffer", "index": 0}, + +// CHECK:"name": "pdata", +// CHECK:"binding": {"kind": "uniform", "offset": 0, "size": 16} // CHECK:"name": "tex", -// CHECK:"binding": {"kind": "metalArgumentBufferElement", "index": 1} +// 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} + + +// Check that there will be only two bindings. +// +// CHECK: "name": "output", +// CHECK: "binding": {"kind": "constantBuffer", "index": 1}, +// struct Data { int3 content; } -struct Params +struct Params { ParameterBlock<Data> pdata; Texture2D tex; @@ -15,4 +32,4 @@ RWStructuredBuffer<float4> output; void computeMain() { output[0] = gParams.tex.Load(gParams.pdata.content); -}
\ No newline at end of file +} |
