const char* GrGLShaderBuilder::enableSecondaryOutput() { if (!fHasSecondaryOutput) { fFSOutputs.push_back().set(kVec4f_GrSLType, GrGLShaderVar::kOut_TypeModifier, dual_source_output_name()); fHasSecondaryOutput = true; } return dual_source_output_name(); }
void GrGLShaderBuilder::bindProgramLocations(GrGLuint programId) const { if (fHasCustomColorOutput) { GL_CALL(BindFragDataLocation(programId, 0, declared_color_output_name())); } if (fHasSecondaryOutput) { GL_CALL(BindFragDataLocationIndexed(programId, 0, 1, dual_source_output_name())); } }
void GrGLFragmentShaderBuilder::bindFragmentShaderLocations(GrGLuint programID) { // ES 3.00 requires custom color output but doesn't support bindFragDataLocation if (fHasCustomColorOutput && kGLES_GrGLStandard != fProgramBuilder->gpu()->ctxInfo().standard()) { GL_CALL(BindFragDataLocation(programID, 0, declared_color_output_name())); } if (fHasSecondaryOutput) { GL_CALL(BindFragDataLocationIndexed(programID, 0, 1, dual_source_output_name())); } }
void GrGLShaderBuilder::bindProgramLocations(GrGLuint programId) { if (fHasCustomColorOutput) { GL_CALL(BindFragDataLocation(programId, 0, declared_color_output_name())); } if (fHasSecondaryOutput) { GL_CALL(BindFragDataLocationIndexed(programId, 0, 1, dual_source_output_name())); } // skbug.com/2056 bool usingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation != NULL; if (usingBindUniform) { int count = fUniforms.count(); for (int i = 0; i < count; ++i) { GL_CALL(BindUniformLocation(programId, i, fUniforms[i].fVariable.c_str())); fUniforms[i].fLocation = i; } } }
const char* GrGLFragmentShaderBuilder::getSecondaryColorOutputName() const { return dual_source_output_name(); }
void GrGLFragmentShaderBuilder::enableSecondaryOutput() { SkASSERT(!fHasSecondaryOutput); fHasSecondaryOutput = true; fOutputs.push_back().set(kVec4f_GrSLType, GrGLShaderVar::kOut_TypeModifier, dual_source_output_name()); }