22#define GL_CALL(X) GR_GL_CALL(fGpu->glInterface(), X)
23#define GL_CALL_RET(R, X) GR_GL_CALL_RET(fGpu->glInterface(), R, X)
33 std::unique_ptr<GrGeometryProcessor::ProgramImpl> gpImpl,
34 std::unique_ptr<GrXferProcessor::ProgramImpl> xpImpl,
35 std::vector<std::unique_ptr<GrFragmentProcessor::ProgramImpl>> fpImpls,
37 int vertexAttributeCnt,
38 int instanceAttributeCnt,
49 std::move(attributes),
60GrGLProgram::GrGLProgram(
GrGLGpu* gpu,
63 const UniformInfoArray& uniforms,
64 const UniformInfoArray& textureSamplers,
65 std::unique_ptr<GrGeometryProcessor::ProgramImpl> gpImpl,
66 std::unique_ptr<GrXferProcessor::ProgramImpl> xpImpl,
67 std::vector<std::unique_ptr<GrFragmentProcessor::ProgramImpl>> fpImpls,
69 int vertexAttributeCnt,
70 int instanceAttributeCnt,
73 : fBuiltinUniformHandles(builtinUniforms)
74 , fProgramID(programID)
75 , fGPImpl(
std::move(gpImpl))
76 , fXPImpl(
std::move(xpImpl))
77 , fFPImpls(
std::move(fpImpls))
78 , fAttributes(
std::move(attributes))
79 , fVertexAttributeCnt(vertexAttributeCnt)
80 , fInstanceAttributeCnt(instanceAttributeCnt)
81 , fVertexStride(vertexStride)
82 , fInstanceStride(instanceStride)
84 , fProgramDataManager(gpu, uniforms)
85 , fNumTextureSamplers(textureSamplers.
count()) {}
89 GL_CALL(DeleteProgram(fProgramID));
101 this->setRenderTargetState(renderTarget, programInfo.
origin(), programInfo.
geomProc());
111 for (
int i = 0;
i < programInfo.
pipeline().numFragmentProcessors(); ++
i) {
128 SkASSERT(geomProcTextures[
i]->asTextureProxy());
148 SkASSERT(nextTexSamplerIdx == fNumTextureSamplers);
168 if (fBuiltinUniformHandles.
fRTFlipUni.isValid()) {
@ kBottomLeft_GrSurfaceOrigin
const GrShaderCaps * shaderCaps() const
void setData(const GrGLSLProgramDataManager &pdman, const GrFragmentProcessor &processor)
void bindTexture(int unitIdx, GrSamplerState samplerState, const skgpu::Swizzle &, GrGLTexture *)
void flushProgram(sk_sp< GrGLProgram >)
void set4fv(UniformHandle, int arrayCount, const float v[]) const override
void setSamplerUniforms(const UniformInfoArray &samplers, int startUnit) const
void set2fv(UniformHandle, int arrayCount, const float v[]) const override
int instanceStride() const
GrGLuint programID() const
void bindTextures(const GrGeometryProcessor &, const GrSurfaceProxy *const geomProcTextures[], const GrPipeline &)
void updateUniforms(const GrRenderTarget *, const GrProgramInfo &)
static sk_sp< GrGLProgram > Make(GrGLGpu *, const GrGLSLBuiltinUniformHandles &, GrGLuint programID, const UniformInfoArray &uniforms, const UniformInfoArray &textureSamplers, std::unique_ptr< GrGeometryProcessor::ProgramImpl >, std::unique_ptr< GrXferProcessor::ProgramImpl >, std::vector< std::unique_ptr< GrFragmentProcessor::ProgramImpl > > fps, std::unique_ptr< Attribute[]>, int vertexAttributeCnt, int instanceAttributeCnt, int vertexStride, int instanceStride)
const skgpu::Swizzle & swizzle() const
GrSamplerState samplerState() const
const TextureSampler & textureSampler(int index) const
int numTextureSamplers() const
const GrCaps * caps() const
void setDstTextureUniforms(const GrGLSLProgramDataManager &pdm, GrGLSLBuiltinUniformHandles *fBuiltinUniformHandles) const
const GrFragmentProcessor & getFragmentProcessor(int idx) const
void visitTextureEffects(const std::function< void(const GrTextureEffect &)> &) const
const GrSurfaceProxyView & dstProxyView() const
GrTexture * peekDstTexture() const
const GrXferProcessor & getXferProcessor() const
GrSurfaceOrigin origin() const
const GrPipeline & pipeline() const
const GrGeometryProcessor & geomProc() const
skgpu::Swizzle swizzle() const
GrTexture * peekTexture() const
SkISize dimensions() const
const GrSurfaceProxyView & view() const
GrTexture * texture() const
GrSamplerState samplerState() const
static std::array< float, 2 > GetRTFlipVector(int rtHeight, bool flipY)
static std::array< float, 4 > GetRTAdjustVector(SkISize rtDims, bool flipY)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
SkISize fRenderTargetSize
GrSurfaceOrigin fRenderTargetOrigin
constexpr int32_t height() const