diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bindings/glsl-parameter-blocks.slang.glsl | 6 | ||||
| -rw-r--r-- | tests/reflection/parameter-block.slang | 19 | ||||
| -rw-r--r-- | tests/reflection/parameter-block.slang.expected | 52 | ||||
| -rw-r--r-- | tests/reflection/thread-group-size.comp.expected | 5 | ||||
| -rw-r--r-- | tests/reflection/thread-group-size.hlsl.expected | 3 |
5 files changed, 75 insertions, 10 deletions
diff --git a/tests/bindings/glsl-parameter-blocks.slang.glsl b/tests/bindings/glsl-parameter-blocks.slang.glsl index 5094debb1..9956800f1 100644 --- a/tests/bindings/glsl-parameter-blocks.slang.glsl +++ b/tests/bindings/glsl-parameter-blocks.slang.glsl @@ -6,16 +6,16 @@ struct Test vec4 a; }; -layout(binding = 0) +layout(binding = 0, set = 1) uniform gTest_S1 { Test gTest; }; -layout(binding = 1) +layout(binding = 1, set = 1) uniform texture2D gTest_t; -layout(binding = 2) +layout(binding = 2, set = 1) uniform sampler gTest_s; vec4 main_(vec2 uv) diff --git a/tests/reflection/parameter-block.slang b/tests/reflection/parameter-block.slang new file mode 100644 index 000000000..c20337480 --- /dev/null +++ b/tests/reflection/parameter-block.slang @@ -0,0 +1,19 @@ +//TEST:REFLECTION:-profile glsl_fragment -target glsl + +// Confirm that we do parameter binding correctly +// when we have both a parameter block *and* user-defined +// resource parameters that both need automatic +// binding allocation. + +struct Helper +{ + Texture2D t; + SamplerState s; +}; + +ParameterBlock<Helper> a; + +Texture2D b; + +float4 main() : SV_target +{ return 0.0; } diff --git a/tests/reflection/parameter-block.slang.expected b/tests/reflection/parameter-block.slang.expected new file mode 100644 index 000000000..bc04d79ed --- /dev/null +++ b/tests/reflection/parameter-block.slang.expected @@ -0,0 +1,52 @@ +result code = 0 +standard error = { +} +standard output = { +{ + "parameters": [ + { + "name": "a", + "binding": {"kind": "registerSpace", "index": 1}, + "type": { + "kind": "parameterBlock", + "elementType": { + "kind": "struct", + "name": "Helper", + "fields": [ + { + "name": "t", + "type": { + "kind": "resource", + "baseShape": "texture2D" + }, + "binding": {"kind": "descriptorTableSlot", "index": 0} + }, + { + "name": "s", + "type": { + "kind": "samplerState" + }, + "binding": {"kind": "descriptorTableSlot", "index": 1} + } + ] + } + } + }, + { + "name": "b", + "binding": {"kind": "descriptorTableSlot", "index": 0}, + "type": { + "kind": "resource", + "baseShape": "texture2D" + } + }, + { + "name": "SLANG_hack_samplerForTexelFetch", + "binding": {"kind": "descriptorTableSlot", "index": 1}, + "type": { + "kind": "samplerState" + } + } + ] +} +} diff --git a/tests/reflection/thread-group-size.comp.expected b/tests/reflection/thread-group-size.comp.expected index ea7e97851..facd52cc0 100644 --- a/tests/reflection/thread-group-size.comp.expected +++ b/tests/reflection/thread-group-size.comp.expected @@ -21,10 +21,7 @@ standard output = { "kind": "scalar", "scalarType": "float32" } - }, - "bindings": [ - - ] + } } ] } diff --git a/tests/reflection/thread-group-size.hlsl.expected b/tests/reflection/thread-group-size.hlsl.expected index a41c66248..cd5d09e35 100644 --- a/tests/reflection/thread-group-size.hlsl.expected +++ b/tests/reflection/thread-group-size.hlsl.expected @@ -21,9 +21,6 @@ standard output = { "parameters": [ { "name": "tid", - "bindings": [ - - ], "semanticName": "SV_DISPATCHTHREADID", "type": { "kind": "vector", |
