aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-12-09 10:38:57 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-09 10:38:57 -0800
commit54a57f5cf1e702107fd5daf106eca3b2bedac173 (patch)
treeba11ab94e7b60272fa7dc05e97075bed02f8aa5a
parent309e346744f57fadd66ba3c2f14875c86311682e (diff)
Use GrCoordTransform precision to set uniform matrix precision
-rw-r--r--src/gpu/gl/builders/GrGLProgramBuilder.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index e10aa6537c..ab77e05938 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -384,6 +384,8 @@ void GrGLProgramBuilder::emitTransforms(const GrPendingFragmentStage& stage,
const char* uniName = "StageMatrix";
GrSLType varyingType = stage.isPerspectiveCoordTransform(t) ? kVec3f_GrSLType :
kVec2f_GrSLType;
+ GrSLPrecision precision = processor->coordTransform(t).precision();
+
SkString suffixedUniName;
if (0 != t) {
suffixedUniName.append(uniName);
@@ -391,7 +393,7 @@ void GrGLProgramBuilder::emitTransforms(const GrPendingFragmentStage& stage,
uniName = suffixedUniName.c_str();
}
ifp->fTransforms[t].fHandle = this->addUniform(GrGLProgramBuilder::kVertex_Visibility,
- kMat33f_GrSLType, kDefault_GrSLPrecision,
+ kMat33f_GrSLType, precision,
uniName,
&uniName).toShaderBuilderIndex();
@@ -407,7 +409,7 @@ void GrGLProgramBuilder::emitTransforms(const GrPendingFragmentStage& stage,
const char* coords = useLocalCoords ? fVS.localCoords() : fVS.positionCoords();
GrGLVertToFrag v(varyingType);
- this->addVarying(varyingName, &v, processor->coordTransform(t).precision());
+ this->addVarying(varyingName, &v, precision);
fCoordVaryings.push_back(TransformVarying(v, uniName, coords));
SkASSERT(kVec2f_GrSLType == varyingType || kVec3f_GrSLType == varyingType);