#include "src/gpu/ganesh/glsl/GrGLSLProgramBuilder.h"
#include "include/core/SkSpan.h"
#include "include/core/SkString.h"
#include "include/gpu/ganesh/GrTypes.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkTemplates.h"
#include "src/core/SkSLTypeShared.h"
#include "src/gpu/ganesh/GrFragmentProcessor.h"
#include "src/gpu/ganesh/GrGeometryProcessor.h"
#include "src/gpu/ganesh/GrPipeline.h"
#include "src/gpu/ganesh/GrResourceHandle.h"
#include "src/gpu/ganesh/GrShaderCaps.h"
#include "src/gpu/ganesh/GrSurfaceProxy.h"
#include "src/gpu/ganesh/GrSurfaceProxyView.h"
#include "src/gpu/ganesh/GrTextureProxy.h"
#include "src/gpu/ganesh/GrXferProcessor.h"
#include "src/gpu/ganesh/effects/GrTextureEffect.h"
#include "src/gpu/ganesh/glsl/GrGLSLVarying.h"
#include "src/sksl/SkSLCompiler.h"
#include "src/sksl/SkSLString.h"
#include <functional>
#include <memory>
#include <tuple>
#include <unordered_map>
#include <utility>
usingnamespaceskia_private;
const int GrGLSLProgramBuilder::kVarsPerBlock = …;
GrGLSLProgramBuilder::GrGLSLProgramBuilder(const GrProgramDesc& desc,
const GrProgramInfo& programInfo)
: … { … }
GrGLSLProgramBuilder::~GrGLSLProgramBuilder() = default;
void GrGLSLProgramBuilder::addFeature(GrShaderFlags shaders,
uint32_t featureBit,
const char* extensionName) { … }
bool GrGLSLProgramBuilder::emitAndInstallProcs() { … }
bool GrGLSLProgramBuilder::emitAndInstallPrimProc(SkString* outputColor, SkString* outputCoverage) { … }
bool GrGLSLProgramBuilder::emitAndInstallFragProcs(SkString* color, SkString* coverage) { … }
bool GrGLSLProgramBuilder::emitTextureSamplersForFPs(const GrFragmentProcessor& fp,
GrFragmentProcessor::ProgramImpl& impl,
int* samplerIndex) { … }
std::string GrGLSLProgramBuilder::invokeFP(const GrFragmentProcessor& fp,
const GrFragmentProcessor::ProgramImpl& impl,
const char* inputColor,
const char* destColor,
const char* coords) const { … }
SkString GrGLSLProgramBuilder::emitRootFragProc(const GrFragmentProcessor& fp,
GrFragmentProcessor::ProgramImpl& impl,
const SkString& input,
SkString output) { … }
void GrGLSLProgramBuilder::writeChildFPFunctions(const GrFragmentProcessor& fp,
GrFragmentProcessor::ProgramImpl& impl) { … }
void GrGLSLProgramBuilder::writeFPFunction(const GrFragmentProcessor& fp,
GrFragmentProcessor::ProgramImpl& impl) { … }
bool GrGLSLProgramBuilder::emitAndInstallDstTexture() { … }
bool GrGLSLProgramBuilder::emitAndInstallXferProc(const SkString& colorIn,
const SkString& coverageIn) { … }
GrGLSLProgramBuilder::SamplerHandle GrGLSLProgramBuilder::emitSampler(
const GrBackendFormat& backendFormat, GrSamplerState state, const skgpu::Swizzle& swizzle,
const char* name) { … }
GrGLSLProgramBuilder::SamplerHandle GrGLSLProgramBuilder::emitInputSampler(
const skgpu::Swizzle& swizzle, const char* name) { … }
bool GrGLSLProgramBuilder::checkSamplerCounts() { … }
#ifdef SK_DEBUG
void GrGLSLProgramBuilder::verify(const GrGeometryProcessor& geomProc) { … }
void GrGLSLProgramBuilder::verify(const GrFragmentProcessor& fp) { … }
void GrGLSLProgramBuilder::verify(const GrXferProcessor& xp) { … }
#endif
SkString GrGLSLProgramBuilder::getMangleSuffix() const { … }
SkString GrGLSLProgramBuilder::nameVariable(char prefix, const char* name, bool mangle) { … }
void GrGLSLProgramBuilder::nameExpression(SkString* output, const char* baseName) { … }
void GrGLSLProgramBuilder::appendUniformDecls(GrShaderFlags visibility, SkString* out) const { … }
void GrGLSLProgramBuilder::addRTFlipUniform(const char* name) { … }
bool GrGLSLProgramBuilder::fragmentProcessorHasCoordsParam(const GrFragmentProcessor* fp) const { … }
void GrGLSLProgramBuilder::finalizeShaders() { … }