From 73af7100416e1627d1de0aaa94983f56406a9d49 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Tue, 12 Feb 2019 15:13:00 -0800 Subject: Track stage for varying sub-fields (#842) Fixes #841 This reverts a small change made in #815 that seemed innocent at the time: we stopped tracking an explicit `Stage` to go with every `VarLayout` that is part of an entry-point varying parameter, and instead only associated the stage with the top-level parameter. That change ended up breaking the logic to emit the `flat` modifier automatically for integer type fragment-shader inputs for GLSL, but we didn't have a regression test to catch that case. This change adds a regression test to cover this case, and adds the small number of lines that were removed from `parameter-binding.cpp`. A few other test outputs had to be updated for the change (these are outputs that were changed in #815 for the same reason). --- tests/reflection/sample-index-input.hlsl.expected | 1 + tests/reflection/sample-rate-input.hlsl.expected | 2 ++ tests/reflection/vertex-input-semantics.hlsl.expected | 8 ++++++++ 3 files changed, 11 insertions(+) (limited to 'tests/reflection') diff --git a/tests/reflection/sample-index-input.hlsl.expected b/tests/reflection/sample-index-input.hlsl.expected index c799f8f25..5bf5f297e 100644 --- a/tests/reflection/sample-index-input.hlsl.expected +++ b/tests/reflection/sample-index-input.hlsl.expected @@ -29,6 +29,7 @@ standard output = { "scalarType": "float32" } }, + "stage": "fragment", "binding": {"kind": "varyingInput", "index": 0}, "semanticName": "COLOR" }, diff --git a/tests/reflection/sample-rate-input.hlsl.expected b/tests/reflection/sample-rate-input.hlsl.expected index ec6cfca6e..0c86ebecb 100644 --- a/tests/reflection/sample-rate-input.hlsl.expected +++ b/tests/reflection/sample-rate-input.hlsl.expected @@ -29,6 +29,7 @@ standard output = { "scalarType": "float32" } }, + "stage": "fragment", "binding": {"kind": "varyingInput", "index": 0}, "semanticName": "EXTRA" }, @@ -42,6 +43,7 @@ standard output = { "scalarType": "float32" } }, + "stage": "fragment", "binding": {"kind": "varyingInput", "index": 1}, "semanticName": "COLOR" } diff --git a/tests/reflection/vertex-input-semantics.hlsl.expected b/tests/reflection/vertex-input-semantics.hlsl.expected index 2ff8d7847..06b7bc95a 100644 --- a/tests/reflection/vertex-input-semantics.hlsl.expected +++ b/tests/reflection/vertex-input-semantics.hlsl.expected @@ -44,6 +44,7 @@ standard output = { "scalarType": "int32" } }, + "stage": "vertex", "binding": {"kind": "varyingInput", "index": 0}, "semanticName": "B" }, @@ -63,6 +64,7 @@ standard output = { "scalarType": "float32" } }, + "stage": "vertex", "binding": {"kind": "varyingInput", "index": 0}, "semanticName": "B", "semanticIndex": 1 @@ -77,12 +79,14 @@ standard output = { "scalarType": "float32" } }, + "stage": "vertex", "binding": {"kind": "varyingInput", "index": 1}, "semanticName": "B", "semanticIndex": 2 } ] }, + "stage": "vertex", "binding": {"kind": "varyingInput", "index": 1, "count": 2}, "semanticName": "B", "semanticIndex": 1 @@ -114,6 +118,7 @@ standard output = { "scalarType": "float32" } }, + "stage": "vertex", "binding": {"kind": "varyingInput", "index": 0}, "semanticName": "CX" }, @@ -127,12 +132,14 @@ standard output = { "scalarType": "float32" } }, + "stage": "vertex", "binding": {"kind": "varyingInput", "index": 1}, "semanticName": "CX", "semanticIndex": 1 } ] }, + "stage": "vertex", "binding": {"kind": "varyingInput", "index": 0, "count": 2}, "semanticName": "CX" }, @@ -146,6 +153,7 @@ standard output = { "scalarType": "int32" } }, + "stage": "vertex", "binding": {"kind": "varyingInput", "index": 2}, "semanticName": "CY" } -- cgit v1.2.3