Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "GrGLGeometryShaderBuilder.h" | 8 #include "GrGLSLGeometryShaderBuilder.h" |
| 9 #include "GrGLProgramBuilder.h" | 9 #include "GrGLSLProgramBuilder.h" |
| 10 #include "../GrGLGpu.h" | |
| 11 | 10 |
| 12 GrGLGeometryBuilder::GrGLGeometryBuilder(GrGLSLProgramBuilder* program) | 11 GrGLSLGeometryBuilder::GrGLSLGeometryBuilder(GrGLSLProgramBuilder* program) |
| 13 : INHERITED(program) { | 12 : INHERITED(program) { |
| 14 | 13 |
| 15 } | 14 } |
| 16 | 15 |
| 17 void GrGLGeometryBuilder::addVarying(const char* name, GrSLPrecision precision, GrGLSLVarying* v) { | 16 void GrGLSLGeometryBuilder::addVarying(const char* name, GrSLPrecision precision , GrGLSLVarying* v) { |
|
joshualitt
2015/11/11 20:49:18
\n
egdaniel
2015/11/11 20:52:43
Done.
| |
| 18 // if we have a GS take each varying in as an array | 17 // if we have a GS take each varying in as an array |
| 19 // and output as non-array. | 18 // and output as non-array. |
| 20 if (v->vsVarying()) { | 19 if (v->vsVarying()) { |
| 21 fInputs.push_back(); | 20 fInputs.push_back(); |
| 22 fInputs.back().setType(v->fType); | 21 fInputs.back().setType(v->fType); |
| 23 fInputs.back().setTypeModifier(GrGLSLShaderVar::kVaryingIn_TypeModifier) ; | 22 fInputs.back().setTypeModifier(GrGLSLShaderVar::kVaryingIn_TypeModifier) ; |
| 24 fInputs.back().setPrecision(precision); | 23 fInputs.back().setPrecision(precision); |
| 25 fInputs.back().setUnsizedArray(); | 24 fInputs.back().setUnsizedArray(); |
| 26 *fInputs.back().accessName() = v->fVsOut; | 25 *fInputs.back().accessName() = v->fVsOut; |
| 27 v->fGsIn = v->fVsOut; | 26 v->fGsIn = v->fVsOut; |
| 28 } | 27 } |
| 29 | 28 |
| 30 if (v->fsVarying()) { | 29 if (v->fsVarying()) { |
| 31 fOutputs.push_back(); | 30 fOutputs.push_back(); |
| 32 fOutputs.back().setType(v->fType); | 31 fOutputs.back().setType(v->fType); |
| 33 fOutputs.back().setTypeModifier(GrGLSLShaderVar::kVaryingOut_TypeModifie r); | 32 fOutputs.back().setTypeModifier(GrGLSLShaderVar::kVaryingOut_TypeModifie r); |
| 34 fOutputs.back().setPrecision(precision); | 33 fOutputs.back().setPrecision(precision); |
| 35 fProgramBuilder->nameVariable(fOutputs.back().accessName(), 'g', name); | 34 fProgramBuilder->nameVariable(fOutputs.back().accessName(), 'g', name); |
| 36 v->fGsOut = fOutputs.back().getName().c_str(); | 35 v->fGsOut = fOutputs.back().getName().c_str(); |
| 37 } | 36 } |
| 38 } | 37 } |
| 39 | 38 |
| OLD | NEW |