diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/reflection/mix-explicit-and-implicit-spaces.slang | 18 | ||||
| -rw-r--r-- | tests/reflection/mix-explicit-and-implicit-spaces.slang.expected | 157 |
2 files changed, 175 insertions, 0 deletions
diff --git a/tests/reflection/mix-explicit-and-implicit-spaces.slang b/tests/reflection/mix-explicit-and-implicit-spaces.slang new file mode 100644 index 000000000..52dd4321e --- /dev/null +++ b/tests/reflection/mix-explicit-and-implicit-spaces.slang @@ -0,0 +1,18 @@ +// mix-explicit-and-implicit-spaces.slang +//TEST:REFLECTION:-profile cs_5_1 -target hlsl + +// Ensure that correct layout/reflection is computed +// when mixing implicit and explicit spaces for +// parameter blocks. + +struct A { float x; } +ParameterBlock<A> a : register(space0); + +struct B { float y; } +ParameterBlock<B> b : register(space1); + +struct C { float z; } +ParameterBlock<C> c; + +void main() +{} diff --git a/tests/reflection/mix-explicit-and-implicit-spaces.slang.expected b/tests/reflection/mix-explicit-and-implicit-spaces.slang.expected new file mode 100644 index 000000000..2e4ead342 --- /dev/null +++ b/tests/reflection/mix-explicit-and-implicit-spaces.slang.expected @@ -0,0 +1,157 @@ +result code = 0 +standard error = { +} +standard output = { +{ + "parameters": [ + { + "name": "a", + "bindings": [ + {"kind": "constantBuffer", "index": 0, "count": 0}, + {"kind": "registerSpace", "index": 0} + ], + "type": { + "kind": "parameterBlock", + "elementType": { + "kind": "struct", + "name": "A", + "fields": [ + { + "name": "x", + "type": { + "kind": "scalar", + "scalarType": "float32" + }, + "binding": {"kind": "uniform", "offset": 0, "size": 4} + } + ] + }, + "containerVarLayout": { + "bindings": [ + {"kind": "constantBuffer", "index": 0}, + {"kind": "registerSpace", "index": 0} + ] + }, + "elementVarLayout": { + "type": { + "kind": "struct", + "name": "A", + "fields": [ + { + "name": "x", + "type": { + "kind": "scalar", + "scalarType": "float32" + }, + "binding": {"kind": "uniform", "offset": 0, "size": 4} + } + ] + }, + "binding": {"kind": "uniform", "offset": 0, "size": 4} + } + } + }, + { + "name": "b", + "bindings": [ + {"kind": "constantBuffer", "index": 0, "count": 0}, + {"kind": "registerSpace", "index": 1} + ], + "type": { + "kind": "parameterBlock", + "elementType": { + "kind": "struct", + "name": "B", + "fields": [ + { + "name": "y", + "type": { + "kind": "scalar", + "scalarType": "float32" + }, + "binding": {"kind": "uniform", "offset": 0, "size": 4} + } + ] + }, + "containerVarLayout": { + "bindings": [ + {"kind": "constantBuffer", "index": 0}, + {"kind": "registerSpace", "index": 0} + ] + }, + "elementVarLayout": { + "type": { + "kind": "struct", + "name": "B", + "fields": [ + { + "name": "y", + "type": { + "kind": "scalar", + "scalarType": "float32" + }, + "binding": {"kind": "uniform", "offset": 0, "size": 4} + } + ] + }, + "binding": {"kind": "uniform", "offset": 0, "size": 4} + } + } + }, + { + "name": "c", + "bindings": [ + {"kind": "constantBuffer", "index": 0, "count": 0}, + {"kind": "registerSpace", "index": 2} + ], + "type": { + "kind": "parameterBlock", + "elementType": { + "kind": "struct", + "name": "C", + "fields": [ + { + "name": "z", + "type": { + "kind": "scalar", + "scalarType": "float32" + }, + "binding": {"kind": "uniform", "offset": 0, "size": 4} + } + ] + }, + "containerVarLayout": { + "bindings": [ + {"kind": "constantBuffer", "index": 0}, + {"kind": "registerSpace", "index": 0} + ] + }, + "elementVarLayout": { + "type": { + "kind": "struct", + "name": "C", + "fields": [ + { + "name": "z", + "type": { + "kind": "scalar", + "scalarType": "float32" + }, + "binding": {"kind": "uniform", "offset": 0, "size": 4} + } + ] + }, + "binding": {"kind": "uniform", "offset": 0, "size": 4} + } + } + } + ], + "entryPoints": [ + { + "name": "main", + "stage:": "compute", + "threadGroupSize": [1, 1, 1] + } + ] +} +} |
