From fbba2775eb381caba23dac1c36869b6ce11c6357 Mon Sep 17 00:00:00 2001 From: Yong He Date: Sun, 10 Mar 2019 15:31:38 -0700 Subject: Fix GLSL emit logic for select expr --- tests/cross-compile/vector-comparison.slang | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/cross-compile/vector-comparison.slang (limited to 'tests/cross-compile/vector-comparison.slang') diff --git a/tests/cross-compile/vector-comparison.slang b/tests/cross-compile/vector-comparison.slang new file mode 100644 index 000000000..d1fdcfd4a --- /dev/null +++ b/tests/cross-compile/vector-comparison.slang @@ -0,0 +1,24 @@ +// vector-comparison.slang + +//TEST:CROSS_COMPILE:-target spirv-assembly -entry main -stage fragment + +// This test ensures that we cross-compile vector comparison operators +// correctly to GLSL + +struct Param +{ + float4 a, b; +}; +ParameterBlock params; +float4 main() : SV_Target +{ + float4 v0 = params.a; + float4 v1 = params.b; + float4 result = v0 == v1 ? float4(2.0f) : float4(3.0f); + result += v0 < v1 ? float4(2.0f) : float4(3.0f); + result += v0 > v1 ? float4(2.0f) : float4(3.0f); + result += v0 <= v1 ? float4(2.0f) : float4(3.0f); + result += v0 >= v1 ? float4(2.0f) : float4(3.0f); + result += v0 != v1 ? float4(2.0f) : float4(3.0f); + return result; +} \ No newline at end of file -- cgit v1.2.3