Index: src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp |
diff --git a/src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp b/src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp |
index 8a3b1f4a6eb7df27dd8826509c637e4601afb565..af95f564cf885b54b024a78a2ae2ca02a5de036d 100644 |
--- a/src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp |
+++ b/src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp |
@@ -15,25 +15,26 @@ GrGLGeometryBuilder::GrGLGeometryBuilder(GrGLProgramBuilder* program) |
} |
-void GrGLGeometryBuilder::addVarying(GrSLType type, |
- const char* name, |
- const char** gsOutName) { |
+void GrGLGeometryBuilder::addVarying(const char* name, GrGLVarying* v) { |
// if we have a GS take each varying in as an array |
// and output as non-array. |
- fInputs.push_back(); |
- fInputs.back().setType(type); |
- fInputs.back().setTypeModifier(GrGLShaderVar::kVaryingIn_TypeModifier); |
- fInputs.back().setUnsizedArray(); |
- *fInputs.back().accessName() = name; |
- fOutputs.push_back(); |
- fOutputs.back().setType(type); |
- fOutputs.back().setTypeModifier(GrGLShaderVar::kVaryingOut_TypeModifier); |
- fProgramBuilder->nameVariable(fOutputs.back().accessName(), 'g', name); |
- if (gsOutName) { |
- *gsOutName = fOutputs.back().getName().c_str(); |
+ if (v->vsVarying()) { |
+ fInputs.push_back(); |
+ fInputs.back().setType(v->fType); |
+ fInputs.back().setTypeModifier(GrGLShaderVar::kVaryingIn_TypeModifier); |
+ fInputs.back().setUnsizedArray(); |
+ *fInputs.back().accessName() = v->fVsOut; |
+ v->fGsIn = v->fVsOut; |
} |
-} |
+ if (v->fsVarying()) { |
+ fOutputs.push_back(); |
+ fOutputs.back().setType(v->fType); |
+ fOutputs.back().setTypeModifier(GrGLShaderVar::kVaryingOut_TypeModifier); |
+ fProgramBuilder->nameVariable(fOutputs.back().accessName(), 'g', name); |
+ v->fGsOut = fOutputs.back().getName().c_str(); |
+ } |
+} |
bool GrGLGeometryBuilder::compileAndAttachShaders(GrGLuint programId, |
SkTDArray<GrGLuint>* shaderIds) const { |