aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLSPIRVCodeGenerator.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-07-28 15:19:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-28 20:43:03 +0000
commit5af9ea399d5e0344cc4b7da4e97b5dc5b3c74f64 (patch)
treedf906a3af0b954b130340589f24d128ce655bb01 /src/sksl/SkSLSPIRVCodeGenerator.cpp
parent0edfbb78244739cb6e695f240edb7f659a543160 (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/SkSLSPIRVCodeGenerator.cpp')
-rw-r--r--src/sksl/SkSLSPIRVCodeGenerator.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/sksl/SkSLSPIRVCodeGenerator.cpp b/src/sksl/SkSLSPIRVCodeGenerator.cpp
index 0e550b149e..1f8f224399 100644
--- a/src/sksl/SkSLSPIRVCodeGenerator.cpp
+++ b/src/sksl/SkSLSPIRVCodeGenerator.cpp
@@ -1333,7 +1333,7 @@ SpvId SPIRVCodeGenerator::writeSpecialIntrinsic(const FunctionCall& c, SpecialIn
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 @@ SpvId SPIRVCodeGenerator::writeSpecialIntrinsic(const FunctionCall& c, SpecialIn
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 @@ public:
// 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 @@ SpvId SPIRVCodeGenerator::writeVariableReference(const VariableReference& ref, O
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 SPIRVCodeGenerator::writeVariableReference(const VariableReference& ref, O
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 @@ SpvId SPIRVCodeGenerator::writeBinaryExpression(const BinaryExpression& b, Outpu
}
// 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 &&