diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-12-15 14:26:58 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-15 14:26:58 -0800 |
| commit | 46b68ed41daecfaf1761e299cf040156e0f65ac0 (patch) | |
| tree | 678ac2ae7fcbe3d82dd56e1a0d68c5f235532d58 /tests/reflection/sample-index-input.hlsl.expected | |
| parent | 81c0cd872bcb94f1f05abc3b234d8918d237d77c (diff) | |
Add sample-rate-input detection for HLSL. (#312)
* Add sample-rate-input detection for HLSL.
In the HLSL case, it is possible to do this detection entirely based on declared signatures (it doesn't have a dependency on code generation like the GLSL case does). I've added test cases for the two main ways that a shader can become sample rate:
1. Qualify a fragment input with `sample`
2. Accept an input with the `SV_SampleIndex` semantic
In each case I nested the input inside a `struct` to try to match common HLSL idiom, and to make sure that we handle the nested case.
This code is *not* robust against shaders that declare such an input and then never use it, but that is to be expected given the goals for Slang.
* Fixup: add missing test output files
Diffstat (limited to 'tests/reflection/sample-index-input.hlsl.expected')
| -rw-r--r-- | tests/reflection/sample-index-input.hlsl.expected | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/reflection/sample-index-input.hlsl.expected b/tests/reflection/sample-index-input.hlsl.expected new file mode 100644 index 000000000..5bf5f297e --- /dev/null +++ b/tests/reflection/sample-index-input.hlsl.expected @@ -0,0 +1,52 @@ +result code = 0 +standard error = { +} +standard output = { +{ + "parameters": [ + + ], + "entryPoints": [ + { + "name": "main", + "stage:": "fragment", + "parameters": [ + { + "name": "input", + "stage": "fragment", + "binding": {"kind": "varyingInput", "index": 0}, + "type": { + "kind": "struct", + "name": "PSInput", + "fields": [ + { + "name": "color", + "type": { + "kind": "vector", + "elementCount": 4, + "elementType": { + "kind": "scalar", + "scalarType": "float32" + } + }, + "stage": "fragment", + "binding": {"kind": "varyingInput", "index": 0}, + "semanticName": "COLOR" + }, + { + "name": "sampleIndex", + "type": { + "kind": "scalar", + "scalarType": "uint32" + }, + "semanticName": "SV_SAMPLEINDEX" + } + ] + } + } + ], + "usesAnySampleRateInput": true + } + ] +} +} |
