22 SkDEBUGCODE(fHasReadDstColorThisStage_DebugOnly =
true;)
25 if (shaderCaps->fFBFetchSupport) {
27 shaderCaps->fFBFetchExtensionString);
30 const char* fbFetchColorName =
"sk_LastFragColor";
31 if (shaderCaps->fFBFetchNeedsCustomOutput) {
32 fPrimaryColorIsInOut =
true;
33 fbFetchColorName = DeclaredColorOutputName();
35 this->
codeAppendf(
"half4 %s = %s;", kDstColorName, fbFetchColorName);
37 return fbFetchColorName;
49 "GL_KHR_blend_equation_advanced");
54void GrGLSLFragmentShaderBuilder::enableSecondaryOutput() {
56 fHasSecondaryOutput =
true;
73const char* GrGLSLFragmentShaderBuilder::getPrimaryColorOutputName()
const {
74 return DeclaredColorOutputName();
77bool GrGLSLFragmentShaderBuilder::primaryColorOutputIsInOut()
const {
78 return fPrimaryColorIsInOut;
81const char* GrGLSLFragmentShaderBuilder::getSecondaryColorOutputName()
const {
84 ? DeclaredSecondaryColorOutputName()
85 :
"sk_SecondaryFragColor";
94void GrGLSLFragmentShaderBuilder::onFinalize() {
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
void enableAdvancedBlendEquationIfNeeded(skgpu::BlendEquation) override
bool hasSecondaryOutput() const override
const char * dstColor() override
GrGLSLFragmentShaderBuilder(GrGLSLProgramBuilder *program)
virtual void finalizeFragmentSecondaryColor(GrShaderVar &outputColor)
const GrShaderCaps * shaderCaps() const
virtual GrGLSLVaryingHandler * varyingHandler()=0
GrSurfaceOrigin origin() const
void addLayoutQualifier(const char *param, InterfaceQualifier)
bool addFeature(uint32_t featureBit, const char *extensionName)
@ kBlendFuncExtended_GLSLPrivateFeature
@ kBlendEquationAdvanced_GLSLPrivateFeature
@ kFramebufferFetch_GLSLPrivateFeature
@ kOut_InterfaceQualifier
void codeAppendf(const char format[],...) SK_PRINTF_LIKE(2
GrGLSLProgramBuilder * fProgramBuilder
void getFragDecls(SkString *inputDecls, SkString *outputDecls) const
T & emplace_back(Args &&... args)
static constexpr bool BlendEquationIsAdvanced(BlendEquation equation)
const char * fSecondaryOutputExtensionString
bool mustDeclareFragmentShaderOutput() const
bool mustEnableAdvBlendEqs() const