// Enclose custom code in a block to avoid namespace conflicts
builder->fVSCode.appendf("\t{ // %s\n", glStage->name());
builder->fFSCode.appendf("\t{ // %s \n", glStage->name());
- glStage->emitCode(builder, varyingVSName, fsOutColor, fsInColor, textureSamplers);
+ glStage->emitCode(builder,
+ *stage,
+ desc.fCustomStageKey,
+ varyingVSName,
+ fsOutColor,
+ fsInColor,
+ textureSamplers);
builder->fVSCode.appendf("\t}\n");
builder->fFSCode.appendf("\t}\n");
stages.
@param builder Interface used to emit code in the shaders.
+ @param stage The custom stage that generated this program stage.
+ @param key The key that was computed by StageKey() from the generating
+ GrCustomStage.
@param vertexCoords A vec2 of texture coordinates in the VS, which may be altered. This will
be removed soon and stages will be responsible for computing their own
coords.
reads in the generated code.
*/
virtual void emitCode(GrGLShaderBuilder* builder,
+ const GrCustomStage& stage,
+ StageKey key,
const char* vertexCoords,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray&) = 0;
virtual void emitCode(GrGLShaderBuilder* builder,
+ const GrCustomStage&,
+ StageKey,
const char* vertexCoords,
const char* outputColor,
const char* inputColor,