diff options
Diffstat (limited to 'tests/reflection')
| -rw-r--r-- | tests/reflection/cross-compile.slang | 23 | ||||
| -rw-r--r-- | tests/reflection/cross-compile.slang.expected | 48 |
2 files changed, 71 insertions, 0 deletions
diff --git a/tests/reflection/cross-compile.slang b/tests/reflection/cross-compile.slang new file mode 100644 index 000000000..12376c82a --- /dev/null +++ b/tests/reflection/cross-compile.slang @@ -0,0 +1,23 @@ +//TEST(smoke):SIMPLE:-profile glsl_fragment -target glsl -target reflection-json + +// Confirm that when targetting GLSL via cross compilation, +// we use the Vulkan layout rules instead of HLSL ones +// +// Specifically, we expect all of our top-level parameters +// to get distinct registers in the same descriptor set, +// rather than all getting register `0` because they +// occupy different names register spaces (as they would in D3D) + +Texture2D t; + +SamplerState s; + +cbuffer C +{ + float3 c; +} + +float4 main() : SV_Target +{ + return 0.0; +}
\ No newline at end of file diff --git a/tests/reflection/cross-compile.slang.expected b/tests/reflection/cross-compile.slang.expected new file mode 100644 index 000000000..3bb730f66 --- /dev/null +++ b/tests/reflection/cross-compile.slang.expected @@ -0,0 +1,48 @@ +result code = 0 +standard error = { +} +standard output = { +{ + "parameters": [ + { + "name": "t", + "binding": {"kind": "descriptorTableSlot", "index": 0}, + "type": { + "kind": "resource", + "baseShape": "texture2D" + } + }, + { + "name": "s", + "binding": {"kind": "descriptorTableSlot", "index": 1}, + "type": { + "kind": "samplerState" + } + }, + { + "name": "C", + "binding": {"kind": "descriptorTableSlot", "index": 2}, + "type": { + "kind": "constantBuffer", + "elementType": { + "kind": "struct", + "fields": [ + { + "name": "c", + "type": { + "kind": "vector", + "elementCount": 3, + "elementType": { + "kind": "scalar", + "scalarType": "float32" + } + }, + "binding": {"kind": "uniform", "offset": 0, "size": 12} + } + ] + } + } + } + ] +} +} |
