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

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

Issue 675193002: Revert of Added varying struct (Closed) Base URL: https://skia.googlesource.com/skia.git@gp_emit_struct
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') | no next file » | 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 1fa946793c64bead43fd59c8e1a83ed79d8d996d..76026b7a25005509701e91a874837d72555fe81f 100644
--- a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
@@ -23,12 +23,17 @@
, fEffectAttribOffset(0) {
}
-void GrGLVertexBuilder::addVarying(const char* name, GrGLVarying* v) {
+SkString* GrGLVertexBuilder::addVarying(GrSLType type, const char* name,
+ const char** vsOutName) {
fOutputs.push_back();
- fOutputs.back().setType(v->fType);
+ fOutputs.back().setType(type);
fOutputs.back().setTypeModifier(GrGLShaderVar::kVaryingOut_TypeModifier);
fProgramBuilder->nameVariable(fOutputs.back().accessName(), 'v', name);
- v->fVsOut = fOutputs.back().getName().c_str();
+
+ if (vsOutName) {
+ *vsOutName = fOutputs.back().getName().c_str();
+ }
+ return fOutputs.back().accessName();
}
void GrGLVertexBuilder::setupLocalCoords() {
@@ -58,15 +63,15 @@
}
void GrGLVertexBuilder::setupBuiltinVertexAttribute(const char* inName, GrGLSLExpr4* out) {
- GrGLVertToFrag v(kVec4f_GrSLType);
- fProgramBuilder->addVarying(inName, &v);
SkString name(inName);
+ const char *vsName, *fsName;
+ fProgramBuilder->addVarying(kVec4f_GrSLType, name.c_str(), &vsName, &fsName);
name.prepend("in");
this->addAttribute(GrShaderVar(name.c_str(),
kVec4f_GrSLType,
GrShaderVar::kAttribute_TypeModifier));
- this->codeAppendf("%s = %s;", v.vsOut(), name.c_str());
- *out = v.fsIn();
+ this->codeAppendf("%s = %s;", vsName, name.c_str());
+ *out = fsName;
fEffectAttribOffset++;
}
« no previous file with comments | « src/gpu/gl/builders/GrGLVertexShaderBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698