diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-07-28 15:19:46 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-28 20:43:03 +0000 |
commit | 5af9ea399d5e0344cc4b7da4e97b5dc5b3c74f64 (patch) | |
tree | df906a3af0b954b130340589f24d128ce655bb01 /src/sksl/ir/SkSLSwizzle.h | |
parent | 0edfbb78244739cb6e695f240edb7f659a543160 (diff) |
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>
Diffstat (limited to 'src/sksl/ir/SkSLSwizzle.h')
-rw-r--r-- | src/sksl/ir/SkSLSwizzle.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/sksl/ir/SkSLSwizzle.h b/src/sksl/ir/SkSLSwizzle.h index 442e92f348..9d7ca37bdc 100644 --- a/src/sksl/ir/SkSLSwizzle.h +++ b/src/sksl/ir/SkSLSwizzle.h @@ -18,8 +18,8 @@ namespace SkSL { /** * 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 @@ static const Type& get_type(const Context& context, Expression& value, size_t co } 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 @@ struct Swizzle : public Expression { 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); |