Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Attributes | List of all members
skgpu::graphite::DawnCaps Class Referencefinal

#include <DawnCaps.h>

Inheritance diagram for skgpu::graphite::DawnCaps:
skgpu::graphite::Caps

Public Member Functions

 DawnCaps (const DawnBackendContext &, const ContextOptions &)
 
 ~DawnCaps () override
 
bool useAsyncPipelineCreation () const
 
bool allowScopedErrorChecks () const
 
std::optional< wgpu::LoadOp > resolveTextureLoadOp () const
 
TextureInfo getDefaultSampledTextureInfo (SkColorType, Mipmapped mipmapped, Protected, Renderable) const override
 
TextureInfo getTextureInfoForSampledCopy (const TextureInfo &textureInfo, Mipmapped mipmapped) const override
 
TextureInfo getDefaultCompressedTextureInfo (SkTextureCompressionType, Mipmapped mipmapped, Protected) const override
 
TextureInfo getDefaultMSAATextureInfo (const TextureInfo &singleSampledInfo, Discardable discardable) const override
 
TextureInfo getDefaultDepthStencilTextureInfo (SkEnumBitMask< DepthStencilFlags >, uint32_t sampleCount, Protected) const override
 
TextureInfo getDefaultStorageTextureInfo (SkColorType) const override
 
SkISize getDepthAttachmentDimensions (const TextureInfo &, const SkISize colorAttachmentDimensions) const override
 
UniqueKey makeGraphicsPipelineKey (const GraphicsPipelineDesc &, const RenderPassDesc &) const override
 
UniqueKey makeComputePipelineKey (const ComputePipelineDesc &) const override
 
uint32_t channelMask (const TextureInfo &) const override
 
bool isRenderable (const TextureInfo &) const override
 
bool isStorage (const TextureInfo &) const override
 
void buildKeyForTexture (SkISize dimensions, const TextureInfo &, ResourceType, Shareable, GraphiteResourceKey *) const override
 
uint64_t getRenderPassDescKeyForPipeline (const RenderPassDesc &renderPassDesc) const
 
- Public Member Functions inherited from skgpu::graphite::Caps
virtual ~Caps ()
 
const SkSL::ShaderCapsshaderCaps () const
 
sk_sp< SkCapabilitiescapabilities () const
 
virtual TextureInfo getDefaultSampledTextureInfo (SkColorType, Mipmapped mipmapped, Protected, Renderable) const =0
 
virtual TextureInfo getTextureInfoForSampledCopy (const TextureInfo &textureInfo, Mipmapped mipmapped) const =0
 
virtual TextureInfo getDefaultCompressedTextureInfo (SkTextureCompressionType, Mipmapped mipmapped, Protected) const =0
 
virtual TextureInfo getDefaultMSAATextureInfo (const TextureInfo &singleSampledInfo, Discardable discardable) const =0
 
virtual TextureInfo getDefaultDepthStencilTextureInfo (SkEnumBitMask< DepthStencilFlags >, uint32_t sampleCount, Protected) const =0
 
virtual TextureInfo getDefaultStorageTextureInfo (SkColorType) const =0
 
virtual SkISize getDepthAttachmentDimensions (const TextureInfo &, const SkISize colorAttachmentDimensions) const
 
virtual UniqueKey makeGraphicsPipelineKey (const GraphicsPipelineDesc &, const RenderPassDesc &) const =0
 
virtual UniqueKey makeComputePipelineKey (const ComputePipelineDesc &) const =0
 
virtual GraphiteResourceKey makeSamplerKey (const SamplerDesc &samplerDesc) const
 
virtual ImmutableSamplerInfo getImmutableSamplerInfo (const TextureProxy *) const
 
virtual bool extractGraphicsDescs (const UniqueKey &, GraphicsPipelineDesc *, RenderPassDesc *, const RendererProvider *) const
 
bool areColorTypeAndTextureInfoCompatible (SkColorType, const TextureInfo &) const
 
virtual uint32_t channelMask (const TextureInfo &) const =0
 
bool isTexturable (const TextureInfo &) const
 
virtual bool isRenderable (const TextureInfo &) const =0
 
virtual bool isStorage (const TextureInfo &) const =0
 
int maxTextureSize () const
 
int defaultMSAASamplesCount () const
 
virtual void buildKeyForTexture (SkISize dimensions, const TextureInfo &, ResourceType, Shareable, GraphiteResourceKey *) const =0
 
const ResourceBindingRequirementsresourceBindingRequirements () const
 
size_t requiredUniformBufferAlignment () const
 
size_t requiredStorageBufferAlignment () const
 
size_t requiredTransferBufferAlignment () const
 
size_t getAlignedTextureDataRowBytes (size_t rowBytes) const
 
virtual bool supportsWritePixels (const TextureInfo &textureInfo) const =0
 
virtual bool supportsReadPixels (const TextureInfo &textureInfo) const =0
 
virtual std::pair< SkColorType, bool > supportedWritePixelsColorType (SkColorType dstColorType, const TextureInfo &dstTextureInfo, SkColorType srcColorType) const =0
 
virtual std::pair< SkColorType, bool > supportedReadPixelsColorType (SkColorType srcColorType, const TextureInfo &srcTextureInfo, SkColorType dstColorType) const =0
 
SkColorType getRenderableColorType (SkColorType) const
 
bool clampToBorderSupport () const
 
bool protectedSupport () const
 
bool semaphoreSupport () const
 
bool allowCpuSync () const
 
bool storageBufferSupport () const
 
bool storageBufferPreferred () const
 
bool drawBufferCanBeMapped () const
 
bool bufferMapsAreAsync () const
 
bool msaaRenderToSingleSampledSupport () const
 
bool computeSupport () const
 
bool supportsAHardwareBufferImages () const
 
skgpu::Swizzle getReadSwizzle (SkColorType, const TextureInfo &) const
 
skgpu::Swizzle getWriteSwizzle (SkColorType, const TextureInfo &) const
 
skgpu::ShaderErrorHandlershaderErrorHandler () const
 
DstReadRequirement getDstReadRequirement () const
 
float minDistanceFieldFontSize () const
 
float glyphsAsPathsFontSize () const
 
size_t glyphCacheTextureMaximumBytes () const
 
int maxPathAtlasTextureSize () const
 
bool allowMultipleAtlasTextures () const
 
bool supportBilerpFromGlyphAtlas () const
 
bool requireOrderedRecordings () const
 
bool fullCompressedUploadSizeMustAlignToBlockDims () const
 
sktext::gpu::SDFTControl getSDFTControl (bool useSDFTForSmallText) const
 
bool setBackendLabels () const
 

Static Public Attributes

static constexpr size_t kFormatCnt = 18
 

Additional Inherited Members

- Protected Member Functions inherited from skgpu::graphite::Caps
 Caps ()
 
void finishInitialization (const ContextOptions &)
 
- Static Protected Member Functions inherited from skgpu::graphite::Caps
static uint32_t SamplesToKey (uint32_t numSamples)
 
- Protected Attributes inherited from skgpu::graphite::Caps
int fMaxTextureSize = 0
 
int fDefaultMSAASamples = 4
 
size_t fRequiredUniformBufferAlignment = 0
 
size_t fRequiredStorageBufferAlignment = 0
 
size_t fRequiredTransferBufferAlignment = 0
 
size_t fTextureDataRowBytesAlignment = 1
 
std::unique_ptr< SkSL::ShaderCapsfShaderCaps
 
bool fClampToBorderSupport = true
 
bool fProtectedSupport = false
 
bool fSemaphoreSupport = false
 
bool fAllowCpuSync = true
 
bool fStorageBufferSupport = false
 
bool fStorageBufferPreferred = false
 
bool fDrawBufferCanBeMapped = true
 
bool fBufferMapsAreAsync = false
 
bool fMSAARenderToSingleSampledSupport = false
 
bool fComputeSupport = false
 
bool fSupportsAHardwareBufferImages = false
 
bool fFullCompressedUploadSizeMustAlignToBlockDims = false
 
ResourceBindingRequirements fResourceBindingReqs
 
ShaderErrorHandlerfShaderErrorHandler = nullptr
 
size_t fGlyphCacheTextureMaximumBytes = 2048 * 1024 * 4
 
float fMinDistanceFieldFontSize = 18
 
float fGlyphsAsPathsFontSize = 324
 
int fMaxPathAtlasTextureSize = 8192
 
bool fAllowMultipleAtlasTextures = true
 
bool fSupportBilerpFromGlyphAtlas = false
 
bool fRequireOrderedRecordings = false
 
bool fSetBackendLabels = false
 

Detailed Description

Definition at line 22 of file DawnCaps.h.

Constructor & Destructor Documentation

◆ DawnCaps()

skgpu::graphite::DawnCaps::DawnCaps ( const DawnBackendContext backendContext,
const ContextOptions options 
)

Definition at line 77 of file DawnCaps.cpp.

78 : Caps() {
79 this->initCaps(backendContext, options);
80 this->initShaderCaps(backendContext.fDevice);
81 this->initFormatTable(backendContext.fDevice);
83}
const char * options
void finishInitialization(const ContextOptions &)
Definition: Caps.cpp:29

◆ ~DawnCaps()

skgpu::graphite::DawnCaps::~DawnCaps ( )
overridedefault

Member Function Documentation

◆ allowScopedErrorChecks()

bool skgpu::graphite::DawnCaps::allowScopedErrorChecks ( ) const
inline

Definition at line 28 of file DawnCaps.h.

28{ return fAllowScopedErrorChecks; }

◆ buildKeyForTexture()

void skgpu::graphite::DawnCaps::buildKeyForTexture ( SkISize  dimensions,
const TextureInfo info,
ResourceType  type,
Shareable  shareable,
GraphiteResourceKey key 
) const
overridevirtual

Implements skgpu::graphite::Caps.

Definition at line 941 of file DawnCaps.cpp.

945 {
946 const DawnTextureSpec& dawnSpec = info.dawnTextureSpec();
947
948 SkASSERT(!dimensions.isEmpty());
949
950 SkASSERT(dawnSpec.getViewFormat() != wgpu::TextureFormat::Undefined);
951 uint32_t formatKey = static_cast<uint32_t>(dawnSpec.getViewFormat());
952
953 uint32_t samplesKey = SamplesToKey(info.numSamples());
954 // We don't have to key the number of mip levels because it is inherit in the combination of
955 // isMipped and dimensions.
956 bool isMipped = info.mipmapped() == Mipmapped::kYes;
957
958 // Confirm all the below parts of the key can fit in a single uint32_t. The sum of the shift
959 // amounts in the asserts must be less than or equal to 32.
960 SkASSERT(samplesKey < (1u << 3)); // sample key is first 3 bits
961 SkASSERT(static_cast<uint32_t>(isMipped) < (1u << 1)); // isMapped is 4th bit
962 SkASSERT(static_cast<uint32_t>(dawnSpec.fUsage) < (1u << 28)); // usage is remaining 28 bits
963
964 // We need two uint32_ts for dimensions, 1 for format, and 1 for the rest of the key;
965 static int kNum32DataCnt = 2 + 1 + 1;
966
967 GraphiteResourceKey::Builder builder(key, type, kNum32DataCnt, shareable);
968
969 builder[0] = dimensions.width();
970 builder[1] = dimensions.height();
971 builder[2] = formatKey;
972 builder[3] = (samplesKey << 0) |
973 (static_cast<uint32_t>(isMipped) << 3) |
974 (static_cast<uint32_t>(dawnSpec.fUsage) << 4);
975}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
#define SkASSERT(cond)
Definition: SkAssert.h:116
GLenum type
static uint32_t SamplesToKey(uint32_t numSamples)
Definition: Caps.h:314
DlVertices::Builder Builder
bool isEmpty() const
Definition: SkSize.h:31
constexpr int32_t width() const
Definition: SkSize.h:36
constexpr int32_t height() const
Definition: SkSize.h:37

◆ channelMask()

uint32_t skgpu::graphite::DawnCaps::channelMask ( const TextureInfo info) const
overridevirtual

Implements skgpu::graphite::Caps.

Definition at line 87 of file DawnCaps.cpp.

87 {
88 return DawnFormatChannels(info.dawnTextureSpec().getViewFormat());
89}
uint32_t DawnFormatChannels(wgpu::TextureFormat format)
Definition: DawnUtils.cpp:63

◆ getDefaultCompressedTextureInfo()

TextureInfo skgpu::graphite::DawnCaps::getDefaultCompressedTextureInfo ( SkTextureCompressionType  compression,
Mipmapped  mipmapped,
Protected   
) const
overridevirtual

Implements skgpu::graphite::Caps.

Definition at line 241 of file DawnCaps.cpp.

243 {
244 wgpu::TextureUsage usage = wgpu::TextureUsage::TextureBinding |
245 wgpu::TextureUsage::CopyDst |
246 wgpu::TextureUsage::CopySrc;
247
248 wgpu::TextureFormat format = format_from_compression(compression);
249 if (format == wgpu::TextureFormat::Undefined) {
250 return {};
251 }
252
253 DawnTextureInfo info;
254 info.fSampleCount = 1;
255 info.fMipmapped = mipmapped;
256 info.fFormat = format;
257 info.fViewFormat = format;
258 info.fUsage = usage;
259
260 return info;
261}
uint32_t uint32_t * format
TextureUsage
Definition: formats.h:300
static void usage(char *argv0)

◆ getDefaultDepthStencilTextureInfo()

TextureInfo skgpu::graphite::DawnCaps::getDefaultDepthStencilTextureInfo ( SkEnumBitMask< DepthStencilFlags depthStencilType,
uint32_t  sampleCount,
Protected   
) const
overridevirtual

Implements skgpu::graphite::Caps.

Definition at line 285 of file DawnCaps.cpp.

288 {
289 DawnTextureInfo info;
290 info.fSampleCount = sampleCount;
291 info.fMipmapped = Mipmapped::kNo;
292 info.fFormat = DawnDepthStencilFlagsToFormat(depthStencilType);
293 info.fViewFormat = info.fFormat;
294 info.fUsage = wgpu::TextureUsage::RenderAttachment;
295
296 if (fSupportedTransientAttachmentUsage != wgpu::TextureUsage::None) {
297 info.fUsage |= fSupportedTransientAttachmentUsage;
298 }
299
300 return info;
301}
wgpu::TextureFormat DawnDepthStencilFlagsToFormat(SkEnumBitMask< DepthStencilFlags > mask)

◆ getDefaultMSAATextureInfo()

TextureInfo skgpu::graphite::DawnCaps::getDefaultMSAATextureInfo ( const TextureInfo singleSampledInfo,
Discardable  discardable 
) const
overridevirtual

Implements skgpu::graphite::Caps.

Definition at line 263 of file DawnCaps.cpp.

264 {
265 if (fDefaultMSAASamples <= 1) {
266 return {};
267 }
268 const DawnTextureSpec& singleSpec = singleSampledInfo.dawnTextureSpec();
269
270 DawnTextureInfo info;
271 info.fSampleCount = fDefaultMSAASamples;
272 info.fMipmapped = Mipmapped::kNo;
273 info.fFormat = singleSpec.fFormat;
274 info.fViewFormat = singleSpec.fFormat;
275 info.fUsage = wgpu::TextureUsage::RenderAttachment;
276
277 if (fSupportedTransientAttachmentUsage != wgpu::TextureUsage::None &&
278 discardable == Discardable::kYes) {
279 info.fUsage |= fSupportedTransientAttachmentUsage;
280 }
281
282 return info;
283}
int fDefaultMSAASamples
Definition: Caps.h:357

◆ getDefaultSampledTextureInfo()

TextureInfo skgpu::graphite::DawnCaps::getDefaultSampledTextureInfo ( SkColorType  colorType,
Mipmapped  mipmapped,
Protected  ,
Renderable  renderable 
) const
overridevirtual

Implements skgpu::graphite::Caps.

Definition at line 187 of file DawnCaps.cpp.

190 {
191 wgpu::TextureUsage usage = wgpu::TextureUsage::TextureBinding |
192 wgpu::TextureUsage::CopyDst |
193 wgpu::TextureUsage::CopySrc;
194 if (renderable == Renderable::kYes) {
195 usage |= wgpu::TextureUsage::RenderAttachment;
196 }
197
198 wgpu::TextureFormat format = this->getFormatFromColorType(colorType);
199 if (format == wgpu::TextureFormat::Undefined) {
200 return {};
201 }
202
203 DawnTextureInfo info;
204 info.fSampleCount = 1;
205 info.fMipmapped = mipmapped;
206 info.fFormat = format;
207 info.fViewFormat = format;
208 info.fUsage = usage;
209
210 return info;
211}
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)

◆ getDefaultStorageTextureInfo()

TextureInfo skgpu::graphite::DawnCaps::getDefaultStorageTextureInfo ( SkColorType  colorType) const
overridevirtual

Implements skgpu::graphite::Caps.

Definition at line 303 of file DawnCaps.cpp.

303 {
304 wgpu::TextureFormat format = this->getFormatFromColorType(colorType);
305 if (format == wgpu::TextureFormat::Undefined) {
306 SkDebugf("colorType=%d is not supported\n", static_cast<int>(colorType));
307 return {};
308 }
309
310 const FormatInfo& formatInfo = this->getFormatInfo(format);
311 if (!SkToBool(FormatInfo::kStorage_Flag & formatInfo.fFlags)) {
312 return {};
313 }
314
315 wgpu::TextureUsage usage = wgpu::TextureUsage::StorageBinding |
316 wgpu::TextureUsage::TextureBinding |
317 wgpu::TextureUsage::CopySrc;
318 DawnTextureInfo info;
319 info.fSampleCount = 1;
320 info.fMipmapped = Mipmapped::kNo;
321 info.fFormat = format;
322 info.fViewFormat = format;
323 info.fUsage = usage;
324
325 return info;
326}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static constexpr bool SkToBool(const T &x)
Definition: SkTo.h:35

◆ getDepthAttachmentDimensions()

SkISize skgpu::graphite::DawnCaps::getDepthAttachmentDimensions ( const TextureInfo textureInfo,
const SkISize  colorAttachmentDimensions 
) const
overridevirtual

Reimplemented from skgpu::graphite::Caps.

Definition at line 328 of file DawnCaps.cpp.

329 {
330#if !defined(__EMSCRIPTEN__)
331 // For multiplanar textures, texture->textureInfo() uses the format of planes instead of
332 // textures (R8, R8G8, vs R8BG8Biplanar420Unorm), so we have to query texture format from
333 // wgpu::Texture object, and then use it reconstruct the full dimensions.
334 const auto& dawnTextureSpec = textureInfo.dawnTextureSpec();
335 wgpu::TextureFormat format = dawnTextureSpec.fFormat;
336 if (IsMultiplanarFormat(format) && dawnTextureSpec.fAspect == wgpu::TextureAspect::Plane1Only) {
337 // Dawn requires depth attachment to match the size of Y plane (texture size).
338 return SkISize::Make(colorAttachmentDimensions.width() * 2,
339 colorAttachmentDimensions.height() * 2);
340 }
341#endif
342
343 return colorAttachmentDimensions;
344}
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getRenderPassDescKeyForPipeline()

uint64_t skgpu::graphite::DawnCaps::getRenderPassDescKeyForPipeline ( const RenderPassDesc renderPassDesc) const

Definition at line 870 of file DawnCaps.cpp.

870 {
871 DawnTextureInfo colorInfo, depthStencilInfo;
872 renderPassDesc.fColorAttachment.fTextureInfo.getDawnTextureInfo(&colorInfo);
873 renderPassDesc.fDepthStencilAttachment.fTextureInfo.getDawnTextureInfo(&depthStencilInfo);
874 SkASSERT(static_cast<uint32_t>(colorInfo.getViewFormat()) <= 0xffff &&
875 static_cast<uint32_t>(depthStencilInfo.getViewFormat()) <= 0xffff &&
876 colorInfo.fSampleCount < 0x7fff);
877
878 // Note: if Dawn supports ExpandResolveTexture load op and the render pass uses it to load
879 // the resolve texture, a render pipeline will need to be created with
880 // wgpu::ColorTargetStateExpandResolveTextureDawn chained struct in order to be compatible.
881 // Hence a render pipeline created for a render pass using ExpandResolveTexture load op will
882 // be different from the one created for a render pass not using that load op.
883 // So we need to include a bit flag to differentiate the two kinds of pipelines.
884 // Also avoid returning a cached pipeline that is not compatible with the render pass using
885 // ExpandResolveTexture load op and vice versa.
886 const bool shouldIncludeLoadResolveAttachmentBit = this->resolveTextureLoadOp().has_value();
887 uint32_t loadResolveAttachmentKey = 0;
888 if (shouldIncludeLoadResolveAttachmentBit &&
889 renderPassDesc.fColorResolveAttachment.fTextureInfo.isValid() &&
890 renderPassDesc.fColorResolveAttachment.fLoadOp == LoadOp::kLoad) {
891 loadResolveAttachmentKey = 1;
892 }
893
894 uint32_t colorAttachmentKey = static_cast<uint32_t>(colorInfo.getViewFormat()) << 16 |
895 colorInfo.fSampleCount << 1 | loadResolveAttachmentKey;
896
897 uint32_t dsAttachmentKey = static_cast<uint32_t>(depthStencilInfo.getViewFormat()) << 16 |
898 depthStencilInfo.fSampleCount;
899 return (((uint64_t)colorAttachmentKey) << 32) | dsAttachmentKey;
900}
std::optional< wgpu::LoadOp > resolveTextureLoadOp() const
Definition: DawnCaps.h:31

◆ getTextureInfoForSampledCopy()

TextureInfo skgpu::graphite::DawnCaps::getTextureInfoForSampledCopy ( const TextureInfo textureInfo,
Mipmapped  mipmapped 
) const
overridevirtual

Implements skgpu::graphite::Caps.

Definition at line 213 of file DawnCaps.cpp.

214 {
215 DawnTextureInfo info;
216 if (!textureInfo.getDawnTextureInfo(&info)) {
217 return {};
218 }
219
220 info.fSampleCount = 1;
221 info.fMipmapped = mipmapped;
222 info.fUsage = wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopyDst |
223 wgpu::TextureUsage::CopySrc;
224
225 return info;
226}

◆ isRenderable()

bool skgpu::graphite::DawnCaps::isRenderable ( const TextureInfo info) const
overridevirtual

Implements skgpu::graphite::Caps.

Definition at line 154 of file DawnCaps.cpp.

154 {
155 return info.isValid() &&
156 (info.dawnTextureSpec().fUsage & wgpu::TextureUsage::RenderAttachment) &&
157 this->isRenderable(info.dawnTextureSpec().getViewFormat(), info.numSamples());
158}
bool isRenderable(const TextureInfo &) const override
Definition: DawnCaps.cpp:154

◆ isStorage()

bool skgpu::graphite::DawnCaps::isStorage ( const TextureInfo info) const
overridevirtual

Implements skgpu::graphite::Caps.

Definition at line 160 of file DawnCaps.cpp.

160 {
161 if (!info.isValid()) {
162 return false;
163 }
164 if (!(info.dawnTextureSpec().fUsage & wgpu::TextureUsage::StorageBinding)) {
165 return false;
166 }
167 const FormatInfo& formatInfo = this->getFormatInfo(info.dawnTextureSpec().getViewFormat());
168 return info.numSamples() == 1 && SkToBool(FormatInfo::kStorage_Flag & formatInfo.fFlags);
169}

◆ makeComputePipelineKey()

UniqueKey skgpu::graphite::DawnCaps::makeComputePipelineKey ( const ComputePipelineDesc pipelineDesc) const
overridevirtual

Implements skgpu::graphite::Caps.

Definition at line 924 of file DawnCaps.cpp.

924 {
925 UniqueKey pipelineKey;
926 {
927 static const skgpu::UniqueKey::Domain kComputePipelineDomain = UniqueKey::GenerateDomain();
928 // The key is made up of a single uint32_t corresponding to the compute step ID.
929 UniqueKey::Builder builder(&pipelineKey, kComputePipelineDomain, 1, "ComputePipeline");
930 builder[0] = pipelineDesc.computeStep()->uniqueID();
931
932 // TODO(b/240615224): The local work group size should factor into the key here since it is
933 // specified in the shader text on Dawn/SPIR-V. This is not a problem right now since
934 // ComputeSteps don't vary their workgroup size dynamically.
935
936 builder.finish();
937 }
938 return pipelineKey;
939}
static Domain GenerateDomain()
Definition: ResourceKey.cpp:27

◆ makeGraphicsPipelineKey()

UniqueKey skgpu::graphite::DawnCaps::makeGraphicsPipelineKey ( const GraphicsPipelineDesc pipelineDesc,
const RenderPassDesc renderPassDesc 
) const
overridevirtual

Implements skgpu::graphite::Caps.

Definition at line 902 of file DawnCaps.cpp.

903 {
904 UniqueKey pipelineKey;
905 {
907 // 5 uint32_t's (render step id, paint id, uint64 RenderPass desc, uint16 write swizzle)
908 UniqueKey::Builder builder(&pipelineKey, kGraphicsPipelineDomain, 5, "GraphicsPipeline");
909 // add GraphicsPipelineDesc key
910 builder[0] = pipelineDesc.renderStepID();
911 builder[1] = pipelineDesc.paintParamsID().asUInt();
912
913 // Add RenderPassDesc key.
914 uint64_t renderPassKey = this->getRenderPassDescKeyForPipeline(renderPassDesc);
915 builder[2] = renderPassKey & 0xFFFFFFFF;
916 builder[3] = (renderPassKey >> 32) & 0xFFFFFFFF;
917 builder[4] = renderPassDesc.fWriteSwizzle.asKey();
918 builder.finish();
919 }
920
921 return pipelineKey;
922}
uint64_t getRenderPassDescKeyForPipeline(const RenderPassDesc &renderPassDesc) const
Definition: DawnCaps.cpp:870
static const skgpu::UniqueKey::Domain kGraphicsPipelineDomain
Definition: MtlCaps.mm:895

◆ resolveTextureLoadOp()

std::optional< wgpu::LoadOp > skgpu::graphite::DawnCaps::resolveTextureLoadOp ( ) const
inline

Definition at line 31 of file DawnCaps.h.

31 {
32 return fSupportedResolveTextureLoadOp;
33 }

◆ useAsyncPipelineCreation()

bool skgpu::graphite::DawnCaps::useAsyncPipelineCreation ( ) const
inline

Definition at line 27 of file DawnCaps.h.

27{ return fUseAsyncPipelineCreation; }

Member Data Documentation

◆ kFormatCnt

constexpr size_t skgpu::graphite::DawnCaps::kFormatCnt = 18
staticconstexpr

Definition at line 65 of file DawnCaps.h.


The documentation for this class was generated from the following files: