Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
skgpu::graphite::Caps Class Referenceabstract

#include <Caps.h>

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

Classes

struct  ColorTypeInfo
 

Public Member Functions

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 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
 

Protected Member Functions

 Caps ()
 
void finishInitialization (const ContextOptions &)
 

Static Protected Member Functions

static uint32_t SamplesToKey (uint32_t numSamples)
 

Protected Attributes

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
 

Private Member Functions

virtual bool onIsTexturable (const TextureInfo &) const =0
 
virtual const ColorTypeInfogetColorTypeInfo (SkColorType, const TextureInfo &) const =0
 

Detailed Description

Definition at line 70 of file Caps.h.

Constructor & Destructor Documentation

◆ ~Caps()

skgpu::graphite::Caps::~Caps ( )
virtual

Definition at line 27 of file Caps.cpp.

27{}

◆ Caps()

skgpu::graphite::Caps::Caps ( )
protected

Definition at line 23 of file Caps.cpp.

24 : fShaderCaps(std::make_unique<SkSL::ShaderCaps>())
25 , fCapabilities(new SkCapabilities()) {}
std::unique_ptr< SkSL::ShaderCaps > fShaderCaps
Definition Caps.h:346

Member Function Documentation

◆ allowCpuSync()

bool skgpu::graphite::Caps::allowCpuSync ( ) const
inline

Definition at line 225 of file Caps.h.

225{ return fAllowCpuSync; }

◆ allowMultipleAtlasTextures()

bool skgpu::graphite::Caps::allowMultipleAtlasTextures ( ) const
inline

Definition at line 277 of file Caps.h.

bool fAllowMultipleAtlasTextures
Definition Caps.h:389

◆ areColorTypeAndTextureInfoCompatible()

bool skgpu::graphite::Caps::areColorTypeAndTextureInfoCompatible ( SkColorType  ct,
const TextureInfo info 
) const

Definition at line 84 of file Caps.cpp.

84 {
85 // TODO: add SkTextureCompressionType handling
86 // (can be handled by setting up the colorTypeInfo instead?)
87
88 return SkToBool(this->getColorTypeInfo(ct, info));
89}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
static constexpr bool SkToBool(const T &x)
Definition SkTo.h:35
virtual const ColorTypeInfo * getColorTypeInfo(SkColorType, const TextureInfo &) const =0

◆ bufferMapsAreAsync()

bool skgpu::graphite::Caps::bufferMapsAreAsync ( ) const
inline

Definition at line 244 of file Caps.h.

244{ return fBufferMapsAreAsync; }
bool fBufferMapsAreAsync
Definition Caps.h:355

◆ buildKeyForTexture()

virtual void skgpu::graphite::Caps::buildKeyForTexture ( SkISize  dimensions,
const TextureInfo ,
ResourceType  ,
Shareable  ,
GraphiteResourceKey  
) const
pure virtual

◆ capabilities()

sk_sp< SkCapabilities > skgpu::graphite::Caps::capabilities ( ) const

Definition at line 58 of file Caps.cpp.

58{ return fCapabilities; }

◆ channelMask()

virtual uint32_t skgpu::graphite::Caps::channelMask ( const TextureInfo ) const
pure virtual

◆ clampToBorderSupport()

bool skgpu::graphite::Caps::clampToBorderSupport ( ) const
inline

Definition at line 217 of file Caps.h.

217{ return fClampToBorderSupport; }
bool fClampToBorderSupport
Definition Caps.h:348

◆ computeSupport()

bool skgpu::graphite::Caps::computeSupport ( ) const
inline

Definition at line 250 of file Caps.h.

250{ return fComputeSupport; }

◆ defaultMSAASamplesCount()

int skgpu::graphite::Caps::defaultMSAASamplesCount ( ) const
inline

Definition at line 135 of file Caps.h.

135{ return fDefaultMSAASamples; }

◆ drawBufferCanBeMapped()

bool skgpu::graphite::Caps::drawBufferCanBeMapped ( ) const
inline

Definition at line 235 of file Caps.h.

235{ return fDrawBufferCanBeMapped; }
bool fDrawBufferCanBeMapped
Definition Caps.h:354

◆ extractGraphicsDescs()

virtual bool skgpu::graphite::Caps::extractGraphicsDescs ( const UniqueKey ,
GraphicsPipelineDesc ,
RenderPassDesc ,
const RendererProvider  
) const
inlinevirtual

Reimplemented in skgpu::graphite::MtlCaps.

Definition at line 122 of file Caps.h.

125 { return false; }

◆ finishInitialization()

void skgpu::graphite::Caps::finishInitialization ( const ContextOptions options)
protected

Definition at line 29 of file Caps.cpp.

29 {
30 fCapabilities->initSkCaps(fShaderCaps.get());
31
32 fDefaultMSAASamples = options.fInternalMultisampleCount;
33
34 if (options.fShaderErrorHandler) {
35 fShaderErrorHandler = options.fShaderErrorHandler;
36 } else {
38 }
39
40#if defined(GRAPHITE_TEST_UTILS)
41 if (options.fOptionsPriv) {
42 fMaxTextureSize = std::min(fMaxTextureSize, options.fOptionsPriv->fMaxTextureSizeOverride);
43 fMaxTextureAtlasSize = options.fOptionsPriv->fMaxTextureAtlasSize;
44 fRequestedPathRendererStrategy = options.fOptionsPriv->fPathRendererStrategy;
45 }
46#endif
47 fGlyphCacheTextureMaximumBytes = options.fGlyphCacheTextureMaximumBytes;
48 fMinDistanceFieldFontSize = options.fMinDistanceFieldFontSize;
49 fGlyphsAsPathsFontSize = options.fGlyphsAsPathsFontSize;
50 fMaxPathAtlasTextureSize = options.fMaxPathAtlasTextureSize;
51 fAllowMultipleAtlasTextures = options.fAllowMultipleAtlasTextures;
52 fSupportBilerpFromGlyphAtlas = options.fSupportBilerpFromGlyphAtlas;
53 if (options.fDisableCachedGlyphUploads) {
55 }
56}
const char * options
void initSkCaps(const SkSL::ShaderCaps *)
float fMinDistanceFieldFontSize
Definition Caps.h:384
bool fSupportBilerpFromGlyphAtlas
Definition Caps.h:390
int fMaxPathAtlasTextureSize
Definition Caps.h:387
size_t fGlyphCacheTextureMaximumBytes
Definition Caps.h:382
float fGlyphsAsPathsFontSize
Definition Caps.h:385
bool fRequireOrderedRecordings
Definition Caps.h:393
ShaderErrorHandler * fShaderErrorHandler
Definition Caps.h:375
ShaderErrorHandler * DefaultShaderErrorHandler()

◆ fullCompressedUploadSizeMustAlignToBlockDims()

bool skgpu::graphite::Caps::fullCompressedUploadSizeMustAlignToBlockDims ( ) const
inline

Definition at line 284 of file Caps.h.

284 {
286 }
bool fFullCompressedUploadSizeMustAlignToBlockDims
Definition Caps.h:360

◆ getAlignedTextureDataRowBytes()

size_t skgpu::graphite::Caps::getAlignedTextureDataRowBytes ( size_t  rowBytes) const
inline

Definition at line 159 of file Caps.h.

159 {
161 }
static constexpr size_t SkAlignTo(size_t x, size_t alignment)
Definition SkAlign.h:33
size_t fTextureDataRowBytesAlignment
Definition Caps.h:344

◆ getColorTypeInfo()

virtual const ColorTypeInfo * skgpu::graphite::Caps::getColorTypeInfo ( SkColorType  ,
const TextureInfo  
) const
privatepure virtual

◆ getDefaultCompressedTextureInfo()

virtual TextureInfo skgpu::graphite::Caps::getDefaultCompressedTextureInfo ( SkTextureCompressionType  ,
Mipmapped  mipmapped,
Protected   
) const
pure virtual

◆ getDefaultDepthStencilTextureInfo()

virtual TextureInfo skgpu::graphite::Caps::getDefaultDepthStencilTextureInfo ( SkEnumBitMask< DepthStencilFlags ,
uint32_t  sampleCount,
Protected   
) const
pure virtual

◆ getDefaultMSAATextureInfo()

virtual TextureInfo skgpu::graphite::Caps::getDefaultMSAATextureInfo ( const TextureInfo singleSampledInfo,
Discardable  discardable 
) const
pure virtual

◆ getDefaultSampledTextureInfo()

virtual TextureInfo skgpu::graphite::Caps::getDefaultSampledTextureInfo ( SkColorType  ,
Mipmapped  mipmapped,
Protected  ,
Renderable   
) const
pure virtual

◆ getDefaultStorageTextureInfo()

virtual TextureInfo skgpu::graphite::Caps::getDefaultStorageTextureInfo ( SkColorType  ) const
pure virtual

◆ getDepthAttachmentDimensions()

SkISize skgpu::graphite::Caps::getDepthAttachmentDimensions ( const TextureInfo textureInfo,
const SkISize  colorAttachmentDimensions 
) const
virtual

Reimplemented in skgpu::graphite::DawnCaps.

Definition at line 60 of file Caps.cpp.

61 {
62 return colorAttachmentDimensions;
63}

◆ getDstReadRequirement()

DstReadRequirement skgpu::graphite::Caps::getDstReadRequirement ( ) const

Definition at line 151 of file Caps.cpp.

151 {
152 // TODO(b/238757201): Currently this only supports dst reads by FB fetch and texture copy.
153 if (this->shaderCaps()->fFBFetchSupport) {
155 } else {
157 }
158}
const SkSL::ShaderCaps * shaderCaps() const
Definition Caps.h:74

◆ getReadSwizzle()

skgpu::Swizzle skgpu::graphite::Caps::getReadSwizzle ( SkColorType  ct,
const TextureInfo info 
) const

Definition at line 128 of file Caps.cpp.

128 {
129 // TODO: add SkTextureCompressionType handling
130 // (can be handled by setting up the colorTypeInfo instead?)
131
132 auto colorTypeInfo = this->getColorTypeInfo(ct, info);
133 if (!colorTypeInfo) {
134 SkDEBUGFAILF("Illegal color type (%d) and format combination.", static_cast<int>(ct));
135 return {};
136 }
137
138 return colorTypeInfo->fReadSwizzle;
139}
#define SkDEBUGFAILF(fmt,...)
Definition SkAssert.h:119

◆ getRenderableColorType()

SkColorType skgpu::graphite::Caps::getRenderableColorType ( SkColorType  ct) const

Checks whether the passed color type is renderable. If so, the same color type is passed back. If not, provides an alternative (perhaps lower bit depth and/or unorm instead of float) color type that is supported or kUnknown if there no renderable fallback format.

Definition at line 113 of file Caps.cpp.

113 {
114 do {
115 auto texInfo = this->getDefaultSampledTextureInfo(ct,
116 Mipmapped::kNo,
117 Protected::kNo,
118 Renderable::kYes);
119 // We continue to the fallback color type if there is no default renderable format
120 if (texInfo.isValid() && this->isRenderable(texInfo)) {
121 return ct;
122 }
123 ct = color_type_fallback(ct);
124 } while (ct != kUnknown_SkColorType);
126}
@ kUnknown_SkColorType
uninitialized
Definition SkColorType.h:20
virtual TextureInfo getDefaultSampledTextureInfo(SkColorType, Mipmapped mipmapped, Protected, Renderable) const =0
static SkColorType color_type_fallback(SkColorType ct)
Definition Caps.cpp:91

◆ getSDFTControl()

sktext::gpu::SDFTControl skgpu::graphite::Caps::getSDFTControl ( bool  useSDFTForSmallText) const

Definition at line 160 of file Caps.cpp.

160 {
161#if !defined(SK_DISABLE_SDF_TEXT)
164 useSDFTForSmallText,
165 true, /*ableToUsePerspectiveSDFT*/
167 this->glyphsAsPathsFontSize()};
168#else
170#endif
171}
float glyphsAsPathsFontSize() const
Definition Caps.h:272
float minDistanceFieldFontSize() const
Definition Caps.h:271
bool supportsDistanceFieldText() const
Definition SkSLUtil.h:80

◆ getTextureInfoForSampledCopy()

virtual TextureInfo skgpu::graphite::Caps::getTextureInfoForSampledCopy ( const TextureInfo textureInfo,
Mipmapped  mipmapped 
) const
pure virtual

◆ getWriteSwizzle()

skgpu::Swizzle skgpu::graphite::Caps::getWriteSwizzle ( SkColorType  ct,
const TextureInfo info 
) const

Definition at line 141 of file Caps.cpp.

141 {
142 auto colorTypeInfo = this->getColorTypeInfo(ct, info);
143 if (!colorTypeInfo) {
144 SkDEBUGFAILF("Illegal color type (%d) and format combination.", static_cast<int>(ct));
145 return {};
146 }
147
148 return colorTypeInfo->fWriteSwizzle;
149}

◆ glyphCacheTextureMaximumBytes()

size_t skgpu::graphite::Caps::glyphCacheTextureMaximumBytes ( ) const
inline

Definition at line 274 of file Caps.h.

◆ glyphsAsPathsFontSize()

float skgpu::graphite::Caps::glyphsAsPathsFontSize ( ) const
inline

Definition at line 272 of file Caps.h.

272{ return fGlyphsAsPathsFontSize; }

◆ isRenderable()

virtual bool skgpu::graphite::Caps::isRenderable ( const TextureInfo ) const
pure virtual

◆ isStorage()

virtual bool skgpu::graphite::Caps::isStorage ( const TextureInfo ) const
pure virtual

◆ isTexturable()

bool skgpu::graphite::Caps::isTexturable ( const TextureInfo info) const

Definition at line 65 of file Caps.cpp.

65 {
66 if (info.numSamples() > 1) {
67 return false;
68 }
69 return this->onIsTexturable(info);
70}
virtual bool onIsTexturable(const TextureInfo &) const =0

◆ makeComputePipelineKey()

virtual UniqueKey skgpu::graphite::Caps::makeComputePipelineKey ( const ComputePipelineDesc ) const
pure virtual

◆ makeGraphicsPipelineKey()

virtual UniqueKey skgpu::graphite::Caps::makeGraphicsPipelineKey ( const GraphicsPipelineDesc ,
const RenderPassDesc  
) const
pure virtual

◆ makeSamplerKey()

GraphiteResourceKey skgpu::graphite::Caps::makeSamplerKey ( const SamplerDesc samplerDesc) const
virtual

Reimplemented in skgpu::graphite::VulkanCaps.

Definition at line 72 of file Caps.cpp.

72 {
73 GraphiteResourceKey samplerKey;
75 GraphiteResourceKey::Builder builder(&samplerKey, kType, /*data32Count=*/1, Shareable::kYes);
76
77 // The default impl. of this method adds no additional backend information to the key.
78 builder[0] = samplerDesc.desc();
79
80 builder.finish();
81 return samplerKey;
82}
uint32_t ResourceType

◆ maxPathAtlasTextureSize()

int skgpu::graphite::Caps::maxPathAtlasTextureSize ( ) const
inline

Definition at line 275 of file Caps.h.

275{ return fMaxPathAtlasTextureSize; }

◆ maxTextureSize()

int skgpu::graphite::Caps::maxTextureSize ( ) const
inline

Definition at line 134 of file Caps.h.

134{ return fMaxTextureSize; }

◆ minDistanceFieldFontSize()

float skgpu::graphite::Caps::minDistanceFieldFontSize ( ) const
inline

Definition at line 271 of file Caps.h.

◆ msaaRenderToSingleSampledSupport()

bool skgpu::graphite::Caps::msaaRenderToSingleSampledSupport ( ) const
inline

Definition at line 247 of file Caps.h.

bool fMSAARenderToSingleSampledSupport
Definition Caps.h:356

◆ onIsTexturable()

virtual bool skgpu::graphite::Caps::onIsTexturable ( const TextureInfo ) const
privatepure virtual

◆ protectedSupport()

bool skgpu::graphite::Caps::protectedSupport ( ) const
inline

Definition at line 219 of file Caps.h.

219{ return fProtectedSupport; }

◆ requiredStorageBufferAlignment()

size_t skgpu::graphite::Caps::requiredStorageBufferAlignment ( ) const
inline

Definition at line 153 of file Caps.h.

size_t fRequiredStorageBufferAlignment
Definition Caps.h:342

◆ requiredTransferBufferAlignment()

size_t skgpu::graphite::Caps::requiredTransferBufferAlignment ( ) const
inline

Definition at line 156 of file Caps.h.

size_t fRequiredTransferBufferAlignment
Definition Caps.h:343

◆ requiredUniformBufferAlignment()

size_t skgpu::graphite::Caps::requiredUniformBufferAlignment ( ) const
inline

Definition at line 149 of file Caps.h.

size_t fRequiredUniformBufferAlignment
Definition Caps.h:341

◆ requireOrderedRecordings()

bool skgpu::graphite::Caps::requireOrderedRecordings ( ) const
inline

Definition at line 280 of file Caps.h.

◆ resourceBindingRequirements()

const ResourceBindingRequirements & skgpu::graphite::Caps::resourceBindingRequirements ( ) const
inline

Definition at line 143 of file Caps.h.

143 {
145 }
ResourceBindingRequirements fResourceBindingReqs
Definition Caps.h:366

◆ SamplesToKey()

static uint32_t skgpu::graphite::Caps::SamplesToKey ( uint32_t  numSamples)
inlinestaticprotected

Definition at line 305 of file Caps.h.

305 {
306 switch (numSamples) {
307 case 1:
308 return 0;
309 case 2:
310 return 1;
311 case 4:
312 return 2;
313 case 8:
314 return 3;
315 case 16:
316 return 4;
317 default:
319 }
320 }
#define SkUNREACHABLE
Definition SkAssert.h:135

◆ semaphoreSupport()

bool skgpu::graphite::Caps::semaphoreSupport ( ) const
inline

Definition at line 222 of file Caps.h.

222{ return fSemaphoreSupport; }

◆ shaderCaps()

const SkSL::ShaderCaps * skgpu::graphite::Caps::shaderCaps ( ) const
inline

Definition at line 74 of file Caps.h.

74{ return fShaderCaps.get(); }

◆ shaderErrorHandler()

skgpu::ShaderErrorHandler * skgpu::graphite::Caps::shaderErrorHandler ( ) const
inline

Definition at line 266 of file Caps.h.

266{ return fShaderErrorHandler; }

◆ storageBufferPreferred()

bool skgpu::graphite::Caps::storageBufferPreferred ( ) const
inline

Definition at line 232 of file Caps.h.

232{ return fStorageBufferPreferred; }
bool fStorageBufferPreferred
Definition Caps.h:353

◆ storageBufferSupport()

bool skgpu::graphite::Caps::storageBufferSupport ( ) const
inline

Definition at line 228 of file Caps.h.

228{ return fStorageBufferSupport; }
bool fStorageBufferSupport
Definition Caps.h:352

◆ supportBilerpFromGlyphAtlas()

bool skgpu::graphite::Caps::supportBilerpFromGlyphAtlas ( ) const
inline

Definition at line 278 of file Caps.h.

◆ supportedReadPixelsColorType()

virtual std::pair< SkColorType, bool > skgpu::graphite::Caps::supportedReadPixelsColorType ( SkColorType  srcColorType,
const TextureInfo srcTextureInfo,
SkColorType  dstColorType 
) const
pure virtual

Given a src surface's color type and its texture info as well as a color type the caller would like read into, this provides a legal color type that the caller can use for readPixels. The returned color type may differ from the passed dstColorType, in which case the caller must convert the read pixel data (see GrConvertPixels). When converting to dstColorType the swizzle in the returned struct should be applied. The caller must check the returned color type for kUnknown.

We currently don't have an SkColorType for a 3 channel RGB format. Additionally the current implementation of raster pipeline requires power of 2 channels, so it is not easy to add such an SkColorType. Thus we need to check for data that is 3 channels using the isRGBFormat return value and handle it manually

Implemented in skgpu::graphite::DawnCaps, skgpu::graphite::MtlCaps, and skgpu::graphite::VulkanCaps.

◆ supportedWritePixelsColorType()

virtual std::pair< SkColorType, bool > skgpu::graphite::Caps::supportedWritePixelsColorType ( SkColorType  dstColorType,
const TextureInfo dstTextureInfo,
SkColorType  srcColorType 
) const
pure virtual

Given a dst pixel config and a src color type what color type must the caller coax the the data into in order to use writePixels.

We currently don't have an SkColorType for a 3 channel RGB format. Additionally the current implementation of raster pipeline requires power of 2 channels, so it is not easy to add such an SkColorType. Thus we need to check for data that is 3 channels using the isRGBFormat return value and handle it manually

Implemented in skgpu::graphite::DawnCaps, skgpu::graphite::MtlCaps, and skgpu::graphite::VulkanCaps.

◆ supportsAHardwareBufferImages()

bool skgpu::graphite::Caps::supportsAHardwareBufferImages ( ) const
inline

Returns true if the given backend supports importing AHardwareBuffers. This will only ever be supported on Android devices with API level >= 26.

Definition at line 256 of file Caps.h.

bool fSupportsAHardwareBufferImages
Definition Caps.h:359

◆ supportsReadPixels()

virtual bool skgpu::graphite::Caps::supportsReadPixels ( const TextureInfo textureInfo) const
pure virtual

Backends may have restrictions on what types of textures support Device::readPixels(). If this returns false then the caller should implement a fallback where a temporary texture is created, the original texture is copied or drawn into it, and then pixels read from the temporary texture.

Implemented in skgpu::graphite::MtlCaps, skgpu::graphite::VulkanCaps, and skgpu::graphite::DawnCaps.

◆ supportsWritePixels()

virtual bool skgpu::graphite::Caps::supportsWritePixels ( const TextureInfo textureInfo) const
pure virtual

Backends may have restrictions on what types of textures support Device::writePixels(). If this returns false then the caller should implement a fallback where a temporary texture is created, pixels are written to it, and then that is copied or drawn into the the surface.

Implemented in skgpu::graphite::MtlCaps, skgpu::graphite::VulkanCaps, and skgpu::graphite::DawnCaps.

Member Data Documentation

◆ fAllowCpuSync

bool skgpu::graphite::Caps::fAllowCpuSync = true
protected

Definition at line 351 of file Caps.h.

◆ fAllowMultipleAtlasTextures

bool skgpu::graphite::Caps::fAllowMultipleAtlasTextures = true
protected

Definition at line 389 of file Caps.h.

◆ fBufferMapsAreAsync

bool skgpu::graphite::Caps::fBufferMapsAreAsync = false
protected

Definition at line 355 of file Caps.h.

◆ fClampToBorderSupport

bool skgpu::graphite::Caps::fClampToBorderSupport = true
protected

Definition at line 348 of file Caps.h.

◆ fComputeSupport

bool skgpu::graphite::Caps::fComputeSupport = false
protected

Definition at line 358 of file Caps.h.

◆ fDefaultMSAASamples

int skgpu::graphite::Caps::fDefaultMSAASamples = 4
protected

Definition at line 340 of file Caps.h.

◆ fDrawBufferCanBeMapped

bool skgpu::graphite::Caps::fDrawBufferCanBeMapped = true
protected

Definition at line 354 of file Caps.h.

◆ fFullCompressedUploadSizeMustAlignToBlockDims

bool skgpu::graphite::Caps::fFullCompressedUploadSizeMustAlignToBlockDims = false
protected

Definition at line 360 of file Caps.h.

◆ fGlyphCacheTextureMaximumBytes

size_t skgpu::graphite::Caps::fGlyphCacheTextureMaximumBytes = 2048 * 1024 * 4
protected

Definition at line 382 of file Caps.h.

◆ fGlyphsAsPathsFontSize

float skgpu::graphite::Caps::fGlyphsAsPathsFontSize = 324
protected

Definition at line 385 of file Caps.h.

◆ fMaxPathAtlasTextureSize

int skgpu::graphite::Caps::fMaxPathAtlasTextureSize = 8192
protected

Definition at line 387 of file Caps.h.

◆ fMaxTextureSize

int skgpu::graphite::Caps::fMaxTextureSize = 0
protected

Definition at line 339 of file Caps.h.

◆ fMinDistanceFieldFontSize

float skgpu::graphite::Caps::fMinDistanceFieldFontSize = 18
protected

Definition at line 384 of file Caps.h.

◆ fMSAARenderToSingleSampledSupport

bool skgpu::graphite::Caps::fMSAARenderToSingleSampledSupport = false
protected

Definition at line 356 of file Caps.h.

◆ fProtectedSupport

bool skgpu::graphite::Caps::fProtectedSupport = false
protected

Definition at line 349 of file Caps.h.

◆ fRequiredStorageBufferAlignment

size_t skgpu::graphite::Caps::fRequiredStorageBufferAlignment = 0
protected

Definition at line 342 of file Caps.h.

◆ fRequiredTransferBufferAlignment

size_t skgpu::graphite::Caps::fRequiredTransferBufferAlignment = 0
protected

Definition at line 343 of file Caps.h.

◆ fRequiredUniformBufferAlignment

size_t skgpu::graphite::Caps::fRequiredUniformBufferAlignment = 0
protected

Definition at line 341 of file Caps.h.

◆ fRequireOrderedRecordings

bool skgpu::graphite::Caps::fRequireOrderedRecordings = false
protected

Definition at line 393 of file Caps.h.

◆ fResourceBindingReqs

ResourceBindingRequirements skgpu::graphite::Caps::fResourceBindingReqs
protected

Definition at line 366 of file Caps.h.

◆ fSemaphoreSupport

bool skgpu::graphite::Caps::fSemaphoreSupport = false
protected

Definition at line 350 of file Caps.h.

◆ fShaderCaps

std::unique_ptr<SkSL::ShaderCaps> skgpu::graphite::Caps::fShaderCaps
protected

Definition at line 346 of file Caps.h.

◆ fShaderErrorHandler

ShaderErrorHandler* skgpu::graphite::Caps::fShaderErrorHandler = nullptr
protected

If present, use this object to report shader compilation failures. If not, report failures via SkDebugf and assert.

Definition at line 375 of file Caps.h.

◆ fStorageBufferPreferred

bool skgpu::graphite::Caps::fStorageBufferPreferred = false
protected

Definition at line 353 of file Caps.h.

◆ fStorageBufferSupport

bool skgpu::graphite::Caps::fStorageBufferSupport = false
protected

Definition at line 352 of file Caps.h.

◆ fSupportBilerpFromGlyphAtlas

bool skgpu::graphite::Caps::fSupportBilerpFromGlyphAtlas = false
protected

Definition at line 390 of file Caps.h.

◆ fSupportsAHardwareBufferImages

bool skgpu::graphite::Caps::fSupportsAHardwareBufferImages = false
protected

Definition at line 359 of file Caps.h.

◆ fTextureDataRowBytesAlignment

size_t skgpu::graphite::Caps::fTextureDataRowBytesAlignment = 1
protected

Definition at line 344 of file Caps.h.


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