diff options
| author | Yong He <yonghe@outlook.com> | 2019-03-10 16:19:23 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-10 16:19:23 -0700 |
| commit | 35c26f3395383b49031b672b77470062d74a5f59 (patch) | |
| tree | 9f44be5afceb2dfe216645e2719680867d2cc6bc /tests/cross-compile/vector-comparison.slang | |
| parent | d5492155d6d8b16f262c09f72d8653e3e675b616 (diff) | |
| parent | fbba2775eb381caba23dac1c36869b6ce11c6357 (diff) | |
Merge pull request #893 from csyonghe/master
Fix GLSL emit logic for select expr
Diffstat (limited to 'tests/cross-compile/vector-comparison.slang')
| -rw-r--r-- | tests/cross-compile/vector-comparison.slang | 24 |
1 files changed, 24 insertions, 0 deletions
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<Param> 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 |
