30 int value = UINT16_MAX;
54 static_assert(2 ==
sizeof(swizzle.
asKey()));
55 uint16_t swizzleKey = swizzle.
asKey();
63 b->add32(numTextureSamplers,
"ppNumSamplers");
64 for (
int i = 0;
i < numTextureSamplers; ++
i) {
88 b->appendComment(geomProc.
name());
101 b->appendComment(xp.
name());
107 if (dstView.
proxy()) {
108 origin = dstView.
origin();
109 originIfDstTexture = &origin;
113 b->add32(samplerKey);
125 b->appendComment(
fp.name());
130 if (
auto* te =
fp.asTextureEffect()) {
131 const GrBackendFormat& backendFormat = te->view().proxy()->backendFormat();
133 b->add32(samplerKey,
"fpSamplerKey");
138 b->add32(
fp.numChildProcessors(),
"fpNumChildren");
140 for (
int i = 0;
i <
fp.numChildProcessors(); ++
i) {
141 if (
auto child =
fp.childProcessor(
i)) {
145 b->appendComment(
"Null");
146 b->addBits(
kClassIDBits, GrProcessor::ClassID::kNull_ClassID,
"fpClassID");
182 desc->fInitialKeyLength =
desc->keyLength();
191 return b.description();
static void gen_geomproc_key(const GrGeometryProcessor &geomProc, const GrCaps &caps, skgpu::KeyBuilder *b)
static void gen_key(skgpu::KeyBuilder *b, const GrProgramInfo &programInfo, const GrCaps &caps)
static constexpr uint32_t kClassIDBits
@ kSamplerOrImageTypeKeyBits
static void add_geomproc_sampler_keys(skgpu::KeyBuilder *b, const GrGeometryProcessor &geomProc, const GrCaps &caps)
static uint32_t sampler_key(GrTextureType textureType, const skgpu::Swizzle &swizzle, const GrCaps &caps)
static void gen_xp_key(const GrXferProcessor &xp, const GrCaps &caps, const GrPipeline &pipeline, skgpu::KeyBuilder *b)
static void gen_fp_key(const GrFragmentProcessor &fp, const GrCaps &caps, skgpu::KeyBuilder *b)
static uint16_t texture_type_key(GrTextureType type)
#define SK_ABORT(message,...)
constexpr uint16_t SkToU16(S x)
constexpr uint32_t SkToU32(S x)
virtual void addExtraSamplerKey(skgpu::KeyBuilder *, GrSamplerState, const GrBackendFormat &) const
const GrShaderCaps * shaderCaps() const
const GrBackendFormat & backendFormat() const
const skgpu::Swizzle & swizzle() const
GrSamplerState samplerState() const
const TextureSampler & textureSampler(int index) const
int numTextureSamplers() const
static constexpr int kCoordTransformKeyBits
virtual void addToKey(const GrShaderCaps &, skgpu::KeyBuilder *) const =0
static uint32_t ComputeCoordTransformsKey(const GrFragmentProcessor &fp)
void getAttributeKey(skgpu::KeyBuilder *b) const
const skgpu::Swizzle & writeSwizzle() const
bool snapVerticesToPixelCenters() const
int numFragmentProcessors() const
int numColorFragmentProcessors() const
GrDstSampleFlags dstSampleFlags() const
const GrFragmentProcessor & getFragmentProcessor(int idx) const
const GrSurfaceProxyView & dstProxyView() const
const GrXferProcessor & getXferProcessor() const
virtual const char * name() const =0
static void Build(GrProgramDesc *, const GrProgramInfo &, const GrCaps &)
static SkString Describe(const GrProgramInfo &, const GrCaps &)
GrPrimitiveType primitiveType() const
const GrPipeline & pipeline() const
const GrGeometryProcessor & geomProc() const
skgpu::Swizzle swizzle() const
GrSurfaceOrigin origin() const
GrSurfaceProxy * proxy() const
const GrBackendFormat & backendFormat() const
void addToKey(const GrShaderCaps &, skgpu::KeyBuilder *, const GrSurfaceOrigin *originIfDstTexture, bool usesInputAttachmentForDstRead) const
constexpr uint16_t asKey() const