diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp index 3d7e84329d..999df56851 100644 --- a/src/sksl/SkSLIRGenerator.cpp +++ b/src/sksl/SkSLIRGenerator.cpp @@ -629,7 +629,7 @@ std::unique_ptr IRGenerator::getNormalizeSkPositionCode() { children.push_back(OP(OP(SWIZZLE(POS, 1), Token::STAR, SWIZZLE(ADJUST, 2)), Token::PLUS, OP(SWIZZLE(POS, 3), Token::STAR, SWIZZLE(ADJUST, 3)))); - children.push_back(std::unique_ptr(new IntLiteral(fContext, -1, 0))); + children.push_back(std::unique_ptr(new FloatLiteral(fContext, -1, 0.0))); children.push_back(SWIZZLE(POS, 3)); std::unique_ptr result = OP(POS, Token::EQ, std::unique_ptr(new Constructor(-1, diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp index 9b0571bcdc..079b4038fb 100644 --- a/tests/SkSLGLSLTest.cpp +++ b/tests/SkSLGLSLTest.cpp @@ -1081,7 +1081,8 @@ DEF_TEST(SkSLFragCoord, r) { "void main() {\n" " sk_FragCoord_Workaround = (gl_Position = pos);\n" " gl_Position = vec4(gl_Position.x * sk_RTAdjust.x + gl_Position.w * sk_RTAdjust.y, " - "gl_Position.y * sk_RTAdjust.z + gl_Position.w * sk_RTAdjust.w, 0, gl_Position.w);\n" + "gl_Position.y * sk_RTAdjust.z + gl_Position.w * sk_RTAdjust.w, 0.0, " + "gl_Position.w);\n" "}\n", SkSL::Program::kVertex_Kind); @@ -1760,7 +1761,7 @@ DEF_TEST(SkSLNormalization, r) { " gl_Position = vec4(1.0);\n" " gl_Position = vec4(gl_Position.x * sk_RTAdjust.x + gl_Position.w * sk_RTAdjust.y, " "gl_Position.y * sk_RTAdjust.z + gl_Position.w * sk_RTAdjust.w, " - "0, " + "0.0, " "gl_Position.w);\n" "}\n", SkSL::Program::kVertex_Kind); @@ -1787,14 +1788,14 @@ DEF_TEST(SkSLNormalization, r) { " {\n" " gl_Position = vec4(gl_Position.x * sk_RTAdjust.x + gl_Position.w * " "sk_RTAdjust.y, gl_Position.y * sk_RTAdjust.z + gl_Position.w * " - "sk_RTAdjust.w, 0, gl_Position.w);\n" + "sk_RTAdjust.w, 0.0, gl_Position.w);\n" " EmitVertex();\n" " }\n" " gl_Position = gl_in[0].gl_Position + vec4(0.5, 0.0, 0.0, float(gl_InvocationID));\n" " {\n" " gl_Position = vec4(gl_Position.x * sk_RTAdjust.x + gl_Position.w * " "sk_RTAdjust.y, gl_Position.y * sk_RTAdjust.z + gl_Position.w * " - "sk_RTAdjust.w, 0, gl_Position.w);\n" + "sk_RTAdjust.w, 0.0, gl_Position.w);\n" " EmitVertex();\n" " }\n" " EndPrimitive();\n"