8#ifndef skgpu_graphite_ContextUtils_DEFINED
9#define skgpu_graphite_ContextUtils_DEFINED
33class GraphicsPipelineDesc;
35class PipelineDataGatherer;
39class RuntimeEffectDictionary;
41class UniquePaintParamsID;
43struct ResourceBindingRequirements;
68std::tuple<UniquePaintParamsID, const UniformDataBlock*, const TextureDataBlock*>
ExtractPaintData(
70 PipelineDataGatherer* gatherer,
73 const SkM44& local2Dev,
75 const Geometry& geometry,
83 PipelineDataGatherer* gatherer,
85 const RenderStep*
step,
91 const RenderStep*
step,
92 bool defineShadingSsboIndexVarying,
93 bool defineLocalCoordsVarying);
98 const ShaderCodeDictionary*,
99 const RuntimeEffectDictionary*,
100 const RenderStep* renderStep,
101 UniquePaintParamsID paintID,
102 bool useStorageBuffers,
106 const RenderPassDesc& renderPassDesc,
107 const RenderStep* renderStep,
108 UniquePaintParamsID paintID);
115 int* numPaintUniforms,
116 int* paintUniformsTotalBytes,
117 bool* wrotePaintColor);
121 int* renderStepUniformsTotalBytes);
124 int* numPaintUniforms,
125 bool* wrotePaintColor);
129 const char* ssboIndex,
132 const char* ssboIndex,
133 const char* uniformName);
139 const char* direction,
140 bool emitSsboIndicesVarying,
141 bool emitLocalCoordsVarying);
static int step(int x, SkScalar min, SkScalar max)
static bool ComputeStep(const SkPoint &a, const SkPoint &b, SkScalar radius, SkPoint *step)
const EmbeddedViewParams * params
VertSkSLInfo BuildVertexSkSL(const ResourceBindingRequirements &bindingReqs, const RenderStep *step, bool useStorageBuffers, bool defineLocalCoordsVarying)
std::string EmitPaintParamsUniforms(int bufferID, const Layout layout, SkSpan< const ShaderNode * > nodes, int *numUniforms, int *uniformsTotalBytes, bool *wrotePaintColor)
std::string BuildComputeSkSL(const Caps *caps, const ComputeStep *step)
std::string EmitStorageBufferAccess(const char *bufferNamePrefix, const char *ssboIndex, const char *uniformName)
DstReadRequirement GetDstReadRequirement(const Caps *caps, std::optional< SkBlendMode > blendMode, Coverage coverage)
std::string EmitTexturesAndSamplers(const ResourceBindingRequirements &bindingReqs, SkSpan< const ShaderNode * > nodes, int *binding)
FragSkSLInfo BuildFragmentSkSL(const Caps *caps, const ShaderCodeDictionary *dict, const RuntimeEffectDictionary *rteDict, const RenderStep *step, UniquePaintParamsID paintID, bool useStorageBuffers, skgpu::Swizzle writeSwizzle)
std::string GetPipelineLabel(const ShaderCodeDictionary *dict, const RenderPassDesc &renderPassDesc, const RenderStep *renderStep, UniquePaintParamsID paintID)
std::string EmitRenderStepStorageBuffer(int bufferID, SkSpan< const Uniform > uniforms)
std::string EmitRenderStepUniforms(int bufferID, const Layout layout, SkSpan< const Uniform > uniforms, int *renderStepUniformsTotalBytes)
PipelineDataCache< UniformDataBlock > UniformDataCache
std::string EmitVaryings(const RenderStep *step, const char *direction, bool emitSsboIndicesVarying, bool emitLocalCoordsVarying)
std::string EmitPaintParamsStorageBuffer(int bufferID, SkSpan< const ShaderNode * > nodes, int *numUniforms, bool *wrotePaintColor)
std::tuple< const UniformDataBlock *, const TextureDataBlock * > ExtractRenderStepData(UniformDataCache *uniformDataCache, TextureDataCache *textureDataCache, PipelineDataGatherer *gatherer, const Layout layout, const RenderStep *step, const DrawParams ¶ms)
std::string EmitSamplerLayout(const ResourceBindingRequirements &bindingReqs, int *binding)
std::tuple< UniquePaintParamsID, const UniformDataBlock *, const TextureDataBlock * > ExtractPaintData(Recorder *recorder, PipelineDataGatherer *gatherer, PaintParamsKeyBuilder *builder, const Layout layout, const SkM44 &local2Dev, const PaintParams &p, const Geometry &geometry, sk_sp< TextureProxy > dstTexture, SkIPoint dstOffset, const SkColorInfo &targetColorInfo)
PipelineDataCache< TextureDataBlock > TextureDataCache
std::string EmitUniformsFromStorageBuffer(const char *bufferNamePrefix, const char *ssboIndex, SkSpan< const Uniform > uniforms)
bool fRequiresLocalCoords
int fNumTexturesAndSamplers
skia_private::TArray< uint32_t > fData
int fPaintUniformsTotalBytes
int fRenderStepUniformsTotalBytes
int fRenderStepUniformsTotalBytes