Go to the source code of this file.
|
static uint16_t | texture_type_key (GrTextureType type) |
|
static uint32_t | sampler_key (GrTextureType textureType, const skgpu::Swizzle &swizzle, const GrCaps &caps) |
|
static void | add_geomproc_sampler_keys (skgpu::KeyBuilder *b, const GrGeometryProcessor &geomProc, const GrCaps &caps) |
|
static void | gen_geomproc_key (const GrGeometryProcessor &geomProc, const GrCaps &caps, skgpu::KeyBuilder *b) |
|
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 void | gen_key (skgpu::KeyBuilder *b, const GrProgramInfo &programInfo, const GrCaps &caps) |
|
◆ anonymous enum
Enumerator |
---|
kSamplerOrImageTypeKeyBits | |
Definition at line 25 of file GrProgramDesc.cpp.
25 {
27};
@ kSamplerOrImageTypeKeyBits
◆ add_geomproc_sampler_keys()
Definition at line 59 of file GrProgramDesc.cpp.
61 {
63 b->add32(numTextureSamplers,
"ppNumSamplers");
64 for (
int i = 0;
i < numTextureSamplers; ++
i) {
67
70
72 }
73}
static uint32_t sampler_key(GrTextureType textureType, const skgpu::Swizzle &swizzle, const GrCaps &caps)
virtual void addExtraSamplerKey(skgpu::KeyBuilder *, GrSamplerState, const GrBackendFormat &) const
const GrBackendFormat & backendFormat() const
const skgpu::Swizzle & swizzle() const
GrSamplerState samplerState() const
const TextureSampler & textureSampler(int index) const
int numTextureSamplers() const
◆ gen_fp_key()
Definition at line 122 of file GrProgramDesc.cpp.
124 {
125 b->appendComment(
fp.name());
129
130 if (
auto* te =
fp.asTextureEffect()) {
131 const GrBackendFormat& backendFormat = te->view().proxy()->backendFormat();
133 b->add32(samplerKey,
"fpSamplerKey");
135 }
136
138 b->add32(
fp.numChildProcessors(),
"fpNumChildren");
139
140 for (
int i = 0;
i <
fp.numChildProcessors(); ++
i) {
141 if (
auto child =
fp.childProcessor(
i)) {
143 } else {
144
145 b->appendComment(
"Null");
146 b->addBits(
kClassIDBits, GrProcessor::ClassID::kNull_ClassID,
"fpClassID");
147 }
148 }
149}
static constexpr uint32_t kClassIDBits
static void gen_fp_key(const GrFragmentProcessor &fp, const GrCaps &caps, skgpu::KeyBuilder *b)
const GrShaderCaps * shaderCaps() const
static constexpr int kCoordTransformKeyBits
static uint32_t ComputeCoordTransformsKey(const GrFragmentProcessor &fp)
◆ gen_geomproc_key()
Functions which emit processor key info into the key builder. For every effect, we include the effect's class ID (different for every GrProcessor subclass), any information generated by the effect itself (addToKey), and some meta-information. Shader code may be dependent on properties of the effect not placed in the key by the effect (e.g. pixel format of textures used).
Definition at line 85 of file GrProgramDesc.cpp.
87 {
88 b->appendComment(geomProc.
name());
90
93
95}
static void add_geomproc_sampler_keys(skgpu::KeyBuilder *b, const GrGeometryProcessor &geomProc, const GrCaps &caps)
virtual void addToKey(const GrShaderCaps &, skgpu::KeyBuilder *) const =0
void getAttributeKey(skgpu::KeyBuilder *b) const
virtual const char * name() const =0
◆ gen_key()
Definition at line 151 of file GrProgramDesc.cpp.
153 {
155
161 }
162
164
167
168
170
171
172
174}
static void gen_geomproc_key(const GrGeometryProcessor &geomProc, const GrCaps &caps, skgpu::KeyBuilder *b)
static void gen_xp_key(const GrXferProcessor &xp, const GrCaps &caps, const GrPipeline &pipeline, skgpu::KeyBuilder *b)
const skgpu::Swizzle & writeSwizzle() const
bool snapVerticesToPixelCenters() const
int numFragmentProcessors() const
int numColorFragmentProcessors() const
const GrFragmentProcessor & getFragmentProcessor(int idx) const
const GrXferProcessor & getXferProcessor() const
GrPrimitiveType primitiveType() const
const GrPipeline & pipeline() const
const GrGeometryProcessor & geomProc() const
constexpr uint16_t asKey() const
◆ gen_xp_key()
Definition at line 97 of file GrProgramDesc.cpp.
100 {
101 b->appendComment(xp.
name());
103
107 if (dstView.
proxy()) {
108 origin = dstView.
origin();
109 originIfDstTexture = &origin;
110
113 b->add32(samplerKey);
114 }
115
118 originIfDstTexture,
120}
GrDstSampleFlags dstSampleFlags() const
const GrSurfaceProxyView & dstProxyView() 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
◆ sampler_key()
Definition at line 50 of file GrProgramDesc.cpp.
51 {
53
54 static_assert(2 ==
sizeof(swizzle.
asKey()));
55 uint16_t swizzleKey = swizzle.
asKey();
57}
static uint16_t texture_type_key(GrTextureType type)
constexpr uint32_t SkToU32(S x)
◆ texture_type_key()
Definition at line 29 of file GrProgramDesc.cpp.
29 {
30 int value = UINT16_MAX;
34 break;
37 break;
40 break;
41 default:
44 break;
45 }
48}
#define SK_ABORT(message,...)
constexpr uint16_t SkToU16(S x)
◆ kClassIDBits
constexpr uint32_t kClassIDBits = 8 |
|
staticconstexpr |