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

Unified Diff: src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp

Issue 1462123003: Create GrGLSLVaryingHandler class for program building (Closed) Base URL: https://skia.googlesource.com/skia.git@putCapsOnArgs
Patch Set: fix release builder Created 5 years, 1 month 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/glsl/GrGLSLVertexShaderBuilder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
diff --git a/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp b/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
index 1f68d0e7b9f5b06ea001ef9cc866df5f5906b265..73c0fcd81e1d4d5fa0027977994e30bd582a49f3 100644
--- a/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
@@ -7,29 +7,13 @@
#include "GrGLSLVertexShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
+#include "glsl/GrGLSLVarying.h"
GrGLSLVertexBuilder::GrGLSLVertexBuilder(GrGLSLProgramBuilder* program)
: INHERITED(program)
, fRtAdjustName(nullptr) {
}
-void GrGLSLVertexBuilder::addVarying(const char* name, GrSLPrecision precision, GrGLSLVarying* v) {
- fOutputs.push_back();
- fOutputs.back().setType(v->fType);
- fOutputs.back().setTypeModifier(GrGLSLShaderVar::kVaryingOut_TypeModifier);
- fOutputs.back().setPrecision(precision);
- fProgramBuilder->nameVariable(fOutputs.back().accessName(), 'v', name);
- v->fVsOut = fOutputs.back().getName().c_str();
-}
-
-void GrGLSLVertexBuilder::emitAttributes(const GrGeometryProcessor& gp) {
- int vaCount = gp.numAttribs();
- for (int i = 0; i < vaCount; i++) {
- this->addAttribute(&gp.getAttrib(i));
- }
- return;
-}
-
void GrGLSLVertexBuilder::transformToNormalizedDeviceSpace(const GrShaderVar& posVar) {
SkASSERT(!fRtAdjustName);
@@ -72,16 +56,7 @@ void GrGLSLVertexBuilder::transformToNormalizedDeviceSpace(const GrShaderVar& po
this->codeAppend("gl_PointSize = 1.0;");
}
-bool GrGLSLVertexBuilder::addAttribute(const GrShaderVar& var) {
- SkASSERT(GrShaderVar::kAttribute_TypeModifier == var.getTypeModifier());
- for (int i = 0; i < fInputs.count(); ++i) {
- const GrGLSLShaderVar& attr = fInputs[i];
- // if attribute already added, don't add it again
- if (attr.getName().equals(var.getName())) {
- return false;
- }
- }
- fInputs.push_back(var);
- return true;
+void GrGLSLVertexBuilder::onFinalize() {
+ fProgramBuilder->varyingHandler()->getVertexDecls(&this->inputs(), &this->outputs());
}
« no previous file with comments | « src/gpu/glsl/GrGLSLVertexShaderBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698