aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp')
-rw-r--r--src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp b/src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp
index 8a3b1f4a6e..af95f564cf 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 {