#include "src/gpu/ganesh/gl/builders/GrGLProgramBuilder.h"
#include "include/core/SkTypes.h"
#include "include/gpu/ganesh/GrDirectContext.h"
#include "include/gpu/ganesh/gl/GrGLFunctions.h"
#include "include/gpu/ganesh/gl/GrGLInterface.h"
#include "include/private/base/SkTArray.h"
#include "include/private/base/SkTDArray.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/base/SkAutoMalloc.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkTraceEvent.h"
#include "src/core/SkWriteBuffer.h"
#include "src/gpu/ganesh/GrAutoLocaleSetter.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrGeometryProcessor.h"
#include "src/gpu/ganesh/GrPersistentCacheUtils.h"
#include "src/gpu/ganesh/GrProgramDesc.h"
#include "src/gpu/ganesh/GrShaderCaps.h"
#include "src/gpu/ganesh/GrThreadSafePipelineBuilder.h"
#include "src/gpu/ganesh/gl/GrGLCaps.h"
#include "src/gpu/ganesh/gl/GrGLDefines.h"
#include "src/gpu/ganesh/gl/GrGLGpu.h"
#include "src/gpu/ganesh/gl/GrGLProgram.h"
#include "src/gpu/ganesh/gl/GrGLUtil.h"
#include "src/gpu/ganesh/gl/builders/GrGLShaderStringBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLVertexGeoBuilder.h"
#include "src/sksl/SkSLProgramKind.h"
#include "src/sksl/SkSLProgramSettings.h"
#include "src/utils/SkShaderUtils.h"
#include <cstdint>
#include <memory>
#include <utility>
#define GL_CALL(X) …
#define GL_CALL_RET(R, X) …
static void cleanup_shaders(GrGLGpu* gpu, const SkTDArray<GrGLuint>& shaderIDs) { … }
static void cleanup_program(GrGLGpu* gpu, GrGLuint programID,
const SkTDArray<GrGLuint>& shaderIDs) { … }
sk_sp<GrGLProgram> GrGLProgramBuilder::CreateProgram(
GrDirectContext* dContext,
const GrProgramDesc& desc,
const GrProgramInfo& programInfo,
const GrGLPrecompiledProgram* precompiledProgram) { … }
GrGLProgramBuilder::GrGLProgramBuilder(GrGLGpu* gpu,
const GrProgramDesc& desc,
const GrProgramInfo& programInfo)
: … { … }
const GrCaps* GrGLProgramBuilder::caps() const { … }
bool GrGLProgramBuilder::compileAndAttachShaders(const std::string& glsl,
GrGLuint programId,
GrGLenum type,
SkTDArray<GrGLuint>* shaderIds,
bool shaderWasCached,
GrContextOptions::ShaderErrorHandler* errHandler) { … }
void GrGLProgramBuilder::computeCountsAndStrides(GrGLuint programID,
const GrGeometryProcessor& geomProc,
bool bindAttribLocations) { … }
void GrGLProgramBuilder::addInputVars(const SkSL::Program::Interface& interface) { … }
static constexpr SkFourByteTag kSKSL_Tag = …;
static constexpr SkFourByteTag kGLSL_Tag = …;
static constexpr SkFourByteTag kGLPB_Tag = …;
void GrGLProgramBuilder::storeShaderInCache(const SkSL::Program::Interface& interface,
GrGLuint programID,
const std::string shaders[],
bool isSkSL,
SkSL::ProgramSettings* settings) { … }
sk_sp<GrGLProgram> GrGLProgramBuilder::finalize(const GrGLPrecompiledProgram* precompiledProgram) { … }
void GrGLProgramBuilder::bindProgramResourceLocations(GrGLuint programID) { … }
void GrGLProgramBuilder::resolveProgramResourceLocations(GrGLuint programID, bool force) { … }
sk_sp<GrGLProgram> GrGLProgramBuilder::createProgram(GrGLuint programID) { … }
bool GrGLProgramBuilder::PrecompileProgram(GrDirectContext* dContext,
GrGLPrecompiledProgram* precompiledProgram,
const SkData& cachedData) { … }