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

Side by Side Diff: src/gpu/glsl/GrGLSLGeometryShaderBuilder.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 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 unified diff | Download patch
« no previous file with comments | « src/gpu/glsl/GrGLSLGeometryShaderBuilder.h ('k') | src/gpu/glsl/GrGLSLPrimitiveProcessor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGLSLGeometryShaderBuilder.h" 8 #include "GrGLSLGeometryShaderBuilder.h"
9 #include "GrGLSLProgramBuilder.h" 9 #include "GrGLSLProgramBuilder.h"
10 #include "GrGLSLVarying.h"
10 11
11 GrGLSLGeometryBuilder::GrGLSLGeometryBuilder(GrGLSLProgramBuilder* program) 12 GrGLSLGeometryBuilder::GrGLSLGeometryBuilder(GrGLSLProgramBuilder* program)
12 : INHERITED(program) { 13 : INHERITED(program) {
13 14
14 } 15 }
15 16
16 void GrGLSLGeometryBuilder::addVarying(const char* name, 17 void GrGLSLGeometryBuilder::onFinalize() {
17 GrSLPrecision precision, 18 fProgramBuilder->varyingHandler()->getGeomDecls(&this->inputs(), &this->outp uts());
18 GrGLSLVarying* v) {
19 // if we have a GS take each varying in as an array
20 // and output as non-array.
21 if (v->vsVarying()) {
22 fInputs.push_back();
23 fInputs.back().setType(v->fType);
24 fInputs.back().setTypeModifier(GrGLSLShaderVar::kVaryingIn_TypeModifier) ;
25 fInputs.back().setPrecision(precision);
26 fInputs.back().setUnsizedArray();
27 *fInputs.back().accessName() = v->fVsOut;
28 v->fGsIn = v->fVsOut;
29 }
30
31 if (v->fsVarying()) {
32 fOutputs.push_back();
33 fOutputs.back().setType(v->fType);
34 fOutputs.back().setTypeModifier(GrGLSLShaderVar::kVaryingOut_TypeModifie r);
35 fOutputs.back().setPrecision(precision);
36 fProgramBuilder->nameVariable(fOutputs.back().accessName(), 'g', name);
37 v->fGsOut = fOutputs.back().getName().c_str();
38 }
39 } 19 }
40 20
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLGeometryShaderBuilder.h ('k') | src/gpu/glsl/GrGLSLPrimitiveProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698