diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-10-19 11:49:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-19 11:49:16 -0700 |
| commit | 88023aea669f258d66e53eab10215337a7f72853 (patch) | |
| tree | 630d2f89a201283307ebc3ae1ccd3ce3d28876bb /tests/reflection/vertex-input-semantics.hlsl.expected | |
| parent | 5995b7a47b2b65025410b9d558dfe1820e4c42e0 (diff) | |
Reflection: allow querying of semantics on varying input/output (#224)
This is functionality required to support a Falcor bug fix.
Most of the code to compute the right semantic name/index for a parameter was already present.
This change adds:
- Storage for semantic name/index on every `VarLayout`
- Note: this is wasteful and should be optimized later
- A public API to query the semantic name/index
- The contract is that this API returns `NULL` if the parameter had no semantic
- A bit of work in `parameter-binding.cpp` to attach semantics to varying input/output when traversing varying parameters.
- Note: this is intentionally set up so that it associates semantics even with non-leaf parameters, so that an API user can query the semantic of a `struct` parameter and know that its members will be assigned sequential semantic indices from its starting value.
- Support for dumping this information in reflection tests
One notable thing that I did *not* change here is that the reflection test fixture doesn't report information on the output of an entry point, even though it really should. That should be fixed in a separate change, though, because it would affect many of the expected outputs.
Diffstat (limited to 'tests/reflection/vertex-input-semantics.hlsl.expected')
| -rw-r--r-- | tests/reflection/vertex-input-semantics.hlsl.expected | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/tests/reflection/vertex-input-semantics.hlsl.expected b/tests/reflection/vertex-input-semantics.hlsl.expected new file mode 100644 index 000000000..014533fdb --- /dev/null +++ b/tests/reflection/vertex-input-semantics.hlsl.expected @@ -0,0 +1,152 @@ +result code = 0 +standard error = { +} +standard output = { +{ + "parameters": [ + + ], + "entryPoints": [ + { + "name": "main", + "stage:": "vertex", + "parameters": [ + { + "name": "a", + "binding": {"kind": "vertexInput", "index": 0}, + "semanticName": "A", + "type": { + "kind": "vector", + "elementCount": 4, + "elementType": { + "kind": "scalar", + "scalarType": "float32" + } + } + }, + { + "name": "b", + "binding": {"kind": "vertexInput", "index": 1, "count": 3}, + "semanticName": "B", + "type": { + "kind": "struct", + "fields": [ + { + "name": "b0", + "type": { + "kind": "vector", + "elementCount": 4, + "elementType": { + "kind": "scalar", + "scalarType": "int32" + } + }, + "binding": {"kind": "vertexInput", "index": 0}, + "semanticName": "B" + }, + { + "name": "b1", + "type": { + "kind": "struct", + "fields": [ + { + "name": "x0", + "type": { + "kind": "vector", + "elementCount": 4, + "elementType": { + "kind": "scalar", + "scalarType": "float32" + } + }, + "binding": {"kind": "vertexInput", "index": 0}, + "semanticName": "B", + "semanticIndex": 1 + }, + { + "name": "x1", + "type": { + "kind": "vector", + "elementCount": 4, + "elementType": { + "kind": "scalar", + "scalarType": "float32" + } + }, + "binding": {"kind": "vertexInput", "index": 1}, + "semanticName": "B", + "semanticIndex": 2 + } + ] + }, + "binding": {"kind": "vertexInput", "index": 1, "count": 2}, + "semanticName": "B", + "semanticIndex": 1 + } + ] + } + }, + { + "name": "c", + "binding": {"kind": "vertexInput", "index": 4, "count": 3}, + "type": { + "kind": "struct", + "fields": [ + { + "name": "c0", + "type": { + "kind": "struct", + "fields": [ + { + "name": "x0", + "type": { + "kind": "vector", + "elementCount": 4, + "elementType": { + "kind": "scalar", + "scalarType": "float32" + } + }, + "binding": {"kind": "vertexInput", "index": 0}, + "semanticName": "CX" + }, + { + "name": "x1", + "type": { + "kind": "vector", + "elementCount": 4, + "elementType": { + "kind": "scalar", + "scalarType": "float32" + } + }, + "binding": {"kind": "vertexInput", "index": 1}, + "semanticName": "CX", + "semanticIndex": 1 + } + ] + }, + "binding": {"kind": "vertexInput", "index": 0, "count": 2}, + "semanticName": "CX" + }, + { + "name": "c1", + "type": { + "kind": "vector", + "elementCount": 4, + "elementType": { + "kind": "scalar", + "scalarType": "int32" + } + }, + "binding": {"kind": "vertexInput", "index": 2}, + "semanticName": "CY" + } + ] + } + } + ] + } + ] +} +} |
