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

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

Issue 649783003: Force input coverage to be only a byte in gpu shaders. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months 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 | « src/gpu/gl/builders/GrGLVertexShaderBuilder.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
index 5a65f71fccf460f8ccb14edc671b0762bd5c9600..2bef113410343cdcb3e22132adc9d13c899f35e5 100644
--- a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
@@ -57,6 +57,19 @@ void GrGLVertexBuilder::transformGLToSkiaCoords() {
this->codeAppendf("vec3 pos3 = %s * vec3(%s, 1);", viewMName, fPositionVar->c_str());
}
+void GrGLVertexBuilder::setupBuiltinVertexAttribute(const char* inName, GrGLSLExpr1* out) {
+ GrGLVertToFrag v(kFloat_GrSLType);
+ fProgramBuilder->addVarying(inName, &v);
+ SkString name(inName);
+ name.prepend("in");
+ this->addAttribute(GrShaderVar(name.c_str(),
+ kFloat_GrSLType,
+ GrShaderVar::kAttribute_TypeModifier));
+ this->codeAppendf("%s = %s;", v.vsOut(), name.c_str());
+ *out = v.fsIn();
+ fEffectAttribOffset++;
+}
+
void GrGLVertexBuilder::setupBuiltinVertexAttribute(const char* inName, GrGLSLExpr4* out) {
GrGLVertToFrag v(kVec4f_GrSLType);
fProgramBuilder->addVarying(inName, &v);
« no previous file with comments | « src/gpu/gl/builders/GrGLVertexShaderBuilder.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698