Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: src/gpu/gl/builders/GrGLProgramBuilder.cpp

Issue 784103003: Use GrCoordTransform precision to set uniform matrix precision (Closed) Base URL: https://skia.googlesource.com/skia.git@uni_prec
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLProgramBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index e10aa6537c6d94909cd276c8ffe3930d79b78f44..ab77e059389842145b8018eb95d60ec4e3e68a86 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698