From 15aba2fe81fea44969e036e181a4cf252ff41963 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 17 Jul 2017 08:58:47 -0700 Subject: Handle `flat` interpolation cases in cross compilation Fixes #104 - Map HLSL `nointerpolation` to GLSL `flat` - When lowering a `struct` type varying input/output, look for interpolation modifiers along the "chain" from the leaf field up to the original shader input variable (and take the first one found) - Not sure if this is strictly needed, but it seems like a reasonable policy - Add `flat` to varying input of integer type, with no other interpolation modifier - Note: I do *not* do anything to ignore a manually imposed interpolation modifier that might be incorrect --- tests/cross-compile/integer-input.slang | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/cross-compile/integer-input.slang (limited to 'tests/cross-compile/integer-input.slang') diff --git a/tests/cross-compile/integer-input.slang b/tests/cross-compile/integer-input.slang new file mode 100644 index 000000000..2069091c6 --- /dev/null +++ b/tests/cross-compile/integer-input.slang @@ -0,0 +1,11 @@ +//TEST:CROSS_COMPILE: -profile ps_5_0 -entry main -target spirv-assembly + +struct VS_OUT +{ + uint drawID : DRAW_ID; +}; + +float4 main(VS_OUT vsOut) : SV_Target +{ + return float4(float(vsOut.drawID)); +} -- cgit v1.2.3