Flutter Engine
The Flutter Engine
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 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
 

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
 
bool fSetBackendLabels = false
 

Private Member Functions

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

Detailed Description

Definition at line 71 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:363

Member Function Documentation

◆ allowCpuSync()

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

Definition at line 232 of file Caps.h.

232{ return fAllowCpuSync; }

◆ allowMultipleAtlasTextures()

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

Definition at line 284 of file Caps.h.

bool fAllowMultipleAtlasTextures
Definition: Caps.h:406

◆ areColorTypeAndTextureInfoCompatible()

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

Definition at line 85 of file Caps.cpp.

85 {
86 // TODO: add SkTextureCompressionType handling
87 // (can be handled by setting up the colorTypeInfo instead?)
88
89 return SkToBool(this->getColorTypeInfo(ct, info));
90}
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 251 of file Caps.h.

251{ return fBufferMapsAreAsync; }
bool fBufferMapsAreAsync
Definition: Caps.h:372

◆ 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 59 of file Caps.cpp.

59{ 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 224 of file Caps.h.

224{ return fClampToBorderSupport; }
bool fClampToBorderSupport
Definition: Caps.h:365

◆ computeSupport()

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

Definition at line 257 of file Caps.h.

257{ return fComputeSupport; }
bool fComputeSupport
Definition: Caps.h:375

◆ defaultMSAASamplesCount()

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

Definition at line 142 of file Caps.h.

142{ return fDefaultMSAASamples; }
int fDefaultMSAASamples
Definition: Caps.h:357

◆ drawBufferCanBeMapped()

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

Definition at line 242 of file Caps.h.

242{ return fDrawBufferCanBeMapped; }
bool fDrawBufferCanBeMapped
Definition: Caps.h:371

◆ extractGraphicsDescs()

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

Reimplemented in skgpu::graphite::MtlCaps.

Definition at line 129 of file Caps.h.

132 { 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 fSetBackendLabels = options.fSetBackendLabels;
57}
const char * options
void initSkCaps(const SkSL::ShaderCaps *)
float fMinDistanceFieldFontSize
Definition: Caps.h:401
bool fSupportBilerpFromGlyphAtlas
Definition: Caps.h:407
int fMaxPathAtlasTextureSize
Definition: Caps.h:404
size_t fGlyphCacheTextureMaximumBytes
Definition: Caps.h:399
float fGlyphsAsPathsFontSize
Definition: Caps.h:402
bool fSetBackendLabels
Definition: Caps.h:412
bool fRequireOrderedRecordings
Definition: Caps.h:410
ShaderErrorHandler * fShaderErrorHandler
Definition: Caps.h:392
static float min(float r, float g, float b)
Definition: hsl.cpp:48
ShaderErrorHandler * DefaultShaderErrorHandler()

◆ fullCompressedUploadSizeMustAlignToBlockDims()

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

Definition at line 291 of file Caps.h.

291 {
293 }
bool fFullCompressedUploadSizeMustAlignToBlockDims
Definition: Caps.h:377

◆ getAlignedTextureDataRowBytes()

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

Definition at line 166 of file Caps.h.

166 {
168 }
static constexpr size_t SkAlignTo(size_t x, size_t alignment)
Definition: SkAlign.h:33
size_t fTextureDataRowBytesAlignment
Definition: Caps.h:361

◆ 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 61 of file Caps.cpp.

62 {
63 return colorAttachmentDimensions;
64}

◆ getDstReadRequirement()

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

Definition at line 152 of file Caps.cpp.

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

◆ getImmutableSamplerInfo()

virtual ImmutableSamplerInfo skgpu::graphite::Caps::getImmutableSamplerInfo ( const TextureProxy ) const
inlinevirtual

Reimplemented in skgpu::graphite::VulkanCaps.

Definition at line 125 of file Caps.h.

125 {
126 return {};
127 }

◆ getReadSwizzle()

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

Definition at line 129 of file Caps.cpp.

129 {
130 // TODO: add SkTextureCompressionType handling
131 // (can be handled by setting up the colorTypeInfo instead?)
132
133 auto colorTypeInfo = this->getColorTypeInfo(ct, info);
134 if (!colorTypeInfo) {
135 SkDEBUGFAILF("Illegal color type (%d) and format combination.", static_cast<int>(ct));
136 return {};
137 }
138
139 return colorTypeInfo->fReadSwizzle;
140}
#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 114 of file Caps.cpp.

114 {
115 do {
116 auto texInfo = this->getDefaultSampledTextureInfo(ct,
120 // We continue to the fallback color type if there is no default renderable format
121 if (texInfo.isValid() && this->isRenderable(texInfo)) {
122 return ct;
123 }
124 ct = color_type_fallback(ct);
125 } while (ct != kUnknown_SkColorType);
127}
@ 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:92

◆ getSDFTControl()

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

Definition at line 161 of file Caps.cpp.

161 {
162#if !defined(SK_DISABLE_SDF_TEXT)
165 useSDFTForSmallText,
166 true, /*ableToUsePerspectiveSDFT*/
168 this->glyphsAsPathsFontSize()};
169#else
171#endif
172}
float glyphsAsPathsFontSize() const
Definition: Caps.h:279
float minDistanceFieldFontSize() const
Definition: Caps.h:278
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 142 of file Caps.cpp.

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

◆ glyphCacheTextureMaximumBytes()

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

Definition at line 281 of file Caps.h.

◆ glyphsAsPathsFontSize()

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

Definition at line 279 of file Caps.h.

279{ 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 66 of file Caps.cpp.

66 {
67 if (info.numSamples() > 1) {
68 return false;
69 }
70 return this->onIsTexturable(info);
71}
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 73 of file Caps.cpp.

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

◆ maxPathAtlasTextureSize()

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

Definition at line 282 of file Caps.h.

282{ return fMaxPathAtlasTextureSize; }

◆ maxTextureSize()

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

Definition at line 141 of file Caps.h.

141{ return fMaxTextureSize; }

◆ minDistanceFieldFontSize()

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

Definition at line 278 of file Caps.h.

◆ msaaRenderToSingleSampledSupport()

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

Definition at line 254 of file Caps.h.

bool fMSAARenderToSingleSampledSupport
Definition: Caps.h:373

◆ onIsTexturable()

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

◆ protectedSupport()

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

Definition at line 226 of file Caps.h.

226{ return fProtectedSupport; }
bool fProtectedSupport
Definition: Caps.h:366

◆ requiredStorageBufferAlignment()

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

Definition at line 160 of file Caps.h.

size_t fRequiredStorageBufferAlignment
Definition: Caps.h:359

◆ requiredTransferBufferAlignment()

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

Definition at line 163 of file Caps.h.

size_t fRequiredTransferBufferAlignment
Definition: Caps.h:360

◆ requiredUniformBufferAlignment()

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

Definition at line 156 of file Caps.h.

size_t fRequiredUniformBufferAlignment
Definition: Caps.h:358

◆ requireOrderedRecordings()

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

Definition at line 287 of file Caps.h.

◆ resourceBindingRequirements()

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

Definition at line 150 of file Caps.h.

150 {
152 }
ResourceBindingRequirements fResourceBindingReqs
Definition: Caps.h:383

◆ SamplesToKey()

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

Definition at line 314 of file Caps.h.

314 {
315 switch (numSamples) {
316 case 1:
317 return 0;
318 case 2:
319 return 1;
320 case 4:
321 return 2;
322 case 8:
323 return 3;
324 case 16:
325 return 4;
326 default:
328 }
329 }
#define SkUNREACHABLE
Definition: SkAssert.h:135

◆ semaphoreSupport()

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

Definition at line 229 of file Caps.h.

229{ return fSemaphoreSupport; }
bool fSemaphoreSupport
Definition: Caps.h:367

◆ setBackendLabels()

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

Definition at line 297 of file Caps.h.

297{ return fSetBackendLabels; }

◆ shaderCaps()

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

Definition at line 75 of file Caps.h.

75{ return fShaderCaps.get(); }

◆ shaderErrorHandler()

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

Definition at line 273 of file Caps.h.

273{ return fShaderErrorHandler; }

◆ storageBufferPreferred()

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

Definition at line 239 of file Caps.h.

239{ return fStorageBufferPreferred; }
bool fStorageBufferPreferred
Definition: Caps.h:370

◆ storageBufferSupport()

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

Definition at line 235 of file Caps.h.

235{ return fStorageBufferSupport; }
bool fStorageBufferSupport
Definition: Caps.h:369

◆ supportBilerpFromGlyphAtlas()

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

Definition at line 285 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

◆ 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

◆ 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 263 of file Caps.h.

bool fSupportsAHardwareBufferImages
Definition: Caps.h:376

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

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

Member Data Documentation

◆ fAllowCpuSync

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

Definition at line 368 of file Caps.h.

◆ fAllowMultipleAtlasTextures

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

Definition at line 406 of file Caps.h.

◆ fBufferMapsAreAsync

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

Definition at line 372 of file Caps.h.

◆ fClampToBorderSupport

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

Definition at line 365 of file Caps.h.

◆ fComputeSupport

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

Definition at line 375 of file Caps.h.

◆ fDefaultMSAASamples

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

Definition at line 357 of file Caps.h.

◆ fDrawBufferCanBeMapped

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

Definition at line 371 of file Caps.h.

◆ fFullCompressedUploadSizeMustAlignToBlockDims

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

Definition at line 377 of file Caps.h.

◆ fGlyphCacheTextureMaximumBytes

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

Definition at line 399 of file Caps.h.

◆ fGlyphsAsPathsFontSize

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

Definition at line 402 of file Caps.h.

◆ fMaxPathAtlasTextureSize

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

Definition at line 404 of file Caps.h.

◆ fMaxTextureSize

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

Definition at line 356 of file Caps.h.

◆ fMinDistanceFieldFontSize

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

Definition at line 401 of file Caps.h.

◆ fMSAARenderToSingleSampledSupport

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

Definition at line 373 of file Caps.h.

◆ fProtectedSupport

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

Definition at line 366 of file Caps.h.

◆ fRequiredStorageBufferAlignment

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

Definition at line 359 of file Caps.h.

◆ fRequiredTransferBufferAlignment

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

Definition at line 360 of file Caps.h.

◆ fRequiredUniformBufferAlignment

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

Definition at line 358 of file Caps.h.

◆ fRequireOrderedRecordings

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

Definition at line 410 of file Caps.h.

◆ fResourceBindingReqs

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

Definition at line 383 of file Caps.h.

◆ fSemaphoreSupport

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

Definition at line 367 of file Caps.h.

◆ fSetBackendLabels

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

Definition at line 412 of file Caps.h.

◆ fShaderCaps

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

Definition at line 363 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 392 of file Caps.h.

◆ fStorageBufferPreferred

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

Definition at line 370 of file Caps.h.

◆ fStorageBufferSupport

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

Definition at line 369 of file Caps.h.

◆ fSupportBilerpFromGlyphAtlas

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

Definition at line 407 of file Caps.h.

◆ fSupportsAHardwareBufferImages

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

Definition at line 376 of file Caps.h.

◆ fTextureDataRowBytesAlignment

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

Definition at line 361 of file Caps.h.


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