From 8ac36a577f14158c820bbc673f477a7ce20702e5 Mon Sep 17 00:00:00 2001 From: Ethan Nicholas Date: Wed, 16 Aug 2017 22:01:21 -0400 Subject: fixed constant vector swizzling Bug: skia: Change-Id: I2d205bf7242d2223c4939c3e7897db9aba02c705 Reviewed-on: https://skia-review.googlesource.com/35640 Reviewed-by: Ethan Nicholas Commit-Queue: Ethan Nicholas --- tests/SkSLGLSLTest.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/SkSLGLSLTest.cpp') diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp index 73c6dccbde..e4088ceee7 100644 --- a/tests/SkSLGLSLTest.cpp +++ b/tests/SkSLGLSLTest.cpp @@ -1573,4 +1573,17 @@ DEF_TEST(SkSLNumberConversions, r) { "float f2f = f;\n"); } +DEF_TEST(SkSLConstantSwizzleComparison, r) { + test(r, + "void main() { if (half4(1.0).x == half4(1.0).y) { sk_FragColor = half4(1.0); } }", + *SkSL::ShaderCapsFactory::Default(), + "#version 400\n" + "out vec4 sk_FragColor;\n" + "void main() {\n" + " {\n" + " sk_FragColor = vec4(1.0);\n" + " }\n" + "}\n"); +} + #endif -- cgit v1.2.3