renamed SkSL types in preparation for killing precision modifiers

Bug: skia:
Change-Id: Iff0289e25355a89cdc289a0892ed755dd1b1c900
Reviewed-on: https://skia-review.googlesource.com/27703
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/sksl/README b/src/sksl/README
index f590bbe..0128954 100644
--- a/src/sksl/README
+++ b/src/sksl/README
@@ -13,12 +13,10 @@
 Differences from GLSL
 =====================
 
-SkSL is based on GLSL 4.5. For the most part, write SkSL exactly as you would
-desktop GLSL, and the SkSL compiler will take care of version and dialect
-differences (for instance, you always use "in" and "out", and skslc will handle
-translating them to "varying" and "attribute" as appropriate). Be aware of the
-following differences between SkSL and GLSL:
-
+* Vector types are named <base type><columns>, so float2 instead of vec2 and
+  bool4 instead of bvec4
+* Matrix types are named <base type><columns>x<rows>, so float2x3 instead of
+  mat2x3 and double4x4 instead of dmat4
 * "@if" and "@switch" are static versions of if and switch. They behave exactly
   the same as if and switch in all respects other than it being a compile-time
   error to use a non-constant expression as a test.
@@ -35,7 +33,7 @@
 
   will compile as if you had written either 'do_something();' or
   'do_something_else();', depending on whether that cap is enabled or not.
-* no #version statement is required, and will be ignored if present
+* no #version statement is required, and it will be ignored if present
 * the output color is sk_FragColor (do not declare it)
 * use sk_VertexID instead of gl_VertexID
 * the fragment coordinate is sk_FragCoord, and is always relative to the upper
@@ -43,15 +41,15 @@
 * lowp, mediump, and highp are always permitted (but will only be respected if
   you run on a device which supports them)
 * you do not need to include ".0" to make a number a float (meaning that
-  "vec2(x, y) * 4" is perfectly legal in SkSL, unlike GLSL where it would often
-  have to be expressed "vec2(x, y) * 4.0". There is no performance penalty for
+  "float2x, y) * 4" is perfectly legal in SkSL, unlike GLSL where it would often
+  have to be expressed "float2x, y) * 4.0". There is no performance penalty for
   this, as the number is converted to a float at compile time)
 * type suffixes on numbers (1.0f, 0xFFu) are both unnecessary and unsupported
-* creating a smaller vector from a larger vector (e.g. vec2(vec3(1))) is
+* creating a smaller vector from a larger vector (e.g. float2float31))) is
   intentionally disallowed, as it is just a wordier way of performing a swizzle.
   Use swizzles instead.
-* Use texture() instead of textureProj(), e.g. texture(sampler2D, vec3) is
-  equivalent to GLSL's textureProj(sampler2D, vec3)
+* Use texture() instead of textureProj(), e.g. texture(sampler2D, float3 is
+  equivalent to GLSL's textureProj(sampler2D, float3
 * some built-in functions and one or two rarely-used language features are not
   yet supported (sorry!)
 
@@ -96,7 +94,7 @@
                        (the sampler params to attach to the named sampler2D)
 * global 'in' variables represent data passed to the fragment processor at
   construction time. These variables become constructor parameters and are
-  stored in fragment processor fields. vec2s map to SkPoints, and vec4s map to
+  stored in fragment processor fields. float2 map to SkPoints, and float4 map to
   SkRects (in x, y, width, height) order.
 * 'uniform' variables become, as one would expect, top-level uniforms. By
   default they do not have any data provided to them; you will need to provide
diff --git a/src/sksl/SkSLCPP.h b/src/sksl/SkSLCPP.h
index 47f8a40..642f7c6 100644
--- a/src/sksl/SkSLCPP.h
+++ b/src/sksl/SkSLCPP.h
@@ -18,8 +18,8 @@
 #define floatPrecisionVaries floatPrecisionVaries()
 
 // functions to make GLSL constructors work from C++ code
-inline SkPoint vec2(float xy) { return SkPoint::Make(xy, xy); }
+inline SkPoint float2(float xy) { return SkPoint::Make(xy, xy); }
 
-inline SkPoint vec2(float x, float y) { return SkPoint::Make(x, y); }
+inline SkPoint float2(float x, float y) { return SkPoint::Make(x, y); }
 
 #endif
diff --git a/src/sksl/SkSLCPPCodeGenerator.cpp b/src/sksl/SkSLCPPCodeGenerator.cpp
index 235c9d8..7c10606 100644
--- a/src/sksl/SkSLCPPCodeGenerator.cpp
+++ b/src/sksl/SkSLCPPCodeGenerator.cpp
@@ -54,6 +54,13 @@
 void CPPCodeGenerator::writePrecisionModifier() {
 }
 
+void CPPCodeGenerator::writeType(const Type& type) {
+    if (type.kind() == Type::kStruct_Kind) {
+        INHERITED::writeType(type);
+    } else {
+        this->write(type.name());
+    }
+}
 void CPPCodeGenerator::writeBinaryExpression(const BinaryExpression& b,
                                              Precedence parentPrecedence) {
     if (b.fOperator == Token::PERCENT) {
@@ -114,14 +121,14 @@
     const char* name = type.name().c_str();
     if (!strcmp(name, "float")) {
         return "0.0";
-    } else if (!strcmp(name, "vec2")) {
-        return "vec2(0.0)";
-    } else if (!strcmp(name, "vec3")) {
-        return "vec3(0.0)";
-    } else if (!strcmp(name, "vec4")) {
-        return "vec4(0.0)";
-    } else if (!strcmp(name, "mat4") || !strcmp(name, "colorSpaceXform")) {
-        return "mat4(1.0)";
+    } else if (!strcmp(name, "float2")) {
+        return "float2(0.0)";
+    } else if (!strcmp(name, "float3")) {
+        return "float30.0)";
+    } else if (!strcmp(name, "float4")) {
+        return "float4(0.0)";
+    } else if (!strcmp(name, "floatt4x4") || !strcmp(name, "colorSpaceXform")) {
+        return "float4x4(1.0)";
     }
     ABORT("unsupported default_value type\n");
 }
@@ -143,8 +150,8 @@
     } else if (type == *fContext.fBool_Type) {
         this->write("%s");
         fFormatArgs.push_back("(" + cppCode + " ? \"true\" : \"false\")");
-    } else if (type == *fContext.fVec2_Type) {
-        this->write("vec2(%f, %f)");
+    } else if (type == *fContext.fFloat2_Type) {
+        this->write("float2(%f, %f)");
         fFormatArgs.push_back(cppCode + ".fX");
         fFormatArgs.push_back(cppCode + ".fY");
     } else {
@@ -178,7 +185,7 @@
     switch (ref.fVariable.fModifiers.fLayout.fBuiltin) {
         case SK_INCOLOR_BUILTIN:
             this->write("%s");
-            fFormatArgs.push_back(String("args.fInputColor ? args.fInputColor : \"vec4(1)\""));
+            fFormatArgs.push_back(String("args.fInputColor ? args.fInputColor : \"float4(1)\""));
             break;
         case SK_OUTCOLOR_BUILTIN:
             this->write("%s");
@@ -242,7 +249,7 @@
 void CPPCodeGenerator::writeFunctionCall(const FunctionCall& c) {
     if (c.fFunction.fBuiltin && c.fFunction.fName == "COLORSPACE") {
         String tmpVar = "_tmpVar" + to_string(++fVarCount);
-        fFunctionHeader += "vec4 " + tmpVar + ";";
+        fFunctionHeader += "float4 " + tmpVar + ";";
         ASSERT(c.fArguments.size() == 2);
         this->write("%s");
         fFormatArgs.push_back("fColorSpaceHelper.isValid() ? \"(" + tmpVar + " = \" : \"\"");
@@ -250,8 +257,9 @@
         ASSERT(c.fArguments[1]->fKind == Expression::kVariableReference_Kind);
         String xform("args.fUniformHandler->getUniformCStr(fColorSpaceHelper.gamutXformUniform())");
         this->write("%s");
-        fFormatArgs.push_back("fColorSpaceHelper.isValid() ? SkStringPrintf(\", vec4(clamp((%s * vec4(" + tmpVar + ".rgb, 1.0)).rgb, 0.0, " + tmpVar +
-                              ".a), " + tmpVar + ".a))\", " + xform + ").c_str() : \"\"");
+        fFormatArgs.push_back("fColorSpaceHelper.isValid() ? SkStringPrintf(\", "
+                              "float4(clamp((%s * float4(" + tmpVar + ".rgb, 1.0)).rgb, 0.0, " +
+                              tmpVar + ".a), " + tmpVar + ".a))\", " + xform + ").c_str() : \"\"");
         return;
     }
     INHERITED::writeFunctionCall(c);
@@ -336,11 +344,11 @@
     const char* type;
     if (var.fType == *fContext.fFloat_Type) {
         type = "kFloat_GrSLType";
-    } else if (var.fType == *fContext.fVec2_Type) {
+    } else if (var.fType == *fContext.fFloat2_Type) {
         type = "kVec2f_GrSLType";
-    } else if (var.fType == *fContext.fVec4_Type) {
+    } else if (var.fType == *fContext.fFloat4_Type) {
         type = "kVec4f_GrSLType";
-    } else if (var.fType == *fContext.fMat4x4_Type ||
+    } else if (var.fType == *fContext.fFloat4x4_Type ||
                var.fType == *fContext.fColorSpaceXform_Type) {
         type = "kMat44f_GrSLType";
     } else {
@@ -440,11 +448,11 @@
                 this->writef("        {\n");
             }
             const char* name = u->fName.c_str();
-            if (u->fType == *fContext.fVec4_Type) {
+            if (u->fType == *fContext.fFloat4_Type) {
                 this->writef("        const SkRect %sValue = _outer.%s();\n"
                              "        %s.set4fv(%sVar, 1, (float*) &%sValue);\n",
                              name, name, pdman, HCodeGenerator::FieldName(name).c_str(), name);
-            } else if (u->fType == *fContext.fMat4x4_Type) {
+            } else if (u->fType == *fContext.fFloat4x4_Type) {
                 this->writef("        float %sValue[16];\n"
                              "        _outer.%s().asColMajorf(%sValue);\n"
                              "        %s.setMatrix4f(%sVar, %sValue);\n",
@@ -528,14 +536,14 @@
         }
         switch (param->fModifiers.fLayout.fKey) {
             case Layout::kKey_Key:
-                if (param->fType == *fContext.fMat4x4_Type) {
-                    ABORT("no automatic key handling for mat4\n");
-                } else if (param->fType == *fContext.fVec2_Type) {
+                if (param->fType == *fContext.fFloat4x4_Type) {
+                    ABORT("no automatic key handling for float4x4\n");
+                } else if (param->fType == *fContext.fFloat2_Type) {
                     this->writef("    b->add32(%s.fX);\n",
                                  HCodeGenerator::FieldName(name).c_str());
                     this->writef("    b->add32(%s.fY);\n",
                                  HCodeGenerator::FieldName(name).c_str());
-                } else if (param->fType == *fContext.fVec4_Type) {
+                } else if (param->fType == *fContext.fFloat4_Type) {
                     this->writef("    b->add32(%s.x());\n",
                                  HCodeGenerator::FieldName(name).c_str());
                     this->writef("    b->add32(%s.y());\n",
diff --git a/src/sksl/SkSLCPPCodeGenerator.h b/src/sksl/SkSLCPPCodeGenerator.h
index 7f60563..8b30151 100644
--- a/src/sksl/SkSLCPPCodeGenerator.h
+++ b/src/sksl/SkSLCPPCodeGenerator.h
@@ -33,6 +33,8 @@
 
     void writePrecisionModifier() override;
 
+    void writeType(const Type& type) override;
+
     void writeBinaryExpression(const BinaryExpression& b, Precedence parentPrecedence) override;
 
     void writeIndexExpression(const IndexExpression& i) override;
diff --git a/src/sksl/SkSLCompiler.cpp b/src/sksl/SkSLCompiler.cpp
index 0584ff1..d96515c 100644
--- a/src/sksl/SkSLCompiler.cpp
+++ b/src/sksl/SkSLCompiler.cpp
@@ -65,37 +65,34 @@
                                                    fContext.f ## t ## _Type.get())
     ADD_TYPE(Void);
     ADD_TYPE(Float);
-    ADD_TYPE(Vec2);
-    ADD_TYPE(Vec3);
-    ADD_TYPE(Vec4);
+    ADD_TYPE(Float2);
+    ADD_TYPE(Float3);
+    ADD_TYPE(Float4);
     ADD_TYPE(Double);
-    ADD_TYPE(DVec2);
-    ADD_TYPE(DVec3);
-    ADD_TYPE(DVec4);
+    ADD_TYPE(Double2);
+    ADD_TYPE(Double3);
+    ADD_TYPE(Double4);
     ADD_TYPE(Int);
-    ADD_TYPE(IVec2);
-    ADD_TYPE(IVec3);
-    ADD_TYPE(IVec4);
+    ADD_TYPE(Int2);
+    ADD_TYPE(Int3);
+    ADD_TYPE(Int4);
     ADD_TYPE(UInt);
-    ADD_TYPE(UVec2);
-    ADD_TYPE(UVec3);
-    ADD_TYPE(UVec4);
+    ADD_TYPE(UInt2);
+    ADD_TYPE(UInt3);
+    ADD_TYPE(UInt4);
     ADD_TYPE(Bool);
-    ADD_TYPE(BVec2);
-    ADD_TYPE(BVec3);
-    ADD_TYPE(BVec4);
-    ADD_TYPE(Mat2x2);
-    types->addWithoutOwnership(String("mat2x2"), fContext.fMat2x2_Type.get());
-    ADD_TYPE(Mat2x3);
-    ADD_TYPE(Mat2x4);
-    ADD_TYPE(Mat3x2);
-    ADD_TYPE(Mat3x3);
-    types->addWithoutOwnership(String("mat3x3"), fContext.fMat3x3_Type.get());
-    ADD_TYPE(Mat3x4);
-    ADD_TYPE(Mat4x2);
-    ADD_TYPE(Mat4x3);
-    ADD_TYPE(Mat4x4);
-    types->addWithoutOwnership(String("mat4x4"), fContext.fMat4x4_Type.get());
+    ADD_TYPE(Bool2);
+    ADD_TYPE(Bool3);
+    ADD_TYPE(Bool4);
+    ADD_TYPE(Float2x2);
+    ADD_TYPE(Float2x3);
+    ADD_TYPE(Float2x4);
+    ADD_TYPE(Float3x2);
+    ADD_TYPE(Float3x3);
+    ADD_TYPE(Float3x4);
+    ADD_TYPE(Float4x2);
+    ADD_TYPE(Float4x3);
+    ADD_TYPE(Float4x4);
     ADD_TYPE(GenType);
     ADD_TYPE(GenDType);
     ADD_TYPE(GenIType);
@@ -649,48 +646,48 @@
                     if (is_constant(*bin->fLeft, 1)) {
                         if (bin->fLeft->fType.kind() == Type::kVector_Kind &&
                             bin->fRight->fType.kind() == Type::kScalar_Kind) {
-                            // vec4(1) * x -> vec4(x)
+                            // float4(1) * x -> float4(x)
                             vectorize_right(&b, iter, outUpdated, outNeedsRescan);
                         } else {
                             // 1 * x -> x
-                            // 1 * vec4(x) -> vec4(x)
-                            // vec4(1) * vec4(x) -> vec4(x)
+                            // 1 * float4(x) -> float4(x)
+                            // float4(1) * float4(x) -> float4(x)
                             delete_left(&b, iter, outUpdated, outNeedsRescan);
                         }
                     }
                     else if (is_constant(*bin->fLeft, 0)) {
                         if (bin->fLeft->fType.kind() == Type::kScalar_Kind &&
                             bin->fRight->fType.kind() == Type::kVector_Kind) {
-                            // 0 * vec4(x) -> vec4(0)
+                            // 0 * float4(x) -> float4(0)
                             vectorize_left(&b, iter, outUpdated, outNeedsRescan);
                         } else {
                             // 0 * x -> 0
-                            // vec4(0) * x -> vec4(0)
-                            // vec4(0) * vec4(x) -> vec4(0)
+                            // float4(0) * x -> float4(0)
+                            // float4(0) * float4(x) -> float4(0)
                             delete_right(&b, iter, outUpdated, outNeedsRescan);
                         }
                     }
                     else if (is_constant(*bin->fRight, 1)) {
                         if (bin->fLeft->fType.kind() == Type::kScalar_Kind &&
                             bin->fRight->fType.kind() == Type::kVector_Kind) {
-                            // x * vec4(1) -> vec4(x)
+                            // x * float4(1) -> float4(x)
                             vectorize_left(&b, iter, outUpdated, outNeedsRescan);
                         } else {
                             // x * 1 -> x
-                            // vec4(x) * 1 -> vec4(x)
-                            // vec4(x) * vec4(1) -> vec4(x)
+                            // float4(x) * 1 -> float4(x)
+                            // float4(x) * float4(1) -> float4(x)
                             delete_right(&b, iter, outUpdated, outNeedsRescan);
                         }
                     }
                     else if (is_constant(*bin->fRight, 0)) {
                         if (bin->fLeft->fType.kind() == Type::kVector_Kind &&
                             bin->fRight->fType.kind() == Type::kScalar_Kind) {
-                            // vec4(x) * 0 -> vec4(0)
+                            // float4(x) * 0 -> float4(0)
                             vectorize_right(&b, iter, outUpdated, outNeedsRescan);
                         } else {
                             // x * 0 -> 0
-                            // x * vec4(0) -> vec4(0)
-                            // vec4(x) * vec4(0) -> vec4(0)
+                            // x * float4(0) -> float4(0)
+                            // float4(x) * float4(0) -> float4(0)
                             delete_left(&b, iter, outUpdated, outNeedsRescan);
                         }
                     }
@@ -699,23 +696,23 @@
                     if (is_constant(*bin->fLeft, 0)) {
                         if (bin->fLeft->fType.kind() == Type::kVector_Kind &&
                             bin->fRight->fType.kind() == Type::kScalar_Kind) {
-                            // vec4(0) + x -> vec4(x)
+                            // float4(0) + x -> float4(x)
                             vectorize_right(&b, iter, outUpdated, outNeedsRescan);
                         } else {
                             // 0 + x -> x
-                            // 0 + vec4(x) -> vec4(x)
-                            // vec4(0) + vec4(x) -> vec4(x)
+                            // 0 + float4(x) -> float4(x)
+                            // float4(0) + float4(x) -> float4(x)
                             delete_left(&b, iter, outUpdated, outNeedsRescan);
                         }
                     } else if (is_constant(*bin->fRight, 0)) {
                         if (bin->fLeft->fType.kind() == Type::kScalar_Kind &&
                             bin->fRight->fType.kind() == Type::kVector_Kind) {
-                            // x + vec4(0) -> vec4(x)
+                            // x + float4(0) -> float4(x)
                             vectorize_left(&b, iter, outUpdated, outNeedsRescan);
                         } else {
                             // x + 0 -> x
-                            // vec4(x) + 0 -> vec4(x)
-                            // vec4(x) + vec4(0) -> vec4(x)
+                            // float4(x) + 0 -> float4(x)
+                            // float4(x) + float4(0) -> float4(x)
                             delete_right(&b, iter, outUpdated, outNeedsRescan);
                         }
                     }
@@ -724,12 +721,12 @@
                     if (is_constant(*bin->fRight, 0)) {
                         if (bin->fLeft->fType.kind() == Type::kScalar_Kind &&
                             bin->fRight->fType.kind() == Type::kVector_Kind) {
-                            // x - vec4(0) -> vec4(x)
+                            // x - float4(0) -> float4(x)
                             vectorize_left(&b, iter, outUpdated, outNeedsRescan);
                         } else {
                             // x - 0 -> x
-                            // vec4(x) - 0 -> vec4(x)
-                            // vec4(x) - vec4(0) -> vec4(x)
+                            // float4(x) - 0 -> float4(x)
+                            // float4(x) - float4(0) -> float4(x)
                             delete_right(&b, iter, outUpdated, outNeedsRescan);
                         }
                     }
@@ -738,23 +735,23 @@
                     if (is_constant(*bin->fRight, 1)) {
                         if (bin->fLeft->fType.kind() == Type::kScalar_Kind &&
                             bin->fRight->fType.kind() == Type::kVector_Kind) {
-                            // x / vec4(1) -> vec4(x)
+                            // x / float4(1) -> float4(x)
                             vectorize_left(&b, iter, outUpdated, outNeedsRescan);
                         } else {
                             // x / 1 -> x
-                            // vec4(x) / 1 -> vec4(x)
-                            // vec4(x) / vec4(1) -> vec4(x)
+                            // float4(x) / 1 -> float4(x)
+                            // float4(x) / float4(1) -> float4(x)
                             delete_right(&b, iter, outUpdated, outNeedsRescan);
                         }
                     } else if (is_constant(*bin->fLeft, 0)) {
                         if (bin->fLeft->fType.kind() == Type::kScalar_Kind &&
                             bin->fRight->fType.kind() == Type::kVector_Kind) {
-                            // 0 / vec4(x) -> vec4(0)
+                            // 0 / float4(x) -> float4(0)
                             vectorize_left(&b, iter, outUpdated, outNeedsRescan);
                         } else {
                             // 0 / x -> 0
-                            // vec4(0) / x -> vec4(0)
-                            // vec4(0) / vec4(x) -> vec4(0)
+                            // float4(0) / x -> float4(0)
+                            // float4(0) / float4(x) -> float4(0)
                             delete_right(&b, iter, outUpdated, outNeedsRescan);
                         }
                     }
diff --git a/src/sksl/SkSLContext.h b/src/sksl/SkSLContext.h
index 1155af4..2de584f 100644
--- a/src/sksl/SkSLContext.h
+++ b/src/sksl/SkSLContext.h
@@ -22,44 +22,44 @@
     : fInvalid_Type(new Type(String("<INVALID>")))
     , fVoid_Type(new Type(String("void")))
     , fDouble_Type(new Type(String("double"), true))
-    , fDVec2_Type(new Type(String("dvec2"), *fDouble_Type, 2))
-    , fDVec3_Type(new Type(String("dvec3"), *fDouble_Type, 3))
-    , fDVec4_Type(new Type(String("dvec4"), *fDouble_Type, 4))
+    , fDouble2_Type(new Type(String("double2"), *fDouble_Type, 2))
+    , fDouble3_Type(new Type(String("double3"), *fDouble_Type, 3))
+    , fDouble4_Type(new Type(String("double4"), *fDouble_Type, 4))
     , fFloat_Type(new Type(String("float"), true, { fDouble_Type.get() }))
-    , fVec2_Type(new Type(String("vec2"), *fFloat_Type, 2))
-    , fVec3_Type(new Type(String("vec3"), *fFloat_Type, 3))
-    , fVec4_Type(new Type(String("vec4"), *fFloat_Type, 4))
+    , fFloat2_Type(new Type(String("float2"), *fFloat_Type, 2))
+    , fFloat3_Type(new Type(String("float3"), *fFloat_Type, 3))
+    , fFloat4_Type(new Type(String("float4"), *fFloat_Type, 4))
     , fUInt_Type(new Type(String("uint"), true, { fFloat_Type.get(), fDouble_Type.get() }))
-    , fUVec2_Type(new Type(String("uvec2"), *fUInt_Type, 2))
-    , fUVec3_Type(new Type(String("uvec3"), *fUInt_Type, 3))
-    , fUVec4_Type(new Type(String("uvec4"), *fUInt_Type, 4))
+    , fUInt2_Type(new Type(String("uint2"), *fUInt_Type, 2))
+    , fUInt3_Type(new Type(String("uint3"), *fUInt_Type, 3))
+    , fUInt4_Type(new Type(String("uint4"), *fUInt_Type, 4))
     , fInt_Type(new Type(String("int"), true, { fUInt_Type.get(), fFloat_Type.get(),
                                                   fDouble_Type.get() }))
-    , fIVec2_Type(new Type(String("ivec2"), *fInt_Type, 2))
-    , fIVec3_Type(new Type(String("ivec3"), *fInt_Type, 3))
-    , fIVec4_Type(new Type(String("ivec4"), *fInt_Type, 4))
+    , fInt2_Type(new Type(String("int2"), *fInt_Type, 2))
+    , fInt3_Type(new Type(String("int3"), *fInt_Type, 3))
+    , fInt4_Type(new Type(String("int4"), *fInt_Type, 4))
     , fBool_Type(new Type(String("bool"), false))
-    , fBVec2_Type(new Type(String("bvec2"), *fBool_Type, 2))
-    , fBVec3_Type(new Type(String("bvec3"), *fBool_Type, 3))
-    , fBVec4_Type(new Type(String("bvec4"), *fBool_Type, 4))
-    , fMat2x2_Type(new Type(String("mat2"),   *fFloat_Type, 2, 2))
-    , fMat2x3_Type(new Type(String("mat2x3"), *fFloat_Type, 2, 3))
-    , fMat2x4_Type(new Type(String("mat2x4"), *fFloat_Type, 2, 4))
-    , fMat3x2_Type(new Type(String("mat3x2"), *fFloat_Type, 3, 2))
-    , fMat3x3_Type(new Type(String("mat3"),   *fFloat_Type, 3, 3))
-    , fMat3x4_Type(new Type(String("mat3x4"), *fFloat_Type, 3, 4))
-    , fMat4x2_Type(new Type(String("mat4x2"), *fFloat_Type, 4, 2))
-    , fMat4x3_Type(new Type(String("mat4x3"), *fFloat_Type, 4, 3))
-    , fMat4x4_Type(new Type(String("mat4"),   *fFloat_Type, 4, 4))
-    , fDMat2x2_Type(new Type(String("dmat2"),   *fFloat_Type, 2, 2))
-    , fDMat2x3_Type(new Type(String("dmat2x3"), *fFloat_Type, 2, 3))
-    , fDMat2x4_Type(new Type(String("dmat2x4"), *fFloat_Type, 2, 4))
-    , fDMat3x2_Type(new Type(String("dmat3x2"), *fFloat_Type, 3, 2))
-    , fDMat3x3_Type(new Type(String("dmat3"),   *fFloat_Type, 3, 3))
-    , fDMat3x4_Type(new Type(String("dmat3x4"), *fFloat_Type, 3, 4))
-    , fDMat4x2_Type(new Type(String("dmat4x2"), *fFloat_Type, 4, 2))
-    , fDMat4x3_Type(new Type(String("dmat4x3"), *fFloat_Type, 4, 3))
-    , fDMat4x4_Type(new Type(String("dmat4"),   *fFloat_Type, 4, 4))
+    , fBool2_Type(new Type(String("bool2"), *fBool_Type, 2))
+    , fBool3_Type(new Type(String("bool3"), *fBool_Type, 3))
+    , fBool4_Type(new Type(String("bool4"), *fBool_Type, 4))
+    , fFloat2x2_Type(new Type(String("float2x2"),   *fFloat_Type, 2, 2))
+    , fFloat2x3_Type(new Type(String("float2x3"), *fFloat_Type, 2, 3))
+    , fFloat2x4_Type(new Type(String("float2x4"), *fFloat_Type, 2, 4))
+    , fFloat3x2_Type(new Type(String("float3x2"), *fFloat_Type, 3, 2))
+    , fFloat3x3_Type(new Type(String("float3x3"),   *fFloat_Type, 3, 3))
+    , fFloat3x4_Type(new Type(String("float3x4"), *fFloat_Type, 3, 4))
+    , fFloat4x2_Type(new Type(String("float4x2"), *fFloat_Type, 4, 2))
+    , fFloat4x3_Type(new Type(String("float4x3"), *fFloat_Type, 4, 3))
+    , fFloat4x4_Type(new Type(String("float4x4"),   *fFloat_Type, 4, 4))
+    , fDouble2x2_Type(new Type(String("double2x2"),   *fFloat_Type, 2, 2))
+    , fDouble2x3_Type(new Type(String("double2x3"), *fFloat_Type, 2, 3))
+    , fDouble2x4_Type(new Type(String("double2x4"), *fFloat_Type, 2, 4))
+    , fDouble3x2_Type(new Type(String("double3x2"), *fFloat_Type, 3, 2))
+    , fDouble3x3_Type(new Type(String("double3x3"),   *fFloat_Type, 3, 3))
+    , fDouble3x4_Type(new Type(String("double3x4"), *fFloat_Type, 3, 4))
+    , fDouble4x2_Type(new Type(String("double4x2"), *fFloat_Type, 4, 2))
+    , fDouble4x3_Type(new Type(String("double4x3"), *fFloat_Type, 4, 3))
+    , fDouble4x4_Type(new Type(String("double4x4"),   *fFloat_Type, 4, 4))
     , fSampler1D_Type(new Type(String("sampler1D"), SpvDim1D, false, false, false, true))
     , fSampler2D_Type(new Type(String("sampler2D"), SpvDim2D, false, false, false, true))
     , fSampler3D_Type(new Type(String("sampler3D"), SpvDim3D, false, false, false, true))
@@ -116,39 +116,39 @@
                                            static_type(*fSampler2DArrayShadow_Type)))
     , fGSamplerCubeArrayShadow_Type(new Type(String("$gsamplerCubeArrayShadow"),
                                              static_type(*fSamplerCubeArrayShadow_Type)))
-    , fGenType_Type(new Type(String("$genType"), { fFloat_Type.get(), fVec2_Type.get(),
-                                                     fVec3_Type.get(), fVec4_Type.get() }))
-    , fGenDType_Type(new Type(String("$genDType"), { fDouble_Type.get(), fDVec2_Type.get(),
-                                                       fDVec3_Type.get(), fDVec4_Type.get() }))
-    , fGenIType_Type(new Type(String("$genIType"), { fInt_Type.get(), fIVec2_Type.get(),
-                                                       fIVec3_Type.get(), fIVec4_Type.get() }))
-    , fGenUType_Type(new Type(String("$genUType"), { fUInt_Type.get(), fUVec2_Type.get(),
-                                                       fUVec3_Type.get(), fUVec4_Type.get() }))
-    , fGenBType_Type(new Type(String("$genBType"), { fBool_Type.get(), fBVec2_Type.get(),
-                                                       fBVec3_Type.get(), fBVec4_Type.get() }))
-    , fMat_Type(new Type(String("$mat"), { fMat2x2_Type.get(), fMat2x3_Type.get(),
-                                             fMat2x4_Type.get(), fMat3x2_Type.get(),
-                                             fMat3x3_Type.get(), fMat3x4_Type.get(),
-                                             fMat4x2_Type.get(), fMat4x3_Type.get(),
-                                             fMat4x4_Type.get(), fDMat2x2_Type.get(),
-                                             fDMat2x3_Type.get(), fDMat2x4_Type.get(),
-                                             fDMat3x2_Type.get(), fDMat3x3_Type.get(),
-                                             fDMat3x4_Type.get(), fDMat4x2_Type.get(),
-                                             fDMat4x3_Type.get(), fDMat4x4_Type.get() }))
-    , fVec_Type(new Type(String("$vec"), { fInvalid_Type.get(), fVec2_Type.get(),
-                                             fVec3_Type.get(), fVec4_Type.get() }))
+    , fGenType_Type(new Type(String("$genType"), { fFloat_Type.get(), fFloat2_Type.get(),
+                                                   fFloat3_Type.get(), fFloat4_Type.get() }))
+    , fGenDType_Type(new Type(String("$genDType"), { fDouble_Type.get(), fDouble2_Type.get(),
+                                                     fDouble3_Type.get(), fDouble4_Type.get() }))
+    , fGenIType_Type(new Type(String("$genIType"), { fInt_Type.get(), fInt2_Type.get(),
+                                                     fInt3_Type.get(), fInt4_Type.get() }))
+    , fGenUType_Type(new Type(String("$genUType"), { fUInt_Type.get(), fUInt2_Type.get(),
+                                                     fUInt3_Type.get(), fUInt4_Type.get() }))
+    , fGenBType_Type(new Type(String("$genBType"), { fBool_Type.get(), fBool2_Type.get(),
+                                                     fBool3_Type.get(), fBool4_Type.get() }))
+    , fMat_Type(new Type(String("$mat"), { fFloat2x2_Type.get(),  fFloat2x3_Type.get(),
+                                           fFloat2x4_Type.get(),  fFloat3x2_Type.get(),
+                                           fFloat3x3_Type.get(),  fFloat3x4_Type.get(),
+                                           fFloat4x2_Type.get(),  fFloat4x3_Type.get(),
+                                           fFloat4x4_Type.get(),  fDouble2x2_Type.get(),
+                                           fDouble2x3_Type.get(), fDouble2x4_Type.get(),
+                                           fDouble3x2_Type.get(), fDouble3x3_Type.get(),
+                                           fDouble3x4_Type.get(), fDouble4x2_Type.get(),
+                                           fDouble4x3_Type.get(), fDouble4x4_Type.get() }))
+    , fVec_Type(new Type(String("$vec"), { fInvalid_Type.get(), fFloat2_Type.get(),
+                                           fFloat3_Type.get(), fFloat4_Type.get() }))
     , fGVec_Type(new Type(String("$gvec")))
-    , fGVec2_Type(new Type(String("$gvec2")))
-    , fGVec3_Type(new Type(String("$gvec3")))
-    , fGVec4_Type(new Type(String("$gvec4"), static_type(*fVec4_Type)))
-    , fDVec_Type(new Type(String("$dvec"), { fInvalid_Type.get(), fDVec2_Type.get(),
-                                              fDVec3_Type.get(), fDVec4_Type.get() }))
-    , fIVec_Type(new Type(String("$ivec"), { fInvalid_Type.get(), fIVec2_Type.get(),
-                                               fIVec3_Type.get(), fIVec4_Type.get() }))
-    , fUVec_Type(new Type(String("$uvec"), { fInvalid_Type.get(), fUVec2_Type.get(),
-                                               fUVec3_Type.get(), fUVec4_Type.get() }))
-    , fBVec_Type(new Type(String("$bvec"), { fInvalid_Type.get(), fBVec2_Type.get(),
-                                               fBVec3_Type.get(), fBVec4_Type.get() }))
+    , fGVec2_Type(new Type(String("$gfloat2")))
+    , fGVec3_Type(new Type(String("$gfloat3")))
+    , fGVec4_Type(new Type(String("$gfloat4"), static_type(*fFloat4_Type)))
+    , fDVec_Type(new Type(String("$dvec"), { fInvalid_Type.get(), fDouble2_Type.get(),
+                                             fDouble3_Type.get(), fDouble4_Type.get() }))
+    , fIVec_Type(new Type(String("$ivec"), { fInvalid_Type.get(), fInt2_Type.get(),
+                                             fInt3_Type.get(), fInt4_Type.get() }))
+    , fUVec_Type(new Type(String("$uvec"), { fInvalid_Type.get(), fUInt2_Type.get(),
+                                             fUInt3_Type.get(), fUInt4_Type.get() }))
+    , fBVec_Type(new Type(String("$bvec"), { fInvalid_Type.get(), fBool2_Type.get(),
+                                             fBool3_Type.get(), fBool4_Type.get() }))
     , fSkCaps_Type(new Type(String("$sk_Caps")))
     , fSkArgs_Type(new Type(String("$sk_Args")))
     , fColorSpaceXform_Type(new Type(String("colorSpaceXform"), *fFloat_Type, 4, 4))
@@ -162,49 +162,49 @@
     const std::unique_ptr<Type> fVoid_Type;
 
     const std::unique_ptr<Type> fDouble_Type;
-    const std::unique_ptr<Type> fDVec2_Type;
-    const std::unique_ptr<Type> fDVec3_Type;
-    const std::unique_ptr<Type> fDVec4_Type;
+    const std::unique_ptr<Type> fDouble2_Type;
+    const std::unique_ptr<Type> fDouble3_Type;
+    const std::unique_ptr<Type> fDouble4_Type;
 
     const std::unique_ptr<Type> fFloat_Type;
-    const std::unique_ptr<Type> fVec2_Type;
-    const std::unique_ptr<Type> fVec3_Type;
-    const std::unique_ptr<Type> fVec4_Type;
+    const std::unique_ptr<Type> fFloat2_Type;
+    const std::unique_ptr<Type> fFloat3_Type;
+    const std::unique_ptr<Type> fFloat4_Type;
 
     const std::unique_ptr<Type> fUInt_Type;
-    const std::unique_ptr<Type> fUVec2_Type;
-    const std::unique_ptr<Type> fUVec3_Type;
-    const std::unique_ptr<Type> fUVec4_Type;
+    const std::unique_ptr<Type> fUInt2_Type;
+    const std::unique_ptr<Type> fUInt3_Type;
+    const std::unique_ptr<Type> fUInt4_Type;
 
     const std::unique_ptr<Type> fInt_Type;
-    const std::unique_ptr<Type> fIVec2_Type;
-    const std::unique_ptr<Type> fIVec3_Type;
-    const std::unique_ptr<Type> fIVec4_Type;
+    const std::unique_ptr<Type> fInt2_Type;
+    const std::unique_ptr<Type> fInt3_Type;
+    const std::unique_ptr<Type> fInt4_Type;
 
     const std::unique_ptr<Type> fBool_Type;
-    const std::unique_ptr<Type> fBVec2_Type;
-    const std::unique_ptr<Type> fBVec3_Type;
-    const std::unique_ptr<Type> fBVec4_Type;
+    const std::unique_ptr<Type> fBool2_Type;
+    const std::unique_ptr<Type> fBool3_Type;
+    const std::unique_ptr<Type> fBool4_Type;
 
-    const std::unique_ptr<Type> fMat2x2_Type;
-    const std::unique_ptr<Type> fMat2x3_Type;
-    const std::unique_ptr<Type> fMat2x4_Type;
-    const std::unique_ptr<Type> fMat3x2_Type;
-    const std::unique_ptr<Type> fMat3x3_Type;
-    const std::unique_ptr<Type> fMat3x4_Type;
-    const std::unique_ptr<Type> fMat4x2_Type;
-    const std::unique_ptr<Type> fMat4x3_Type;
-    const std::unique_ptr<Type> fMat4x4_Type;
+    const std::unique_ptr<Type> fFloat2x2_Type;
+    const std::unique_ptr<Type> fFloat2x3_Type;
+    const std::unique_ptr<Type> fFloat2x4_Type;
+    const std::unique_ptr<Type> fFloat3x2_Type;
+    const std::unique_ptr<Type> fFloat3x3_Type;
+    const std::unique_ptr<Type> fFloat3x4_Type;
+    const std::unique_ptr<Type> fFloat4x2_Type;
+    const std::unique_ptr<Type> fFloat4x3_Type;
+    const std::unique_ptr<Type> fFloat4x4_Type;
 
-    const std::unique_ptr<Type> fDMat2x2_Type;
-    const std::unique_ptr<Type> fDMat2x3_Type;
-    const std::unique_ptr<Type> fDMat2x4_Type;
-    const std::unique_ptr<Type> fDMat3x2_Type;
-    const std::unique_ptr<Type> fDMat3x3_Type;
-    const std::unique_ptr<Type> fDMat3x4_Type;
-    const std::unique_ptr<Type> fDMat4x2_Type;
-    const std::unique_ptr<Type> fDMat4x3_Type;
-    const std::unique_ptr<Type> fDMat4x4_Type;
+    const std::unique_ptr<Type> fDouble2x2_Type;
+    const std::unique_ptr<Type> fDouble2x3_Type;
+    const std::unique_ptr<Type> fDouble2x4_Type;
+    const std::unique_ptr<Type> fDouble3x2_Type;
+    const std::unique_ptr<Type> fDouble3x3_Type;
+    const std::unique_ptr<Type> fDouble3x4_Type;
+    const std::unique_ptr<Type> fDouble4x2_Type;
+    const std::unique_ptr<Type> fDouble4x3_Type;
+    const std::unique_ptr<Type> fDouble4x4_Type;
 
     const std::unique_ptr<Type> fSampler1D_Type;
     const std::unique_ptr<Type> fSampler2D_Type;
diff --git a/src/sksl/SkSLGLSLCodeGenerator.cpp b/src/sksl/SkSLGLSLCodeGenerator.cpp
index 4d3d3e3..330f145 100644
--- a/src/sksl/SkSLGLSLCodeGenerator.cpp
+++ b/src/sksl/SkSLGLSLCodeGenerator.cpp
@@ -75,7 +75,54 @@
         fIndentation--;
         this->write("}");
     } else {
-        this->write(type.name());
+        switch (type.kind()) {
+            case Type::kVector_Kind: {
+                Type component = type.componentType();
+                if (component == *fContext.fFloat_Type) {
+                    this->write("vec");
+                }
+                else if (component == *fContext.fDouble_Type) {
+                    this->write("dvec");
+                }
+                else if (component == *fContext.fInt_Type) {
+                    this->write("ivec");
+                }
+                else if (component == *fContext.fUInt_Type) {
+                    this->write("uvec");
+                }
+                else if (component == *fContext.fBool_Type) {
+                    this->write("bvec");
+                }
+                this->write(to_string(type.columns()));
+                break;
+            }
+            case Type::kMatrix_Kind: {
+                Type component = type.componentType();
+                if (component == *fContext.fFloat_Type) {
+                    this->write("mat");
+                }
+                else if (component == *fContext.fDouble_Type) {
+                    this->write("dmat");
+                }
+                this->write(to_string(type.columns()));
+                if (type.columns() != type.rows()) {
+                    this->write("x");
+                    this->write(to_string(type.rows()));
+                }
+                break;
+            }
+            case Type::kArray_Kind: {
+                this->writeType(type.componentType());
+                this->write("[");
+                if (type.columns() != -1) {
+                    this->write(to_string(type.columns()));
+                }
+                this->write("]");
+                break;
+            }
+            default:
+                this->write(type.name());
+        }
     }
 }
 
@@ -196,25 +243,25 @@
                 if (c.fArguments[1]->fType == *fContext.fFloat_Type) {
                     proj = false;
                 } else {
-                    ASSERT(c.fArguments[1]->fType == *fContext.fVec2_Type);
+                    ASSERT(c.fArguments[1]->fType == *fContext.fFloat2_Type);
                     proj = true;
                 }
                 break;
             case SpvDim2D:
                 dim = "2D";
-                if (c.fArguments[1]->fType == *fContext.fVec2_Type) {
+                if (c.fArguments[1]->fType == *fContext.fFloat2_Type) {
                     proj = false;
                 } else {
-                    ASSERT(c.fArguments[1]->fType == *fContext.fVec3_Type);
+                    ASSERT(c.fArguments[1]->fType == *fContext.fFloat3_Type);
                     proj = true;
                 }
                 break;
             case SpvDim3D:
                 dim = "3D";
-                if (c.fArguments[1]->fType == *fContext.fVec3_Type) {
+                if (c.fArguments[1]->fType == *fContext.fFloat3_Type) {
                     proj = false;
                 } else {
-                    ASSERT(c.fArguments[1]->fType == *fContext.fVec4_Type);
+                    ASSERT(c.fArguments[1]->fType == *fContext.fFloat4_Type);
                     proj = true;
                 }
                 break;
@@ -259,7 +306,8 @@
 }
 
 void GLSLCodeGenerator::writeConstructor(const Constructor& c) {
-    this->write(c.fType.name() + "(");
+    this->writeType(c.fType);
+    this->write("(");
     const char* separator = "";
     for (const auto& arg : c.fArguments) {
         this->write(separator);
@@ -292,7 +340,7 @@
             // The Adreno compiler seems to be very touchy about access to "gl_FragCoord".
             // Accessing glFragCoord.zw can cause a program to fail to link. Additionally,
             // depending on the surrounding code, accessing .xy with a uniform involved can
-            // do the same thing. Copying gl_FragCoord.xy into a temp vec2 beforehand
+            // do the same thing. Copying gl_FragCoord.xy into a temp float2beforehand
             // (and only accessing .xy) seems to "fix" things.
             const char* precision = fProgram.fSettings.fCaps->usesPrecisionModifiers() ? "highp "
                                                                                        : "";
diff --git a/src/sksl/SkSLGLSLCodeGenerator.h b/src/sksl/SkSLGLSLCodeGenerator.h
index 6fe25d3..115d89a 100644
--- a/src/sksl/SkSLGLSLCodeGenerator.h
+++ b/src/sksl/SkSLGLSLCodeGenerator.h
@@ -96,7 +96,7 @@
 
     virtual void writePrecisionModifier();
 
-    void writeType(const Type& type);
+    virtual void writeType(const Type& type);
 
     void writeExtension(const Extension& ext);
 
diff --git a/src/sksl/SkSLHCodeGenerator.cpp b/src/sksl/SkSLHCodeGenerator.cpp
index 13f6cd3..65dbf78 100644
--- a/src/sksl/SkSLHCodeGenerator.cpp
+++ b/src/sksl/SkSLHCodeGenerator.cpp
@@ -23,13 +23,13 @@
 , fSectionAndParameterHelper(*program, *errors) {}
 
 String HCodeGenerator::ParameterType(const Type& type) {
-    if (type.fName == "vec2") {
+    if (type.fName == "float2") {
         return "SkPoint";
-    } else if (type.fName == "ivec4") {
+    } else if (type.fName == "int4") {
         return "SkIRect";
-    } else if (type.fName == "vec4") {
+    } else if (type.fName == "float4") {
         return "SkRect";
-    } else if (type.fName == "mat4") {
+    } else if (type.fName == "float4x4") {
         return "SkMatrix44";
     } else if (type.kind() == Type::kSampler_Kind) {
         return "sk_sp<GrTextureProxy>";
diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp
index 22e2642..3604cd9 100644
--- a/src/sksl/SkSLIRGenerator.cpp
+++ b/src/sksl/SkSLIRGenerator.cpp
@@ -923,7 +923,7 @@
         ASSERT(ctor);
         return this->call(Position(), std::move(ctor), std::move(args));
     }
-    if (type == *fContext.fColorSpaceXform_Type && expr->fType == *fContext.fMat4x4_Type) {
+    if (type == *fContext.fColorSpaceXform_Type && expr->fType == *fContext.fFloat4x4_Type) {
         return expr;
     }
     std::vector<std::unique_ptr<Expression>> args;
@@ -1290,10 +1290,10 @@
 }
 
 // scales the texture coordinates by the texture size for sampling rectangle textures.
-// For vec2 coordinates, implements the transformation:
+// For float2coordinates, implements the transformation:
 //     texture(sampler, coord) -> texture(sampler, textureSize(sampler) * coord)
-// For vec3 coordinates, implements the transformation:
-//     texture(sampler, coord) -> texture(sampler, vec3(textureSize(sampler), 1.0) * coord))
+// For float3coordinates, implements the transformation:
+//     texture(sampler, coord) -> texture(sampler, float3textureSize(sampler), 1.0) * coord))
 void IRGenerator::fixRectSampling(std::vector<std::unique_ptr<Expression>>& arguments) {
     ASSERT(arguments.size() == 2);
     ASSERT(arguments[0]->fType == *fContext.fSampler2DRect_Type);
@@ -1304,17 +1304,17 @@
     const FunctionDeclaration& textureSize = (FunctionDeclaration&) *textureSizeSymbol;
     std::vector<std::unique_ptr<Expression>> sizeArguments;
     sizeArguments.emplace_back(new VariableReference(Position(), sampler));
-    std::unique_ptr<Expression> vec2Size = call(Position(), textureSize, std::move(sizeArguments));
+    std::unique_ptr<Expression> float2ize = call(Position(), textureSize, std::move(sizeArguments));
     const Type& type = arguments[1]->fType;
     std::unique_ptr<Expression> scale;
-    if (type == *fContext.fVec2_Type) {
-        scale = std::move(vec2Size);
+    if (type == *fContext.fFloat2_Type) {
+        scale = std::move(float2ize);
     } else {
-        ASSERT(type == *fContext.fVec3_Type);
-        std::vector<std::unique_ptr<Expression>> vec3Arguments;
-        vec3Arguments.push_back(std::move(vec2Size));
-        vec3Arguments.emplace_back(new FloatLiteral(fContext, Position(), 1.0));
-        scale.reset(new Constructor(Position(), *fContext.fVec3_Type, std::move(vec3Arguments)));
+        ASSERT(type == *fContext.fFloat3_Type);
+        std::vector<std::unique_ptr<Expression>> float3rguments;
+        float3rguments.push_back(std::move(float2ize));
+        float3rguments.emplace_back(new FloatLiteral(fContext, Position(), 1.0));
+        scale.reset(new Constructor(Position(), *fContext.fFloat3_Type, std::move(float3rguments)));
     }
     arguments[1].reset(new BinaryExpression(Position(), std::move(scale), Token::STAR,
                                             std::move(arguments[1]), type));
diff --git a/src/sksl/SkSLSPIRVCodeGenerator.cpp b/src/sksl/SkSLSPIRVCodeGenerator.cpp
index 0e550b1..1f8f224 100644
--- a/src/sksl/SkSLSPIRVCodeGenerator.cpp
+++ b/src/sksl/SkSLSPIRVCodeGenerator.cpp
@@ -1333,7 +1333,7 @@
             std::vector<std::unique_ptr<Expression>> args;
             args.emplace_back(new FloatLiteral(fContext, Position(), 0.0));
             args.emplace_back(new FloatLiteral(fContext, Position(), 0.0));
-            Constructor ctor(Position(), *fContext.fVec2_Type, std::move(args));
+            Constructor ctor(Position(), *fContext.fFloat2_Type, std::move(args));
             SpvId coords = this->writeConstantVector(ctor);
             if (1 == c.fArguments.size()) {
                 this->writeInstruction(SpvOpImageRead,
@@ -1376,24 +1376,24 @@
             SpvOp_ op = SpvOpImageSampleImplicitLod;
             switch (c.fArguments[0]->fType.dimensions()) {
                 case SpvDim1D:
-                    if (c.fArguments[1]->fType == *fContext.fVec2_Type) {
+                    if (c.fArguments[1]->fType == *fContext.fFloat2_Type) {
                         op = SpvOpImageSampleProjImplicitLod;
                     } else {
                         ASSERT(c.fArguments[1]->fType == *fContext.fFloat_Type);
                     }
                     break;
                 case SpvDim2D:
-                    if (c.fArguments[1]->fType == *fContext.fVec3_Type) {
+                    if (c.fArguments[1]->fType == *fContext.fFloat3_Type) {
                         op = SpvOpImageSampleProjImplicitLod;
                     } else {
-                        ASSERT(c.fArguments[1]->fType == *fContext.fVec2_Type);
+                        ASSERT(c.fArguments[1]->fType == *fContext.fFloat2_Type);
                     }
                     break;
                 case SpvDim3D:
-                    if (c.fArguments[1]->fType == *fContext.fVec4_Type) {
+                    if (c.fArguments[1]->fType == *fContext.fFloat4_Type) {
                         op = SpvOpImageSampleProjImplicitLod;
                     } else {
-                        ASSERT(c.fArguments[1]->fType == *fContext.fVec3_Type);
+                        ASSERT(c.fArguments[1]->fType == *fContext.fFloat3_Type);
                     }
                     break;
                 case SpvDimCube:   // fall through
@@ -1935,8 +1935,8 @@
         // a virtual vector out of the concatenation of the left and right vectors, and then
         // select components from this virtual vector to make the result vector. For
         // instance, given:
-        // vec3 L = ...;
-        // vec3 R = ...;
+        // float3L = ...;
+        // float3R = ...;
         // L.xz = R.xy;
         // we end up with the virtual vector (L.x, L.y, L.z, R.x, R.y, R.z). Then we want
         // our result vector to look like (R.x, L.y, R.y), so we need to select indices
@@ -2083,7 +2083,7 @@
             fRTHeightFieldIndex = 0;
         }
         ASSERT(fRTHeightFieldIndex != (SpvId) -1);
-        // write vec4(gl_FragCoord.x, u_skRTHeight - gl_FragCoord.y, 0.0, 1.0)
+        // write float4(gl_FragCoord.x, u_skRTHeight - gl_FragCoord.y, 0.0, 1.0)
         SpvId xId = this->nextId();
         this->writeInstruction(SpvOpCompositeExtract, this->getType(*fContext.fFloat_Type), xId,
                                result, 0, out);
@@ -2110,7 +2110,7 @@
         SpvId oneId = writeFloatLiteral(one);
         SpvId flipped = this->nextId();
         this->writeOpCode(SpvOpCompositeConstruct, 7, out);
-        this->writeWord(this->getType(*fContext.fVec4_Type), out);
+        this->writeWord(this->getType(*fContext.fFloat4_Type), out);
         this->writeWord(flipped, out);
         this->writeWord(xId, out);
         this->writeWord(flippedYId, out);
@@ -2266,7 +2266,7 @@
     }
     // component type we are operating on: float, int, uint
     const Type* operandType;
-    // IR allows mismatched types in expressions (e.g. vec2 * float), but they need special handling
+    // IR allows mismatched types in expressions (e.g. float2* float), but they need special handling
     // in SPIR-V
     if (b.fLeft->fType != b.fRight->fType) {
         if (b.fLeft->fType.kind() == Type::kVector_Kind &&
diff --git a/src/sksl/ast/SkSLASTInterfaceBlock.h b/src/sksl/ast/SkSLASTInterfaceBlock.h
index e727ae9..f111f73 100644
--- a/src/sksl/ast/SkSLASTInterfaceBlock.h
+++ b/src/sksl/ast/SkSLASTInterfaceBlock.h
@@ -17,7 +17,7 @@
  * An interface block, as in:
  *
  * out gl_PerVertex {
- *   layout(builtin=0) vec4 gl_Position;
+ *   layout(builtin=0) float4 gl_Position;
  *   layout(builtin=1) float gl_PointSize;
  * };
  */
diff --git a/src/sksl/ir/SkSLConstructor.h b/src/sksl/ir/SkSLConstructor.h
index 05f4096..beed0f7 100644
--- a/src/sksl/ir/SkSLConstructor.h
+++ b/src/sksl/ir/SkSLConstructor.h
@@ -16,7 +16,7 @@
 namespace SkSL {
 
 /**
- * Represents the construction of a compound type, such as "vec2(x, y)".
+ * Represents the construction of a compound type, such as "float2x, y)".
  *
  * Vector constructors will always consist of either exactly 1 scalar, or a collection of vectors
  * and scalars totalling exactly the right number of scalar components.
diff --git a/src/sksl/ir/SkSLIndexExpression.h b/src/sksl/ir/SkSLIndexExpression.h
index 49633b6..c305365 100644
--- a/src/sksl/ir/SkSLIndexExpression.h
+++ b/src/sksl/ir/SkSLIndexExpression.h
@@ -21,17 +21,17 @@
     if (type.kind() == Type::kMatrix_Kind) {
         if (type.componentType() == *context.fFloat_Type) {
             switch (type.rows()) {
-                case 2: return *context.fVec2_Type;
-                case 3: return *context.fVec3_Type;
-                case 4: return *context.fVec4_Type;
+                case 2: return *context.fFloat2_Type;
+                case 3: return *context.fFloat3_Type;
+                case 4: return *context.fFloat4_Type;
                 default: ASSERT(false);
             }
         } else {
             ASSERT(type.componentType() == *context.fDouble_Type);
             switch (type.rows()) {
-                case 2: return *context.fDVec2_Type;
-                case 3: return *context.fDVec3_Type;
-                case 4: return *context.fDVec4_Type;
+                case 2: return *context.fDouble2_Type;
+                case 3: return *context.fDouble3_Type;
+                case 4: return *context.fDouble4_Type;
                 default: ASSERT(false);
             }
         }
diff --git a/src/sksl/ir/SkSLInterfaceBlock.h b/src/sksl/ir/SkSLInterfaceBlock.h
index fc6ccec..a28a6a1 100644
--- a/src/sksl/ir/SkSLInterfaceBlock.h
+++ b/src/sksl/ir/SkSLInterfaceBlock.h
@@ -18,7 +18,7 @@
  * An interface block, as in:
  *
  * out gl_PerVertex {
- *   layout(builtin=0) vec4 gl_Position;
+ *   layout(builtin=0) float4 gl_Position;
  *   layout(builtin=1) float gl_PointSize;
  * };
  *
diff --git a/src/sksl/ir/SkSLSwizzle.h b/src/sksl/ir/SkSLSwizzle.h
index 442e92f..9d7ca37 100644
--- a/src/sksl/ir/SkSLSwizzle.h
+++ b/src/sksl/ir/SkSLSwizzle.h
@@ -18,8 +18,8 @@
 
 /**
  * Given a type and a swizzle component count, returns the type that will result from swizzling. For
- * instance, swizzling a vec3 with two components will result in a vec2. It is possible to swizzle
- * with more components than the source vector, as in 'vec2(1).xxxx'.
+ * instance, swizzling a float3with two components will result in a float2 It is possible to swizzle
+ * with more components than the source vector, as in 'float21).xxxx'.
  */
 static const Type& get_type(const Context& context, Expression& value, size_t count) {
     const Type& base = value.fType.componentType();
@@ -28,40 +28,40 @@
     }
     if (base == *context.fFloat_Type) {
         switch (count) {
-            case 2: return *context.fVec2_Type;
-            case 3: return *context.fVec3_Type;
-            case 4: return *context.fVec4_Type;
+            case 2: return *context.fFloat2_Type;
+            case 3: return *context.fFloat3_Type;
+            case 4: return *context.fFloat4_Type;
         }
     } else if (base == *context.fDouble_Type) {
         switch (count) {
-            case 2: return *context.fDVec2_Type;
-            case 3: return *context.fDVec3_Type;
-            case 4: return *context.fDVec4_Type;
+            case 2: return *context.fDouble2_Type;
+            case 3: return *context.fDouble3_Type;
+            case 4: return *context.fDouble4_Type;
         }
     } else if (base == *context.fInt_Type) {
         switch (count) {
-            case 2: return *context.fIVec2_Type;
-            case 3: return *context.fIVec3_Type;
-            case 4: return *context.fIVec4_Type;
+            case 2: return *context.fInt2_Type;
+            case 3: return *context.fInt3_Type;
+            case 4: return *context.fInt4_Type;
         }
     } else if (base == *context.fUInt_Type) {
         switch (count) {
-            case 2: return *context.fUVec2_Type;
-            case 3: return *context.fUVec3_Type;
-            case 4: return *context.fUVec4_Type;
+            case 2: return *context.fUInt2_Type;
+            case 3: return *context.fUInt3_Type;
+            case 4: return *context.fUInt4_Type;
         }
     } else if (base == *context.fBool_Type) {
         switch (count) {
-            case 2: return *context.fBVec2_Type;
-            case 3: return *context.fBVec3_Type;
-            case 4: return *context.fBVec4_Type;
+            case 2: return *context.fBool2_Type;
+            case 3: return *context.fBool3_Type;
+            case 4: return *context.fBool4_Type;
         }
     }
     ABORT("cannot swizzle %s\n", value.description().c_str());
 }
 
 /**
- * Represents a vector swizzle operation such as 'vec2(1, 2, 3).zyx'.
+ * Represents a vector swizzle operation such as 'float21, 2, 3).zyx'.
  */
 struct Swizzle : public Expression {
     Swizzle(const Context& context, std::unique_ptr<Expression> base, std::vector<int> components)
@@ -74,7 +74,7 @@
     std::unique_ptr<Expression> constantPropagate(const IRGenerator& irGenerator,
                                                   const DefinitionMap& definitions) override {
         if (fBase->fKind == Expression::kConstructor_Kind && fBase->isConstant()) {
-            // we're swizzling a constant vector, e.g. vec4(1).x. Simplify it.
+            // we're swizzling a constant vector, e.g. float4(1).x. Simplify it.
             ASSERT(fBase->fKind == Expression::kConstructor_Kind);
             if (fType == *irGenerator.fContext.fInt_Type) {
                 ASSERT(fComponents.size() == 1);
diff --git a/src/sksl/ir/SkSLType.cpp b/src/sksl/ir/SkSLType.cpp
index 7516377..60d40cd 100644
--- a/src/sksl/ir/SkSLType.cpp
+++ b/src/sksl/ir/SkSLType.cpp
@@ -46,30 +46,30 @@
         switch (rows) {
             case 1:
                 switch (columns) {
-                    case 2: return *context.fVec2_Type;
-                    case 3: return *context.fVec3_Type;
-                    case 4: return *context.fVec4_Type;
+                    case 2: return *context.fFloat2_Type;
+                    case 3: return *context.fFloat3_Type;
+                    case 4: return *context.fFloat4_Type;
                     default: ABORT("unsupported vector column count (%d)", columns);
                 }
             case 2:
                 switch (columns) {
-                    case 2: return *context.fMat2x2_Type;
-                    case 3: return *context.fMat3x2_Type;
-                    case 4: return *context.fMat4x2_Type;
+                    case 2: return *context.fFloat2x2_Type;
+                    case 3: return *context.fFloat3x2_Type;
+                    case 4: return *context.fFloat4x2_Type;
                     default: ABORT("unsupported matrix column count (%d)", columns);
                 }
             case 3:
                 switch (columns) {
-                    case 2: return *context.fMat2x3_Type;
-                    case 3: return *context.fMat3x3_Type;
-                    case 4: return *context.fMat4x3_Type;
+                    case 2: return *context.fFloat2x3_Type;
+                    case 3: return *context.fFloat3x3_Type;
+                    case 4: return *context.fFloat4x3_Type;
                     default: ABORT("unsupported matrix column count (%d)", columns);
                 }
             case 4:
                 switch (columns) {
-                    case 2: return *context.fMat2x4_Type;
-                    case 3: return *context.fMat3x4_Type;
-                    case 4: return *context.fMat4x4_Type;
+                    case 2: return *context.fFloat2x4_Type;
+                    case 3: return *context.fFloat3x4_Type;
+                    case 4: return *context.fFloat4x4_Type;
                     default: ABORT("unsupported matrix column count (%d)", columns);
                 }
             default: ABORT("unsupported row count (%d)", rows);
@@ -78,30 +78,30 @@
         switch (rows) {
             case 1:
                 switch (columns) {
-                    case 2: return *context.fDVec2_Type;
-                    case 3: return *context.fDVec3_Type;
-                    case 4: return *context.fDVec4_Type;
+                    case 2: return *context.fDouble2_Type;
+                    case 3: return *context.fDouble3_Type;
+                    case 4: return *context.fDouble4_Type;
                     default: ABORT("unsupported vector column count (%d)", columns);
                 }
             case 2:
                 switch (columns) {
-                    case 2: return *context.fDMat2x2_Type;
-                    case 3: return *context.fDMat3x2_Type;
-                    case 4: return *context.fDMat4x2_Type;
+                    case 2: return *context.fDouble2x2_Type;
+                    case 3: return *context.fDouble3x2_Type;
+                    case 4: return *context.fDouble4x2_Type;
                     default: ABORT("unsupported matrix column count (%d)", columns);
                 }
             case 3:
                 switch (columns) {
-                    case 2: return *context.fDMat2x3_Type;
-                    case 3: return *context.fDMat3x3_Type;
-                    case 4: return *context.fDMat4x3_Type;
+                    case 2: return *context.fDouble2x3_Type;
+                    case 3: return *context.fDouble3x3_Type;
+                    case 4: return *context.fDouble4x3_Type;
                     default: ABORT("unsupported matrix column count (%d)", columns);
                 }
             case 4:
                 switch (columns) {
-                    case 2: return *context.fDMat2x4_Type;
-                    case 3: return *context.fDMat3x4_Type;
-                    case 4: return *context.fDMat4x4_Type;
+                    case 2: return *context.fDouble2x4_Type;
+                    case 3: return *context.fDouble3x4_Type;
+                    case 4: return *context.fDouble4x4_Type;
                     default: ABORT("unsupported matrix column count (%d)", columns);
                 }
             default: ABORT("unsupported row count (%d)", rows);
@@ -110,9 +110,9 @@
         switch (rows) {
             case 1:
                 switch (columns) {
-                    case 2: return *context.fIVec2_Type;
-                    case 3: return *context.fIVec3_Type;
-                    case 4: return *context.fIVec4_Type;
+                    case 2: return *context.fInt2_Type;
+                    case 3: return *context.fInt3_Type;
+                    case 4: return *context.fInt4_Type;
                     default: ABORT("unsupported vector column count (%d)", columns);
                 }
             default: ABORT("unsupported row count (%d)", rows);
@@ -121,9 +121,9 @@
         switch (rows) {
             case 1:
                 switch (columns) {
-                    case 2: return *context.fUVec2_Type;
-                    case 3: return *context.fUVec3_Type;
-                    case 4: return *context.fUVec4_Type;
+                    case 2: return *context.fUInt2_Type;
+                    case 3: return *context.fUInt3_Type;
+                    case 4: return *context.fUInt4_Type;
                     default: ABORT("unsupported vector column count (%d)", columns);
                 }
             default: ABORT("unsupported row count (%d)", rows);
@@ -132,9 +132,9 @@
         switch (rows) {
             case 1:
                 switch (columns) {
-                    case 2: return *context.fBVec2_Type;
-                    case 3: return *context.fBVec3_Type;
-                    case 4: return *context.fBVec4_Type;
+                    case 2: return *context.fBool2_Type;
+                    case 3: return *context.fBool3_Type;
+                    case 4: return *context.fBool4_Type;
                     default: ABORT("unsupported vector column count (%d)", columns);
                 }
             default: ABORT("unsupported row count (%d)", rows);
diff --git a/src/sksl/ir/SkSLType.h b/src/sksl/ir/SkSLType.h
index 44bc262..9d12263 100644
--- a/src/sksl/ir/SkSLType.h
+++ b/src/sksl/ir/SkSLType.h
@@ -21,7 +21,7 @@
 class Context;
 
 /**
- * Represents a type, such as int or vec4.
+ * Represents a type, such as int or float4.
  */
 class Type : public Symbol {
 public:
@@ -176,7 +176,7 @@
     }
 
     /**
-     * For matrices and vectors, returns the number of columns (e.g. both mat3 and vec3 return 3).
+     * For matrices and vectors, returns the number of columns (e.g. both mat3 and float3return 3).
      * For scalars, returns 1. For arrays, returns either the size of the array (if known) or -1.
      * For all other types, causes an assertion failure.
      */
diff --git a/src/sksl/sksl.include b/src/sksl/sksl.include
index 18a5516..5d905e3 100644
--- a/src/sksl/sksl.include
+++ b/src/sksl/sksl.include
@@ -104,29 +104,29 @@
 //$genDType frexp($genDType x, out $genIType exp);
 $genType ldexp($genType x, in $genIType exp);
 //$genDType ldexp($genDType x, in $genIType exp);
-uint packUnorm2x16(vec2 v);
-uint packSnorm2x16(vec2 v);
-uint packUnorm4x8(vec4 v);
-uint packSnorm4x8(vec4 v);
-vec2 unpackUnorm2x16(uint p);
-vec2 unpackSnorm2x16(uint p);
-vec4 unpackUnorm4x8(uint p);
-vec4 unpackSnorm4x8(uint p);
-//double packDouble2x32(uvec2 v);
-uvec2 unpackDouble2x32(double v);
-uint packHalf2x16(vec2 v);
-vec2 unpackHalf2x16(uint v);
+uint packUnorm2x16(float2 v);
+uint packSnorm2x16(float2 v);
+uint packUnorm4x8(float4 v);
+uint packSnorm4x8(float4 v);
+float2 unpackUnorm2x16(uint p);
+float2 unpackSnorm2x16(uint p);
+float4 unpackUnorm4x8(uint p);
+float4 unpackSnorm4x8(uint p);
+//double packDouble2x32(uint2 v);
+uint2 unpackDouble2x32(double v);
+uint packHalf2x16(float2 v);
+float2 unpackHalf2x16(uint v);
 float length($genType x);
 //double length($genDType x);
 float distance($genType p0, $genType p1);
 //double distance($genDType p0, $genDType p1);
 float dot($genType x, $genType y);
 //double dot($genDType x, $genDType y);
-vec3 cross(vec3 x, vec3 y);
-//dvec3 cross(dvec3 x, dvec3 y);
+float3 cross(float3 x, float3 y);
+//double3 cross(double3 x, double3 y);
 $genType normalize($genType x);
 //$genDType normalize($genDType x);
-vec4 ftransform();
+float4 ftransform();
 $genType faceforward($genType N, $genType I, $genType Nref);
 //$genDType faceforward($genDType N, $genDType I, $genDType Nref);
 $genType reflect($genType I, $genType N);
@@ -134,30 +134,30 @@
 $genType refract($genType I, $genType N, float eta);
 //$genDType refract($genDType I, $genDType N, float eta);
 $mat matrixCompMult($mat x, $mat y);
-mat2 outerProduct(vec2 c, vec2 r);
-mat3 outerProduct(vec3 c, vec3 r);
-mat4 outerProduct(vec4 c, vec4 r);
-mat2x3 outerProduct(vec3 c, vec2 r);
-mat3x2 outerProduct(vec2 c, vec3 r);
-mat2x4 outerProduct(vec4 c, vec2 r);
-mat4x2 outerProduct(vec2 c, vec4 r);
-mat3x4 outerProduct(vec4 c, vec3 r);
-mat4x3 outerProduct(vec3 c, vec4 r);
-mat2 transpose(mat2 m);
-mat3 transpose(mat3 m);
-mat4 transpose(mat4 m);
-mat2x3 transpose(mat3x2 m);
-mat3x2 transpose(mat2x3 m);
-mat2x4 transpose(mat4x2 m);
-mat4x2 transpose(mat2x4 m);
-mat3x4 transpose(mat4x3 m);
-mat4x3 transpose(mat3x4 m);
-float determinant(mat2 m);
-float determinant(mat3 m);
-float determinant(mat4 m);
-mat2 inverse(mat2 m);
-mat3 inverse(mat3 m);
-mat4 inverse(mat4 m);
+float2x2 outerProduct(float2 c, float2 r);
+float3x3 outerProduct(float3 c, float3 r);
+float4x3 outerProduct(float4 c, float4 r);
+float2x3 outerProduct(float3 c, float2 r);
+float3x2 outerProduct(float2 c, float3 r);
+float2x4 outerProduct(float4 c, float2 r);
+float4x2 outerProduct(float2 c, float4 r);
+float3x4 outerProduct(float4 c, float3 r);
+float4x3 outerProduct(float3 c, float4 r);
+float2x2 transpose(float2x2 m);
+float3x3 transpose(float3x3 m);
+float4x4 transpose(float4x4 m);
+float2x3 transpose(float3x2 m);
+float3x2 transpose(float2x3 m);
+float2x4 transpose(float4x2 m);
+float4x2 transpose(float2x4 m);
+float3x4 transpose(float4x3 m);
+float4x3 transpose(float3x4 m);
+float determinant(float2x2 m);
+float determinant(float3x3 m);
+float determinant(float4x4 m);
+float2x2 inverse(float2x2 m);
+float3x3 inverse(float3x3 m);
+float4x4 inverse(float4x4 m);
 $bvec lessThan($vec x, $vec y);
 $bvec lessThan($ivec x, $ivec y);
 $bvec lessThan($uvec x, $uvec y);
@@ -201,38 +201,38 @@
 $genIType bitfieldReverse($genIType value);
 //$genUType bitfieldReverse($genUType value);
 int textureSize($gsampler1D sampler, int lod);
-ivec2 textureSize($gsampler2D sampler, int lod);
-ivec3 textureSize($gsampler3D sampler, int lod);
-ivec2 textureSize($gsamplerCube sampler, int lod);
+int2 textureSize($gsampler2D sampler, int lod);
+int3 textureSize($gsampler3D sampler, int lod);
+int2 textureSize($gsamplerCube sampler, int lod);
 int textureSize(sampler1DShadow sampler, int lod);
-ivec2 textureSize(sampler2DShadow sampler, int lod);
-ivec2 textureSize(samplerCubeShadow sampler, int lod);
-ivec3 textureSize($gsamplerCubeArray sampler, int lod);
-ivec3 textureSize(samplerCubeArrayShadow sampler, int lod);
+int2 textureSize(sampler2DShadow sampler, int lod);
+int2 textureSize(samplerCubeShadow sampler, int lod);
+int3 textureSize($gsamplerCubeArray sampler, int lod);
+int3 textureSize(samplerCubeArrayShadow sampler, int lod);
 */
-ivec2 textureSize($gsampler2DRect sampler);
+int2 textureSize($gsampler2DRect sampler);
 /*
-ivec2 textureSize(sampler2DRectShadow sampler);
-ivec2 textureSize($gsampler1DArray sampler, int lod);
-ivec3 textureSize($gsampler2DArray sampler, int lod);
-ivec2 textureSize(sampler1DArrayShadow sampler, int lod);
-ivec3 textureSize(sampler2DArrayShadow sampler, int lod);
+int2 textureSize(sampler2DRectShadow sampler);
+int2 textureSize($gsampler1DArray sampler, int lod);
+int3 textureSize($gsampler2DArray sampler, int lod);
+int2 textureSize(sampler1DArrayShadow sampler, int lod);
+int3 textureSize(sampler2DArrayShadow sampler, int lod);
 int textureSize($gsamplerBuffer sampler);
-ivec2 textureSize($gsampler2DMS sampler);
-ivec3 textureSize($gsampler2DMSArray sampler);
-vec2 textureQueryLod($gsampler1D sampler, float P);
-vec2 textureQueryLod($gsampler2D sampler, vec2 P);
-vec2 textureQueryLod($gsampler3D sampler, vec3 P);
-vec2 textureQueryLod($gsamplerCube sampler, vec3 P);
-vec2 textureQueryLod($gsampler1DArray sampler, float P);
-vec2 textureQueryLod($gsampler2DArray sampler, vec2 P);
-vec2 textureQueryLod($gsamplerCubeArray sampler, vec3 P);
-vec2 textureQueryLod(sampler1DShadow sampler, float P);
-vec2 textureQueryLod(sampler2DShadow sampler, vec2 P);
-vec2 textureQueryLod(samplerCubeShadow sampler, vec3 P);
-vec2 textureQueryLod(sampler1DArrayShadow sampler, float P);
-vec2 textureQueryLod(sampler2DArrayShadow sampler, vec2 P);
-vec2 textureQueryLod(samplerCubeArrayShadow sampler, vec3 P);
+int2 textureSize($gsampler2DMS sampler);
+int3 textureSize($gsampler2DMSArray sampler);
+float2 textureQueryLod($gsampler1D sampler, float P);
+float2 textureQueryLod($gsampler2D sampler, float2 P);
+float2 textureQueryLod($gsampler3D sampler, float3 P);
+float2 textureQueryLod($gsamplerCube sampler, float3 P);
+float2 textureQueryLod($gsampler1DArray sampler, float P);
+float2 textureQueryLod($gsampler2DArray sampler, float2 P);
+float2 textureQueryLod($gsamplerCubeArray sampler, float3 P);
+float2 textureQueryLod(sampler1DShadow sampler, float P);
+float2 textureQueryLod(sampler2DShadow sampler, float2 P);
+float2 textureQueryLod(samplerCubeShadow sampler, float3 P);
+float2 textureQueryLod(sampler1DArrayShadow sampler, float P);
+float2 textureQueryLod(sampler2DArrayShadow sampler, float2 P);
+float2 textureQueryLod(samplerCubeArrayShadow sampler, float3 P);
 int textureQueryLevels($gsampler1D sampler);
 int textureQueryLevels($gsampler2D sampler);
 int textureQueryLevels($gsampler3D sampler);
@@ -248,53 +248,53 @@
 int textureQueryLevels(samplerCubeArrayShadow sampler);
 */
 
-$gvec4 texture($gsampler1D sampler, float P);
-$gvec4 texture($gsampler1D sampler, float P, float bias);
-$gvec4 texture($gsampler2D sampler, vec2 P);
+$gfloat4 texture($gsampler1D sampler, float P);
+$gfloat4 texture($gsampler1D sampler, float P, float bias);
+$gfloat4 texture($gsampler2D sampler, float2 P);
 // The above currently only expand to handle the float/fixed case. So we also declare this integer
 // version of texture().
-ivec4 texture(isampler2D sampler, vec2 P);
-vec4 texture(samplerExternalOES sampler, vec2 P, float bias);
-vec4 texture(samplerExternalOES sampler, vec2 P);
+int4 texture(isampler2D sampler, float2 P);
+float4 texture(samplerExternalOES sampler, float2 P, float bias);
+float4 texture(samplerExternalOES sampler, float2 P);
 
 /*
-$gvec4 texture($gsampler2D sampler, vec2 P, float bias);
-$gvec4 texture($gsampler3D sampler, vec3 P);
-$gvec4 texture($gsampler3D sampler, vec3 P, float bias);
-$gvec4 texture($gsamplerCube sampler, vec3 P);
-$gvec4 texture($gsamplerCube sampler, vec3 P, float bias);
-float texture(sampler1DShadow sampler, vec3 P);
-float texture(sampler1DShadow sampler, vec3 P, float bias);
-float texture(sampler2DShadow sampler, vec3 P);
-float texture(sampler2DShadow sampler, vec3 P, float bias);
-float texture(samplerCubeShadow sampler, vec4 P);
-float texture(samplerCubeShadow sampler, vec4 P, float bias);
-$gvec4 texture($gsampler1DArray sampler, vec2 P);
-$gvec4 texture($gsampler1DArray sampler, vec2 P, float bias);
-$gvec4 texture($gsampler2DArray sampler, vec3 P);
-$gvec4 texture($gsampler2DArray sampler, vec3 P, float bias);
-$gvec4 texture($gsamplerCubeArray sampler, vec4 P);
-$gvec4 texture($gsamplerCubeArray sampler, vec4 P, float bias);
-float texture(sampler1DArrayShadow sampler, vec3 P);
-float texture(sampler1DArrayShadow sampler, vec3 P, float bias);
-float texture(sampler2DArrayShadow sampler, vec4 P);
+$gfloat4 texture($gsampler2D sampler, float2 P, float bias);
+$gfloat4 texture($gsampler3D sampler, float3 P);
+$gfloat4 texture($gsampler3D sampler, float3 P, float bias);
+$gfloat4 texture($gsamplerCube sampler, float3 P);
+$gfloat4 texture($gsamplerCube sampler, float3 P, float bias);
+float texture(sampler1DShadow sampler, float3 P);
+float texture(sampler1DShadow sampler, float3 P, float bias);
+float texture(sampler2DShadow sampler, float3 P);
+float texture(sampler2DShadow sampler, float3 P, float bias);
+float texture(samplerCubeShadow sampler, float4 P);
+float texture(samplerCubeShadow sampler, float4 P, float bias);
+$gfloat4 texture($gsampler1DArray sampler, float2 P);
+$gfloat4 texture($gsampler1DArray sampler, float2 P, float bias);
+$gfloat4 texture($gsampler2DArray sampler, float3 P);
+$gfloat4 texture($gsampler2DArray sampler, float3 P, float bias);
+$gfloat4 texture($gsamplerCubeArray sampler, float4 P);
+$gfloat4 texture($gsamplerCubeArray sampler, float4 P, float bias);
+float texture(sampler1DArrayShadow sampler, float3 P);
+float texture(sampler1DArrayShadow sampler, float3 P, float bias);
+float texture(sampler2DArrayShadow sampler, float4 P);
 */
 
-$gvec4 texture($gsampler2DRect sampler, vec2 P);
-$gvec4 texture($gsampler2DRect sampler, vec3 P);
+$gfloat4 texture($gsampler2DRect sampler, float2 P);
+$gfloat4 texture($gsampler2DRect sampler, float3 P);
 
 /*
-float texture(sampler2DRectShadow sampler, vec3 P);
-float texture($gsamplerCubeArrayShadow sampler, vec4 P, float compare);
+float texture(sampler2DRectShadow sampler, float3 P);
+float texture($gsamplerCubeArrayShadow sampler, float4 P, float compare);
 */
 
 // Currently we do not support the generic types of loading subpassInput so we have some explicit
 // versions that we currently use
-vec4 subpassLoad(subpassInput subpass);
-vec4 subpassLoad(subpassInputMS subpass, int sample);
+float4 subpassLoad(subpassInput subpass);
+float4 subpassLoad(subpassInputMS subpass, int sample);
 /*
-$gvec4 subpassLoad(gsubpassInput subpass);
-$gvec4 subpassLoad(gsubpassInputMS subpass, int sample);
+$gfloat4subpassLoad(gsubpassInput subpass);
+$gfloat4subpassLoad(gsubpassInputMS subpass, int sample);
 */
 )
 
@@ -302,183 +302,183 @@
 
 STRINGIFY(
 
-$gvec4 texture($gsampler1D sampler, vec2 P);
-$gvec4 texture($gsampler1D sampler, vec2 P, float bias);
-$gvec4 texture($gsampler2D sampler, vec3 P);
-$gvec4 texture($gsampler2D sampler, vec3 P, float bias);
+$gfloat4 texture($gsampler1D sampler, float2 P);
+$gfloat4 texture($gsampler1D sampler, float2 P, float bias);
+$gfloat4 texture($gsampler2D sampler, float3 P);
+$gfloat4 texture($gsampler2D sampler, float3 P, float bias);
 /*
-$gvec4 textureProj($gsampler3D sampler, vec4 P);
-$gvec4 textureProj($gsampler3D sampler, vec4 P, float bias);
-float textureProj(sampler1DShadow sampler, vec4 P);
-float textureProj(sampler1DShadow sampler, vec4 P, float bias);
-float textureProj(sampler2DShadow sampler, vec4 P);
-float textureProj(sampler2DShadow sampler, vec4 P, float bias);
-$gvec4 textureProj($gsampler2DRect sampler, vec4 P);
-float textureProj(sampler2DRectShadow sampler, vec4 P);
-$gvec4 textureLod($gsampler1D sampler, float P, float lod);
-$gvec4 textureLod($gsampler2D sampler, vec2 P, float lod);
-$gvec4 textureLod($gsampler3D sampler, vec3 P, float lod);
-$gvec4 textureLod($gsamplerCube sampler, vec3 P, float lod);
-float textureLod(sampler1DShadow sampler, vec3 P, float lod);
-float textureLod(sampler2DShadow sampler, vec3 P, float lod);
-$gvec4 textureLod($gsampler1DArray sampler, vec2 P, float lod);
-$gvec4 textureLod($gsampler2DArray sampler, vec3 P, float lod);
-float textureLod(sampler1DArrayShadow sampler, vec3 P, float lod);
-$gvec4 textureLod($gsamplerCubeArray sampler, vec4 P, float lod);
-$gvec4 textureOffset($gsampler1D sampler, float P, int offset);
-$gvec4 textureOffset($gsampler1D sampler, float P, int offset, float bias);
-$gvec4 textureOffset($gsampler2D sampler, vec2 P, ivec2 offset);
-$gvec4 textureOffset($gsampler2D sampler, vec2 P, ivec2 offset, float bias);
-$gvec4 textureOffset($gsampler3D sampler, vec3 P, ivec3 offset);
-$gvec4 textureOffset($gsampler3D sampler, vec3 P, ivec3 offset, float bias);
-$gvec4 textureOffset($gsampler2DRect sampler, vec2 P, ivec2 offset);
-float textureOffset(sampler2DRectShadow sampler, vec3 P, ivec2 offset);
-float textureOffset(sampler1DShadow sampler, vec3 P, int offset);
-float textureOffset(sampler1DShadow sampler, vec3 P, int offset, float bias);
-float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset);
-float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset, float bias);
-$gvec4 textureOffset($gsampler1DArray sampler, vec2 P, int offset);
-$gvec4 textureOffset($gsampler1DArray sampler, vec2 P, int offset, float bias);
-$gvec4 textureOffset($gsampler2DArray sampler, vec3 P, ivec2 offset);
-$gvec4 textureOffset($gsampler2DArray sampler, vec3 P, ivec2 offset, float bias);
-float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset);
-float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset, float bias);
-float textureOffset(sampler2DArrayShadow sampler, vec4 P, ivec2 offset);
+$gfloat4 textureProj($gsampler3D sampler, float4 P);
+$gfloat4 textureProj($gsampler3D sampler, float4 P, float bias);
+float textureProj(sampler1DShadow sampler, float4 P);
+float textureProj(sampler1DShadow sampler, float4 P, float bias);
+float textureProj(sampler2DShadow sampler, float4 P);
+float textureProj(sampler2DShadow sampler, float4 P, float bias);
+$gfloat4 textureProj($gsampler2DRect sampler, float4 P);
+float textureProj(sampler2DRectShadow sampler, float4 P);
+$gfloat4 textureLod($gsampler1D sampler, float P, float lod);
+$gfloat4 textureLod($gsampler2D sampler, float2 P, float lod);
+$gfloat4 textureLod($gsampler3D sampler, float3 P, float lod);
+$gfloat4 textureLod($gsamplerCube sampler, float3 P, float lod);
+float textureLod(sampler1DShadow sampler, float3 P, float lod);
+float textureLod(sampler2DShadow sampler, float3 P, float lod);
+$gfloat4 textureLod($gsampler1DArray sampler, float2 P, float lod);
+$gfloat4 textureLod($gsampler2DArray sampler, float3 P, float lod);
+float textureLod(sampler1DArrayShadow sampler, float3 P, float lod);
+$gfloat4 textureLod($gsamplerCubeArray sampler, float4 P, float lod);
+$gfloat4 textureOffset($gsampler1D sampler, float P, int offset);
+$gfloat4 textureOffset($gsampler1D sampler, float P, int offset, float bias);
+$gfloat4 textureOffset($gsampler2D sampler, float2 P, int2 offset);
+$gfloat4 textureOffset($gsampler2D sampler, float2 P, int2 offset, float bias);
+$gfloat4 textureOffset($gsampler3D sampler, float3 P, int3 offset);
+$gfloat4 textureOffset($gsampler3D sampler, float3 P, int3 offset, float bias);
+$gfloat4 textureOffset($gsampler2DRect sampler, float2 P, int2 offset);
+float textureOffset(sampler2DRectShadow sampler, float3 P, int2 offset);
+float textureOffset(sampler1DShadow sampler, float3 P, int offset);
+float textureOffset(sampler1DShadow sampler, float3 P, int offset, float bias);
+float textureOffset(sampler2DShadow sampler, float3 P, int2 offset);
+float textureOffset(sampler2DShadow sampler, float3 P, int2 offset, float bias);
+$gfloat4 textureOffset($gsampler1DArray sampler, float2 P, int offset);
+$gfloat4 textureOffset($gsampler1DArray sampler, float2 P, int offset, float bias);
+$gfloat4 textureOffset($gsampler2DArray sampler, float3 P, int2 offset);
+$gfloat4 textureOffset($gsampler2DArray sampler, float3 P, int2 offset, float bias);
+float textureOffset(sampler1DArrayShadow sampler, float3 P, int offset);
+float textureOffset(sampler1DArrayShadow sampler, float3 P, int offset, float bias);
+float textureOffset(sampler2DArrayShadow sampler, float4 P, int2 offset);
 */
-vec4 texelFetch(samplerBuffer sampler, int P);
+float4 texelFetch(samplerBuffer sampler, int P);
 
-$gvec4 texelFetch($gsampler1D sampler, int P, int lod);
-$gvec4 texelFetch($gsampler2D sampler, ivec2 P, int lod);
-$gvec4 texelFetch($gsampler2DRect sampler, ivec2 P);
+$gfloat4 texelFetch($gsampler1D sampler, int P, int lod);
+$gfloat4 texelFetch($gsampler2D sampler, int2 P, int lod);
+$gfloat4 texelFetch($gsampler2DRect sampler, int2 P);
 /*
-$gvec4 texelFetch($gsampler3D sampler, ivec3 P, int lod);
-$gvec4 texelFetch($gsampler1DArray sampler, ivec2 P, int lod);
-$gvec4 texelFetch($gsampler2DArray sampler, ivec3 P, int lod);
-$gvec4 texelFetch($gsampler2DMS sampler, ivec2 P, int sample);
-$gvec4 texelFetch($gsampler2DMSArray sampler, ivec3 P, int sample);
-$gvec4 texelFetchOffset($gsampler1D sampler, int P, int lod, int offset);
-$gvec4 texelFetchOffset($gsampler2D sampler, ivec2 P, int lod, ivec2 offset);
-$gvec4 texelFetchOffset($gsampler3D sampler, ivec3 P, int lod, ivec3 offset);
-$gvec4 texelFetchOffset($gsampler2DRect sampler, ivec2 P, ivec2 offset);
-$gvec4 texelFetchOffset($gsampler1DArray sampler, ivec2 P, int lod, int offset);
-$gvec4 texelFetchOffset($gsampler2DArray sampler, ivec3 P, int lod, ivec2 offset);
-$gvec4 textureProjOffset($gsampler1D sampler, vec2 P, int offset);
-$gvec4 textureProjOffset($gsampler1D sampler, vec2 P, int offset, float bias);
-$gvec4 textureProjOffset($gsampler1D sampler, vec4 P, int offset);
-$gvec4 textureProjOffset($gsampler1D sampler, vec4 P, int offset, float bias);
-$gvec4 textureProjOffset($gsampler2D sampler, vec3 P, ivec2 offset);
-$gvec4 textureProjOffset($gsampler2D sampler, vec3 P, ivec2 offset, float bias);
-$gvec4 textureProjOffset($gsampler2D sampler, vec4 P, ivec2 offset);
-$gvec4 textureProjOffset($gsampler2D sampler, vec4 P, ivec2 offset, float bias);
-$gvec4 textureProjOffset($gsampler3D sampler, vec4 P, ivec3 offset);
-$gvec4 textureProjOffset($gsampler3D sampler, vec4 P, ivec3 offset, float bias);
-$gvec4 textureProjOffset($gsampler2DRect sampler, vec3 P, ivec2 offset);
-$gvec4 textureProjOffset($gsampler2DRect sampler, vec4 P, ivec2 offset);
-float textureProjOffset(sampler2DRectShadow sampler, vec4 P, ivec2 offset);
-float textureProjOffset(sampler1DShadow sampler, vec4 P, int offset);
-float textureProjOffset(sampler1DShadow sampler, vec4 P, int offset, float bias);
-float textureProjOffset(sampler2DShadow sampler, vec4 P, ivec2 offset);
-float textureProjOffset(sampler2DShadow sampler, vec4 P, ivec2 offset, float bias);
-$gvec4 textureLodOffset($gsampler1D sampler, float P, float lod, int offset);
-$gvec4 textureLodOffset($gsampler2D sampler, vec2 P, float lod, ivec2 offset);
-$gvec4 textureLodOffset($gsampler3D sampler, vec3 P, float lod, ivec3 offset);
-float textureLodOffset(sampler1DShadow sampler, vec3 P, float lod, int offset);
-float textureLodOffset(sampler2DShadow sampler, vec3 P, float lod, ivec2 offset);
-$gvec4 textureLodOffset($gsampler1DArray sampler, vec2 P, float lod, int offset);
-$gvec4 textureLodOffset($gsampler2DArray sampler, vec3 P, float lod, ivec2 offset);
-float textureLodOffset(sampler1DArrayShadow sampler, vec3 P, float lod, int offset);
-$gvec4 textureProjLod($gsampler1D sampler, vec2 P, float lod);
-$gvec4 textureProjLod($gsampler1D sampler, vec4 P, float lod);
-$gvec4 textureProjLod($gsampler2D sampler, vec3 P, float lod);
-$gvec4 textureProjLod($gsampler2D sampler, vec4 P, float lod);
-$gvec4 textureProjLod($gsampler3D sampler, vec4 P, float lod);
-float textureProjLod(sampler1DShadow sampler, vec4 P, float lod);
-float textureProjLod(sampler2DShadow sampler, vec4 P, float lod);
-$gvec4 textureProjLodOffset($gsampler1D sampler, vec2 P, float lod, int offset);
-$gvec4 textureProjLodOffset($gsampler1D sampler, vec4 P, float lod, int offset);
-$gvec4 textureProjLodOffset($gsampler2D sampler, vec3 P, float lod, ivec2 offset);
-$gvec4 textureProjLodOffset($gsampler2D sampler, vec4 P, float lod, ivec2 offset);
-$gvec4 textureProjLodOffset($gsampler3D sampler, vec4 P, float lod, ivec3 offset);
-float textureProjLodOffset(sampler1DShadow sampler, vec4 P, float lod, int offset);
-float textureProjLodOffset(sampler2DShadow sampler, vec4 P, float lod, ivec2 offset);
-$gvec4 textureGrad($gsampler1D sampler, float P, float dPdx, float dPdy);
-$gvec4 textureGrad($gsampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy);
-$gvec4 textureGrad($gsampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy);
-$gvec4 textureGrad($gsamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy);
-$gvec4 textureGrad($gsampler2DRect sampler, vec2 P, vec2 dPdx, vec2 dPdy);
-float textureGrad(sampler2DRectShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy);
-float textureGrad(sampler1DShadow sampler, vec3 P, float dPdx, float dPdy);
-float textureGrad(sampler2DShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy);
-float textureGrad(samplerCubeShadow sampler, vec4 P, vec3 dPdx, vec3 dPdy);
-$gvec4 textureGrad($gsampler1DArray sampler, vec2 P, float dPdx, float dPdy);
-$gvec4 textureGrad($gsampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy);
-float textureGrad(sampler1DArrayShadow sampler, vec3 P, float dPdx, float dPdy);
-float textureGrad(sampler2DArrayShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy);
-$gvec4 textureGrad($gsamplerCubeArray sampler, vec4 P, vec3 dPdx, vec3 dPdy);
-$gvec4 textureGradOffset($gsampler1D sampler, float P, float dPdx, float dPdy, int offset);
-$gvec4 textureGradOffset($gsampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
-$gvec4 textureGradOffset($gsampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy, ivec3 offset);
-$gvec4 textureGradOffset($gsampler2DRect sampler, vec2 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
-float textureGradOffset(sampler2DRectShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
-float textureGradOffset(sampler1DShadow sampler, vec3 P, float dPdx, float dPdy, int offset );
-float textureGradOffset(sampler2DShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
-$gvec4 textureGradOffset($gsampler1DArray sampler, vec2 P, float dPdx, float dPdy, int offset);
-$gvec4 textureGradOffset($gsampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
-float textureGradOffset(sampler1DArrayShadow sampler, vec3 P, float dPdx, float dPdy, int offset);
-float textureGradOffset(sampler2DArrayShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
-$gvec4 textureProjGrad($gsampler1D sampler, vec2 P, float dPdx, float dPdy);
-$gvec4 textureProjGrad($gsampler1D sampler, vec4 P, float dPdx, float dPdy);
-$gvec4 textureProjGrad($gsampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy);
-$gvec4 textureProjGrad($gsampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy);
-$gvec4 textureProjGrad($gsampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy);
-$gvec4 textureProjGrad($gsampler2DRect sampler, vec3 P, vec2 dPdx, vec2 dPdy);
-$gvec4 textureProjGrad($gsampler2DRect sampler, vec4 P, vec2 dPdx, vec2 dPdy);
-float textureProjGrad(sampler2DRectShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy);
-float textureProjGrad(sampler1DShadow sampler, vec4 P, float dPdx, float dPdy);
-float textureProjGrad(sampler2DShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy);
-$gvec4 textureProjGradOffset($gsampler1D sampler, vec2 P, float dPdx, float dPdy, int offset);
-$gvec4 textureProjGradOffset($gsampler1D sampler, vec4 P, float dPdx, float dPdy, int offset);
-$gvec4 textureProjGradOffset($gsampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
-$gvec4 textureProjGradOffset($gsampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
-$gvec4 textureProjGradOffset($gsampler2DRect sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
-$gvec4 textureProjGradOffset($gsampler2DRect sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
-float textureProjGradOffset(sampler2DRectShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
-$gvec4 textureProjGradOffset($gsampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy, ivec3 offset);
-float textureProjGradOffset(sampler1DShadow sampler, vec4 P, float dPdx, float dPdy, int offset);
-float textureProjGradOffset(sampler2DShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
-$gvec4 textureGather($gsampler2D sampler, vec2 P);
-$gvec4 textureGather($gsampler2D sampler, vec2 P, int comp);
-$gvec4 textureGather($gsampler2DArray sampler, vec3 P);
-$gvec4 textureGather($gsampler2DArray sampler, vec3 P, int comp);
-$gvec4 textureGather($gsamplerCube sampler, vec3 P);
-$gvec4 textureGather($gsamplerCube sampler, vec3 P, int comp);
-$gvec4 textureGather($gsamplerCubeArray sampler, vec4 P);
-$gvec4 textureGather($gsamplerCubeArray sampler, vec4 P, int comp);
-$gvec4 textureGather($gsampler2DRect sampler, vec2 P);
-$gvec4 textureGather($gsampler2DRect sampler, vec2 P, int comp);
-vec4 textureGather(sampler2DShadow sampler, vec2 P, float refZ);
-vec4 textureGather(sampler2DArrayShadow sampler, vec3 P, float refZ);
-vec4 textureGather(samplerCubeShadow sampler, vec3 P, float refZ);
-vec4 textureGather(samplerCubeArrayShadow sampler, vec4 P, float refZ);
-vec4 textureGather(sampler2DRectShadow sampler, vec2 P, float refZ);
-$gvec4 textureGatherOffset($gsampler2D sampler, vec2 P, ivec2 offset);
-$gvec4 textureGatherOffset($gsampler2D sampler, vec2 P, ivec2 offset, int comp);
-$gvec4 textureGatherOffset($gsampler2DArray sampler, vec3 P, ivec2 offset);
-$gvec4 textureGatherOffset($gsampler2DArray sampler, vec3 P, ivec2 offset, int comp);
-$gvec4 textureGatherOffset($gsampler2DRect sampler, vec2 P, ivec2 offset);
-$gvec4 textureGatherOffset($gsampler2DRect sampler, vec2 P, ivec2 offset, int comp);
-vec4 textureGatherOffset(sampler2DShadow sampler, vec2 P, float refZ, ivec2 offset);
-vec4 textureGatherOffset(sampler2DArrayShadow sampler, vec3 P, float refZ, ivec2 offset);
-vec4 textureGatherOffset(sampler2DRectShadow sampler, vec2 P, float refZ, ivec2 offset);
-$gvec4 textureGatherOffsets($gsampler2D sampler, vec2 P, ivec2 offsets[4]);
-$gvec4 textureGatherOffsets($gsampler2D sampler, vec2 P, ivec2 offsets[4], int comp);
-$gvec4 textureGatherOffsets($gsampler2DArray sampler, vec3 P, ivec2 offsets[4]);
-$gvec4 textureGatherOffsets($gsampler2DArray sampler, vec3 P, ivec2 offsets[4], int comp);
-$gvec4 textureGatherOffsets($gsampler2DRect sampler, vec2 P, ivec2 offsets[4]);
-$gvec4 textureGatherOffsets($gsampler2DRect sampler, vec2 P, ivec2 offsets[4], int comp);
-vec4 textureGatherOffsets(sampler2DShadow sampler, vec2 P, float refZ, ivec2 offsets[4]);
-vec4 textureGatherOffsets(sampler2DArrayShadow sampler, vec3 P, float refZ, ivec2 offsets[4]);
-vec4 textureGatherOffsets(sampler2DRectShadow sampler, vec2 P, float refZ, ivec2 offsets[4]);
+$gfloat4 texelFetch($gsampler3D sampler, int3 P, int lod);
+$gfloat4 texelFetch($gsampler1DArray sampler, int2 P, int lod);
+$gfloat4 texelFetch($gsampler2DArray sampler, int3 P, int lod);
+$gfloat4 texelFetch($gsampler2DMS sampler, int2 P, int sample);
+$gfloat4 texelFetch($gsampler2DMSArray sampler, int3 P, int sample);
+$gfloat4 texelFetchOffset($gsampler1D sampler, int P, int lod, int offset);
+$gfloat4 texelFetchOffset($gsampler2D sampler, int2 P, int lod, int2 offset);
+$gfloat4 texelFetchOffset($gsampler3D sampler, int3 P, int lod, int3 offset);
+$gfloat4 texelFetchOffset($gsampler2DRect sampler, int2 P, int2 offset);
+$gfloat4 texelFetchOffset($gsampler1DArray sampler, int2 P, int lod, int offset);
+$gfloat4 texelFetchOffset($gsampler2DArray sampler, int3 P, int lod, int2 offset);
+$gfloat4 textureProjOffset($gsampler1D sampler, float2 P, int offset);
+$gfloat4 textureProjOffset($gsampler1D sampler, float2 P, int offset, float bias);
+$gfloat4 textureProjOffset($gsampler1D sampler, float4 P, int offset);
+$gfloat4 textureProjOffset($gsampler1D sampler, float4 P, int offset, float bias);
+$gfloat4 textureProjOffset($gsampler2D sampler, float3 P, int2 offset);
+$gfloat4 textureProjOffset($gsampler2D sampler, float3 P, int2 offset, float bias);
+$gfloat4 textureProjOffset($gsampler2D sampler, float4 P, int2 offset);
+$gfloat4 textureProjOffset($gsampler2D sampler, float4 P, int2 offset, float bias);
+$gfloat4 textureProjOffset($gsampler3D sampler, float4 P, int3 offset);
+$gfloat4 textureProjOffset($gsampler3D sampler, float4 P, int3 offset, float bias);
+$gfloat4 textureProjOffset($gsampler2DRect sampler, float3 P, int2 offset);
+$gfloat4 textureProjOffset($gsampler2DRect sampler, float4 P, int2 offset);
+float textureProjOffset(sampler2DRectShadow sampler, float4 P, int2 offset);
+float textureProjOffset(sampler1DShadow sampler, float4 P, int offset);
+float textureProjOffset(sampler1DShadow sampler, float4 P, int offset, float bias);
+float textureProjOffset(sampler2DShadow sampler, float4 P, int2 offset);
+float textureProjOffset(sampler2DShadow sampler, float4 P, int2 offset, float bias);
+$gfloat4 textureLodOffset($gsampler1D sampler, float P, float lod, int offset);
+$gfloat4 textureLodOffset($gsampler2D sampler, float2 P, float lod, int2 offset);
+$gfloat4 textureLodOffset($gsampler3D sampler, float3 P, float lod, int3 offset);
+float textureLodOffset(sampler1DShadow sampler, float3 P, float lod, int offset);
+float textureLodOffset(sampler2DShadow sampler, float3 P, float lod, int2 offset);
+$gfloat4 textureLodOffset($gsampler1DArray sampler, float2 P, float lod, int offset);
+$gfloat4 textureLodOffset($gsampler2DArray sampler, float3 P, float lod, int2 offset);
+float textureLodOffset(sampler1DArrayShadow sampler, float3 P, float lod, int offset);
+$gfloat4 textureProjLod($gsampler1D sampler, float2 P, float lod);
+$gfloat4 textureProjLod($gsampler1D sampler, float4 P, float lod);
+$gfloat4 textureProjLod($gsampler2D sampler, float3 P, float lod);
+$gfloat4 textureProjLod($gsampler2D sampler, float4 P, float lod);
+$gfloat4 textureProjLod($gsampler3D sampler, float4 P, float lod);
+float textureProjLod(sampler1DShadow sampler, float4 P, float lod);
+float textureProjLod(sampler2DShadow sampler, float4 P, float lod);
+$gfloat4 textureProjLodOffset($gsampler1D sampler, float2 P, float lod, int offset);
+$gfloat4 textureProjLodOffset($gsampler1D sampler, float4 P, float lod, int offset);
+$gfloat4 textureProjLodOffset($gsampler2D sampler, float3 P, float lod, int2 offset);
+$gfloat4 textureProjLodOffset($gsampler2D sampler, float4 P, float lod, int2 offset);
+$gfloat4 textureProjLodOffset($gsampler3D sampler, float4 P, float lod, int3 offset);
+float textureProjLodOffset(sampler1DShadow sampler, float4 P, float lod, int offset);
+float textureProjLodOffset(sampler2DShadow sampler, float4 P, float lod, int2 offset);
+$gfloat4 textureGrad($gsampler1D sampler, float P, float dPdx, float dPdy);
+$gfloat4 textureGrad($gsampler2D sampler, float2 P, float2 dPdx, float2 dPdy);
+$gfloat4 textureGrad($gsampler3D sampler, float3 P, float3 dPdx, float3 dPdy);
+$gfloat4 textureGrad($gsamplerCube sampler, float3 P, float3 dPdx, float3 dPdy);
+$gfloat4 textureGrad($gsampler2DRect sampler, float2 P, float2 dPdx, float2 dPdy);
+float textureGrad(sampler2DRectShadow sampler, float3 P, float2 dPdx, float2 dPdy);
+float textureGrad(sampler1DShadow sampler, float3 P, float dPdx, float dPdy);
+float textureGrad(sampler2DShadow sampler, float3 P, float2 dPdx, float2 dPdy);
+float textureGrad(samplerCubeShadow sampler, float4 P, float3 dPdx, float3 dPdy);
+$gfloat4 textureGrad($gsampler1DArray sampler, float2 P, float dPdx, float dPdy);
+$gfloat4 textureGrad($gsampler2DArray sampler, float3 P, float2 dPdx, float2 dPdy);
+float textureGrad(sampler1DArrayShadow sampler, float3 P, float dPdx, float dPdy);
+float textureGrad(sampler2DArrayShadow sampler, float4 P, float2 dPdx, float2 dPdy);
+$gfloat4 textureGrad($gsamplerCubeArray sampler, float4 P, float3 dPdx, float3 dPdy);
+$gfloat4 textureGradOffset($gsampler1D sampler, float P, float dPdx, float dPdy, int offset);
+$gfloat4 textureGradOffset($gsampler2D sampler, float2 P, float2 dPdx, float2 dPdy, int2 offset);
+$gfloat4 textureGradOffset($gsampler3D sampler, float3 P, float3 dPdx, float3 dPdy, int3 offset);
+$gfloat4 textureGradOffset($gsampler2DRect sampler, float2 P, float2 dPdx, float2 dPdy, int2 offset);
+float textureGradOffset(sampler2DRectShadow sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
+float textureGradOffset(sampler1DShadow sampler, float3 P, float dPdx, float dPdy, int offset );
+float textureGradOffset(sampler2DShadow sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
+$gfloat4 textureGradOffset($gsampler1DArray sampler, float2 P, float dPdx, float dPdy, int offset);
+$gfloat4 textureGradOffset($gsampler2DArray sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
+float textureGradOffset(sampler1DArrayShadow sampler, float3 P, float dPdx, float dPdy, int offset);
+float textureGradOffset(sampler2DArrayShadow sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
+$gfloat4 textureProjGrad($gsampler1D sampler, float2 P, float dPdx, float dPdy);
+$gfloat4 textureProjGrad($gsampler1D sampler, float4 P, float dPdx, float dPdy);
+$gfloat4 textureProjGrad($gsampler2D sampler, float3 P, float2 dPdx, float2 dPdy);
+$gfloat4 textureProjGrad($gsampler2D sampler, float4 P, float2 dPdx, float2 dPdy);
+$gfloat4 textureProjGrad($gsampler3D sampler, float4 P, float3 dPdx, float3 dPdy);
+$gfloat4 textureProjGrad($gsampler2DRect sampler, float3 P, float2 dPdx, float2 dPdy);
+$gfloat4 textureProjGrad($gsampler2DRect sampler, float4 P, float2 dPdx, float2 dPdy);
+float textureProjGrad(sampler2DRectShadow sampler, float4 P, float2 dPdx, float2 dPdy);
+float textureProjGrad(sampler1DShadow sampler, float4 P, float dPdx, float dPdy);
+float textureProjGrad(sampler2DShadow sampler, float4 P, float2 dPdx, float2 dPdy);
+$gfloat4 textureProjGradOffset($gsampler1D sampler, float2 P, float dPdx, float dPdy, int offset);
+$gfloat4 textureProjGradOffset($gsampler1D sampler, float4 P, float dPdx, float dPdy, int offset);
+$gfloat4 textureProjGradOffset($gsampler2D sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
+$gfloat4 textureProjGradOffset($gsampler2D sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
+$gfloat4 textureProjGradOffset($gsampler2DRect sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
+$gfloat4 textureProjGradOffset($gsampler2DRect sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
+float textureProjGradOffset(sampler2DRectShadow sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
+$gfloat4 textureProjGradOffset($gsampler3D sampler, float4 P, float3 dPdx, float3 dPdy, int3 offset);
+float textureProjGradOffset(sampler1DShadow sampler, float4 P, float dPdx, float dPdy, int offset);
+float textureProjGradOffset(sampler2DShadow sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
+$gfloat4 textureGather($gsampler2D sampler, float2 P);
+$gfloat4 textureGather($gsampler2D sampler, float2 P, int comp);
+$gfloat4 textureGather($gsampler2DArray sampler, float3 P);
+$gfloat4 textureGather($gsampler2DArray sampler, float3 P, int comp);
+$gfloat4 textureGather($gsamplerCube sampler, float3 P);
+$gfloat4 textureGather($gsamplerCube sampler, float3 P, int comp);
+$gfloat4 textureGather($gsamplerCubeArray sampler, float4 P);
+$gfloat4 textureGather($gsamplerCubeArray sampler, float4 P, int comp);
+$gfloat4 textureGather($gsampler2DRect sampler, float2 P);
+$gfloat4 textureGather($gsampler2DRect sampler, float2 P, int comp);
+float4 textureGather(sampler2DShadow sampler, float2 P, float refZ);
+float4 textureGather(sampler2DArrayShadow sampler, float3 P, float refZ);
+float4 textureGather(samplerCubeShadow sampler, float3 P, float refZ);
+float4 textureGather(samplerCubeArrayShadow sampler, float4 P, float refZ);
+float4 textureGather(sampler2DRectShadow sampler, float2 P, float refZ);
+$gfloat4 textureGatherOffset($gsampler2D sampler, float2 P, int2 offset);
+$gfloat4 textureGatherOffset($gsampler2D sampler, float2 P, int2 offset, int comp);
+$gfloat4 textureGatherOffset($gsampler2DArray sampler, float3 P, int2 offset);
+$gfloat4 textureGatherOffset($gsampler2DArray sampler, float3 P, int2 offset, int comp);
+$gfloat4 textureGatherOffset($gsampler2DRect sampler, float2 P, int2 offset);
+$gfloat4 textureGatherOffset($gsampler2DRect sampler, float2 P, int2 offset, int comp);
+float4 textureGatherOffset(sampler2DShadow sampler, float2 P, float refZ, int2 offset);
+float4 textureGatherOffset(sampler2DArrayShadow sampler, float3 P, float refZ, int2 offset);
+float4 textureGatherOffset(sampler2DRectShadow sampler, float2 P, float refZ, int2 offset);
+$gfloat4 textureGatherOffsets($gsampler2D sampler, float2 P, int2 offsets[4]);
+$gfloat4 textureGatherOffsets($gsampler2D sampler, float2 P, int2 offsets[4], int comp);
+$gfloat4 textureGatherOffsets($gsampler2DArray sampler, float3 P, int2 offsets[4]);
+$gfloat4 textureGatherOffsets($gsampler2DArray sampler, float3 P, int2 offsets[4], int comp);
+$gfloat4 textureGatherOffsets($gsampler2DRect sampler, float2 P, int2 offsets[4]);
+$gfloat4 textureGatherOffsets($gsampler2DRect sampler, float2 P, int2 offsets[4], int comp);
+float4 textureGatherOffsets(sampler2DShadow sampler, float2 P, float refZ, int2 offsets[4]);
+float4 textureGatherOffsets(sampler2DArrayShadow sampler, float3 P, float refZ, int2 offsets[4]);
+float4 textureGatherOffsets(sampler2DRectShadow sampler, float2 P, float refZ, int2 offsets[4]);
 uint atomicCounterIncrement(atomic_uint c);
 uint atomicCounter(atomic_uint c);
 uint atomicAdd(inout uint mem, uint data);
@@ -500,18 +500,18 @@
 */
 // section 8.12 Additional Image Functions will go here if and when we add
 // support for them
-vec4 imageLoad(image2D image, ivec2 P);
-ivec4 imageLoad(iimage2D image, ivec2 P);
+float4 imageLoad(image2D image, int2 P);
+int4 imageLoad(iimage2D image, int2 P);
 $genType dFdx($genType p);
 $genType dFdy($genType p);
 float interpolateAtSample(float interpolant, int sample);
-vec2 interpolateAtSample(vec2 interpolant, int sample);
-vec3 interpolateAtSample(vec3 interpolant, int sample);
-vec4 interpolateAtSample(vec4 interpolant, int sample);
-float interpolateAtOffset(float interpolant, vec2 offset);
-vec2 interpolateAtOffset(vec2 interpolant, vec2 offset);
-vec3 interpolateAtOffset(vec3 interpolant, vec2 offset);
-vec4 interpolateAtOffset(vec4 interpolant, vec2 offset);
+float2 interpolateAtSample(float2 interpolant, int sample);
+float3 interpolateAtSample(float3 interpolant, int sample);
+float4 interpolateAtSample(float4 interpolant, int sample);
+float interpolateAtOffset(float interpolant, float2 offset);
+float2 interpolateAtOffset(float2 interpolant, float2 offset);
+float3 interpolateAtOffset(float3 interpolant, float2 offset);
+float4 interpolateAtOffset(float4 interpolant, float2 offset);
 
 /*
 $genType fwidth($genType p);
diff --git a/src/sksl/sksl_fp.include b/src/sksl/sksl_fp.include
index 0d8d99d..4d6b94d 100644
--- a/src/sksl/sksl_fp.include
+++ b/src/sksl/sksl_fp.include
@@ -2,24 +2,24 @@
 
 // defines built-in interfaces supported by SkiaSL fragment shaders
 
-layout(builtin=15) in vec4 sk_FragCoord;
+layout(builtin=15) in float4 sk_FragCoord;
 layout(builtin=3) float sk_ClipDistance[1];
 
 // 9999 is a temporary value that causes us to ignore these declarations beyond
 // adding them to the symbol table. This works fine in GLSL (where they do not
 // require any further handling) but will fail in SPIR-V. We'll have a better
 // solution for this soon.
-layout(builtin=9999) vec4 gl_LastFragData[1];
-layout(builtin=9999) vec4 gl_LastFragColor;
-layout(builtin=9999) vec4 gl_LastFragColorARM;
+layout(builtin=9999) float4 gl_LastFragData[1];
+layout(builtin=9999) float4 gl_LastFragColor;
+layout(builtin=9999) float4 gl_LastFragColorARM;
 layout(builtin=9999) int gl_SampleMaskIn[1];
 layout(builtin=9999) out int gl_SampleMask[1];
-layout(builtin=9999) vec4 gl_SecondaryFragColorEXT;
+layout(builtin=9999) float4 gl_SecondaryFragColorEXT;
 
-layout(builtin=10003) vec4 sk_InColor;
-layout(builtin=10004) out vec4 sk_OutColor;
-layout(builtin=10005) vec2[] sk_TransformedCoords2D;
+layout(builtin=10003) float4 sk_InColor;
+layout(builtin=10004) out float4 sk_OutColor;
+layout(builtin=10005) float2[] sk_TransformedCoords2D;
 layout(builtin=10006) sampler2D[] sk_TextureSamplers;
 
-vec4 COLORSPACE(vec4 color, colorSpaceXform colorSpace);
+float4 COLORSPACE(float4 color, colorSpaceXform colorSpace);
 )
diff --git a/src/sksl/sksl_frag.include b/src/sksl/sksl_frag.include
index f1192fe..2cd1e52 100644
--- a/src/sksl/sksl_frag.include
+++ b/src/sksl/sksl_frag.include
@@ -2,20 +2,20 @@
 
 // defines built-in interfaces supported by SkiaSL fragment shaders
 
-layout(builtin=15) in vec4 sk_FragCoord;
+layout(builtin=15) in float4 sk_FragCoord;
 layout(builtin=3) float sk_ClipDistance[1];
 
 // 9999 is a temporary value that causes us to ignore these declarations beyond
 // adding them to the symbol table. This works fine in GLSL (where they do not
 // require any further handling) but will fail in SPIR-V. We'll have a better
 // solution for this soon.
-layout(builtin=9999) vec4 gl_LastFragData[1];
-layout(builtin=9999) vec4 gl_LastFragColor;
-layout(builtin=9999) vec4 gl_LastFragColorARM;
+layout(builtin=9999) float4 gl_LastFragData[1];
+layout(builtin=9999) float4 gl_LastFragColor;
+layout(builtin=9999) float4 gl_LastFragColorARM;
 layout(builtin=9999) int gl_SampleMaskIn[1];
 layout(builtin=9999) out int gl_SampleMask[1];
-layout(builtin=9999) out vec4 gl_SecondaryFragColorEXT;
+layout(builtin=9999) out float4 gl_SecondaryFragColorEXT;
 
-layout(location=0,index=0,builtin=10001) out vec4 sk_FragColor;
+layout(location=0,index=0,builtin=10001) out float4 sk_FragColor;
 
 )
diff --git a/src/sksl/sksl_geom.include b/src/sksl/sksl_geom.include
index e980d6b..f1b3604 100644
--- a/src/sksl/sksl_geom.include
+++ b/src/sksl/sksl_geom.include
@@ -3,13 +3,13 @@
 // defines built-in interfaces supported by SkiaSL geometry shaders
 
 layout(builtin=10002) in sk_PerVertex {
-  layout(builtin=0) vec4 gl_Position;
+  layout(builtin=0) float4 gl_Position;
   layout(builtin=1) float gl_PointSize;
   layout(builtin=3) float sk_ClipDistance[];
 } sk_in[];
 
 out sk_PerVertex {
-    layout(builtin=0) vec4 gl_Position;
+    layout(builtin=0) float4 gl_Position;
     layout(builtin=1) float gl_PointSize;
     layout(builtin=3) float sk_ClipDistance[];
 };
diff --git a/src/sksl/sksl_vert.include b/src/sksl/sksl_vert.include
index 2c38a8b..976877c 100644
--- a/src/sksl/sksl_vert.include
+++ b/src/sksl/sksl_vert.include
@@ -3,7 +3,7 @@
 // defines built-in interfaces supported by SkiaSL vertex shaders
 
 out sk_PerVertex {
-    layout(builtin=0) vec4 gl_Position;
+    layout(builtin=0) float4 gl_Position;
     layout(builtin=1) float gl_PointSize;
     layout(builtin=3) float sk_ClipDistance[1];
 };