diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bindings/hlsl-to-vulkan-combined.hlsl | 9 | ||||
| -rw-r--r-- | tests/bindings/hlsl-to-vulkan-combined.hlsl.expected | 54 | ||||
| -rw-r--r-- | tests/bindings/hlsl-to-vulkan-global.hlsl | 12 | ||||
| -rw-r--r-- | tests/bindings/hlsl-to-vulkan-global.hlsl.expected | 77 | ||||
| -rw-r--r-- | tests/bindings/hlsl-to-vulkan-shift.hlsl | 21 | ||||
| -rw-r--r-- | tests/bindings/hlsl-to-vulkan-shift.hlsl.expected | 178 |
6 files changed, 351 insertions, 0 deletions
diff --git a/tests/bindings/hlsl-to-vulkan-combined.hlsl b/tests/bindings/hlsl-to-vulkan-combined.hlsl new file mode 100644 index 000000000..20668b01b --- /dev/null +++ b/tests/bindings/hlsl-to-vulkan-combined.hlsl @@ -0,0 +1,9 @@ +//TEST:REFLECTION:-target glsl -profile ps_4_0 -entry main -fvk-t-shift 5 all -fvk-t-shift 7 2 -fvk-s-shift -3 0 -fvk-b-shift 1 2 + +Sampler2D<float> t0 : register(t2); +Sampler2D<float4> t1 : register(t7, space2); + +float4 main() : SV_TARGET +{ + return float4(1, 1, 1, 0); +}
\ No newline at end of file diff --git a/tests/bindings/hlsl-to-vulkan-combined.hlsl.expected b/tests/bindings/hlsl-to-vulkan-combined.hlsl.expected new file mode 100644 index 000000000..127d0fe4c --- /dev/null +++ b/tests/bindings/hlsl-to-vulkan-combined.hlsl.expected @@ -0,0 +1,54 @@ +result code = 0 +standard error = { +} +standard output = { +{ + "parameters": [ + { + "name": "t0", + "binding": {"kind": "descriptorTableSlot", "index": 7}, + "type": { + "kind": "resource", + "baseShape": "texture2D" + } + }, + { + "name": "t1", + "binding": {"kind": "descriptorTableSlot", "space": 2, "index": 14}, + "type": { + "kind": "resource", + "baseShape": "texture2D" + } + } + ], + "entryPoints": [ + { + "name": "main", + "stage:": "fragment", + "result:": { + "stage": "fragment", + "binding": {"kind": "varyingOutput", "index": 0}, + "semanticName": "SV_TARGET", + "type": { + "kind": "vector", + "elementCount": 4, + "elementType": { + "kind": "scalar", + "scalarType": "float32" + } + } + }, + "bindings": [ + { + "name": "t0", + "binding": {"kind": "descriptorTableSlot", "index": 7} + }, + { + "name": "t1", + "binding": {"kind": "descriptorTableSlot", "space": 2, "index": 14} + } + ] + } + ] +} +} diff --git a/tests/bindings/hlsl-to-vulkan-global.hlsl b/tests/bindings/hlsl-to-vulkan-global.hlsl new file mode 100644 index 000000000..aceec02ba --- /dev/null +++ b/tests/bindings/hlsl-to-vulkan-global.hlsl @@ -0,0 +1,12 @@ +//TEST:REFLECTION:-target glsl -profile ps_4_0 -entry main -fvk-bind-globals 5 9 + +uniform int a; +uniform float b; + +Texture2D t; +SamplerState sampler; + +float4 main() : SV_TARGET +{ + return t.SampleLevel(sampler, float2(a,b), 0) + float4(a, b, 1, 0); +}
\ No newline at end of file diff --git a/tests/bindings/hlsl-to-vulkan-global.hlsl.expected b/tests/bindings/hlsl-to-vulkan-global.hlsl.expected new file mode 100644 index 000000000..b0b8f6a17 --- /dev/null +++ b/tests/bindings/hlsl-to-vulkan-global.hlsl.expected @@ -0,0 +1,77 @@ +result code = 0 +standard error = { +} +standard output = { +{ + "parameters": [ + { + "name": "a", + "binding": {"kind": "uniform", "offset": 0, "size": 4}, + "type": { + "kind": "scalar", + "scalarType": "int32" + } + }, + { + "name": "b", + "binding": {"kind": "uniform", "offset": 4, "size": 4}, + "type": { + "kind": "scalar", + "scalarType": "float32" + } + }, + { + "name": "t", + "binding": {"kind": "descriptorTableSlot", "index": 0}, + "type": { + "kind": "resource", + "baseShape": "texture2D" + } + }, + { + "name": "sampler", + "binding": {"kind": "descriptorTableSlot", "index": 1}, + "type": { + "kind": "samplerState" + } + } + ], + "entryPoints": [ + { + "name": "main", + "stage:": "fragment", + "result:": { + "stage": "fragment", + "binding": {"kind": "varyingOutput", "index": 0}, + "semanticName": "SV_TARGET", + "type": { + "kind": "vector", + "elementCount": 4, + "elementType": { + "kind": "scalar", + "scalarType": "float32" + } + } + }, + "bindings": [ + { + "name": "a", + "binding": {"kind": "uniform", "offset": 0, "size": 4} + }, + { + "name": "b", + "binding": {"kind": "uniform", "offset": 4, "size": 4} + }, + { + "name": "t", + "binding": {"kind": "descriptorTableSlot", "index": 0} + }, + { + "name": "sampler", + "binding": {"kind": "descriptorTableSlot", "index": 1} + } + ] + } + ] +} +} diff --git a/tests/bindings/hlsl-to-vulkan-shift.hlsl b/tests/bindings/hlsl-to-vulkan-shift.hlsl new file mode 100644 index 000000000..8981b6be6 --- /dev/null +++ b/tests/bindings/hlsl-to-vulkan-shift.hlsl @@ -0,0 +1,21 @@ +//TEST:REFLECTION:-target glsl -profile ps_4_0 -entry main -fvk-t-shift 5 all -fvk-t-shift 7 2 -fvk-s-shift -3 0 -fvk-b-shift 1 2 + +struct Data +{ + float a; + int b; +}; + +Texture2D t : register(t0); +SamplerState s : register(s4); +ConstantBuffer<Data> c : register(b2); + +Texture2D t2 : register(t0, space2); + +RWStructuredBuffer<Data> u : register(u11); +RWStructuredBuffer<int> u2 : register(u3, space2); + +float4 main() : SV_TARGET +{ + return float4(1, 1, 1, 0); +}
\ No newline at end of file diff --git a/tests/bindings/hlsl-to-vulkan-shift.hlsl.expected b/tests/bindings/hlsl-to-vulkan-shift.hlsl.expected new file mode 100644 index 000000000..b0d8ace6f --- /dev/null +++ b/tests/bindings/hlsl-to-vulkan-shift.hlsl.expected @@ -0,0 +1,178 @@ +result code = 0 +standard error = { +} +standard output = { +{ + "parameters": [ + { + "name": "t", + "binding": {"kind": "descriptorTableSlot", "index": 5}, + "type": { + "kind": "resource", + "baseShape": "texture2D" + } + }, + { + "name": "s", + "binding": {"kind": "descriptorTableSlot", "index": 1}, + "type": { + "kind": "samplerState" + } + }, + { + "name": "c", + "binding": {"kind": "descriptorTableSlot", "index": 0}, + "type": { + "kind": "constantBuffer", + "elementType": { + "kind": "struct", + "name": "Data", + "fields": [ + { + "name": "a", + "type": { + "kind": "scalar", + "scalarType": "float32" + }, + "binding": {"kind": "uniform", "offset": 0, "size": 4} + }, + { + "name": "b", + "type": { + "kind": "scalar", + "scalarType": "int32" + }, + "binding": {"kind": "uniform", "offset": 4, "size": 4} + } + ] + }, + "containerVarLayout": { + "binding": {"kind": "descriptorTableSlot", "index": 0} + }, + "elementVarLayout": { + "type": { + "kind": "struct", + "name": "Data", + "fields": [ + { + "name": "a", + "type": { + "kind": "scalar", + "scalarType": "float32" + }, + "binding": {"kind": "uniform", "offset": 0, "size": 4} + }, + { + "name": "b", + "type": { + "kind": "scalar", + "scalarType": "int32" + }, + "binding": {"kind": "uniform", "offset": 4, "size": 4} + } + ] + }, + "binding": {"kind": "uniform", "offset": 0, "size": 16} + } + } + }, + { + "name": "t2", + "binding": {"kind": "descriptorTableSlot", "space": 2, "index": 7}, + "type": { + "kind": "resource", + "baseShape": "texture2D" + } + }, + { + "name": "u", + "binding": {"kind": "descriptorTableSlot", "index": 2}, + "type": { + "kind": "resource", + "baseShape": "structuredBuffer", + "access": "readWrite", + "resultType": { + "kind": "struct", + "name": "Data", + "fields": [ + { + "name": "a", + "type": { + "kind": "scalar", + "scalarType": "float32" + }, + "binding": {"kind": "uniform", "offset": 0, "size": 4} + }, + { + "name": "b", + "type": { + "kind": "scalar", + "scalarType": "int32" + }, + "binding": {"kind": "uniform", "offset": 4, "size": 4} + } + ] + } + } + }, + { + "name": "u2", + "binding": {"kind": "descriptorTableSlot", "space": 2, "index": 4}, + "type": { + "kind": "resource", + "baseShape": "structuredBuffer", + "access": "readWrite", + "resultType": { + "kind": "scalar", + "scalarType": "int32" + } + } + } + ], + "entryPoints": [ + { + "name": "main", + "stage:": "fragment", + "result:": { + "stage": "fragment", + "binding": {"kind": "varyingOutput", "index": 0}, + "semanticName": "SV_TARGET", + "type": { + "kind": "vector", + "elementCount": 4, + "elementType": { + "kind": "scalar", + "scalarType": "float32" + } + } + }, + "bindings": [ + { + "name": "t", + "binding": {"kind": "descriptorTableSlot", "index": 5} + }, + { + "name": "s", + "binding": {"kind": "descriptorTableSlot", "index": 1} + }, + { + "name": "c", + "binding": {"kind": "descriptorTableSlot", "index": 0} + }, + { + "name": "t2", + "binding": {"kind": "descriptorTableSlot", "space": 2, "index": 7} + }, + { + "name": "u", + "binding": {"kind": "descriptorTableSlot", "index": 2} + }, + { + "name": "u2", + "binding": {"kind": "descriptorTableSlot", "space": 2, "index": 4} + } + ] + } + ] +} +} |
