8#ifndef skgpu_graphite_Caps_DEFINED
9#define skgpu_graphite_Caps_DEFINED
25#if defined(GRAPHITE_TEST_UTILS)
33namespace SkSL {
struct ShaderCaps; }
35namespace skgpu {
class ShaderErrorHandler; }
41class ComputePipelineDesc;
42class GraphicsPipelineDesc;
43class GraphiteResourceKey;
44class RendererProvider;
79#if defined(GRAPHITE_TEST_UTILS)
80 std::string_view deviceName()
const {
return fDeviceName; }
83 return fRequestedPathRendererStrategy;
103 uint32_t sampleCount,
110 const SkISize colorAttachmentDimensions)
const;
244#if defined(GRAPHITE_TEST_UTILS)
245 bool drawBufferCanBeMappedForReadback()
const {
return fDrawBufferCanBeMappedForReadback; }
306#if defined(GRAPHITE_TEST_UTILS)
307 void setDeviceName(
const char* n) {
315 switch (numSamples) {
379#if defined(GRAPHITE_TEST_UTILS)
380 bool fDrawBufferCanBeMappedForReadback =
true;
394#if defined(GRAPHITE_TEST_UTILS)
395 std::string fDeviceName;
396 int fMaxTextureAtlasSize = 2048;
static constexpr size_t SkAlignTo(size_t x, size_t alignment)
@ kUnknown_SkColorType
uninitialized
size_t fRequiredStorageBufferAlignment
virtual bool extractGraphicsDescs(const UniqueKey &, GraphicsPipelineDesc *, RenderPassDesc *, const RendererProvider *) const
bool fDrawBufferCanBeMapped
virtual bool onIsTexturable(const TextureInfo &) const =0
virtual ImmutableSamplerInfo getImmutableSamplerInfo(const TextureProxy *) const
size_t requiredUniformBufferAlignment() const
virtual TextureInfo getDefaultDepthStencilTextureInfo(SkEnumBitMask< DepthStencilFlags >, uint32_t sampleCount, Protected) const =0
virtual GraphiteResourceKey makeSamplerKey(const SamplerDesc &samplerDesc) const
bool semaphoreSupport() const
virtual uint32_t channelMask(const TextureInfo &) const =0
skgpu::ShaderErrorHandler * shaderErrorHandler() const
const ResourceBindingRequirements & resourceBindingRequirements() const
virtual const ColorTypeInfo * getColorTypeInfo(SkColorType, const TextureInfo &) const =0
skgpu::Swizzle getReadSwizzle(SkColorType, const TextureInfo &) const
bool fSupportsAHardwareBufferImages
virtual TextureInfo getDefaultMSAATextureInfo(const TextureInfo &singleSampledInfo, Discardable discardable) const =0
bool drawBufferCanBeMapped() const
bool requireOrderedRecordings() const
virtual TextureInfo getDefaultCompressedTextureInfo(SkTextureCompressionType, Mipmapped mipmapped, Protected) const =0
size_t fRequiredUniformBufferAlignment
float fMinDistanceFieldFontSize
bool allowMultipleAtlasTextures() const
bool isTexturable(const TextureInfo &) const
bool fStorageBufferPreferred
size_t requiredStorageBufferAlignment() const
virtual TextureInfo getDefaultStorageTextureInfo(SkColorType) const =0
bool fClampToBorderSupport
bool fSupportBilerpFromGlyphAtlas
bool computeSupport() const
sktext::gpu::SDFTControl getSDFTControl(bool useSDFTForSmallText) const
virtual std::pair< SkColorType, bool > supportedWritePixelsColorType(SkColorType dstColorType, const TextureInfo &dstTextureInfo, SkColorType srcColorType) const =0
bool supportsAHardwareBufferImages() const
virtual bool supportsReadPixels(const TextureInfo &textureInfo) const =0
bool fMSAARenderToSingleSampledSupport
int fMaxPathAtlasTextureSize
bool supportBilerpFromGlyphAtlas() const
bool fullCompressedUploadSizeMustAlignToBlockDims() const
virtual SkISize getDepthAttachmentDimensions(const TextureInfo &, const SkISize colorAttachmentDimensions) const
virtual UniqueKey makeGraphicsPipelineKey(const GraphicsPipelineDesc &, const RenderPassDesc &) const =0
bool bufferMapsAreAsync() const
bool protectedSupport() const
bool setBackendLabels() const
virtual bool isStorage(const TextureInfo &) const =0
size_t getAlignedTextureDataRowBytes(size_t rowBytes) const
size_t fGlyphCacheTextureMaximumBytes
skgpu::Swizzle getWriteSwizzle(SkColorType, const TextureInfo &) const
bool storageBufferPreferred() const
float fGlyphsAsPathsFontSize
virtual UniqueKey makeComputePipelineKey(const ComputePipelineDesc &) const =0
SkColorType getRenderableColorType(SkColorType) const
bool fFullCompressedUploadSizeMustAlignToBlockDims
std::unique_ptr< SkSL::ShaderCaps > fShaderCaps
virtual TextureInfo getTextureInfoForSampledCopy(const TextureInfo &textureInfo, Mipmapped mipmapped) const =0
int defaultMSAASamplesCount() const
bool fStorageBufferSupport
sk_sp< SkCapabilities > capabilities() const
float glyphsAsPathsFontSize() const
DstReadRequirement getDstReadRequirement() const
static uint32_t SamplesToKey(uint32_t numSamples)
virtual bool isRenderable(const TextureInfo &) const =0
virtual TextureInfo getDefaultSampledTextureInfo(SkColorType, Mipmapped mipmapped, Protected, Renderable) const =0
bool clampToBorderSupport() const
bool areColorTypeAndTextureInfoCompatible(SkColorType, const TextureInfo &) const
bool fRequireOrderedRecordings
virtual std::pair< SkColorType, bool > supportedReadPixelsColorType(SkColorType srcColorType, const TextureInfo &srcTextureInfo, SkColorType dstColorType) const =0
ShaderErrorHandler * fShaderErrorHandler
size_t glyphCacheTextureMaximumBytes() const
float minDistanceFieldFontSize() const
void finishInitialization(const ContextOptions &)
bool msaaRenderToSingleSampledSupport() const
virtual bool supportsWritePixels(const TextureInfo &textureInfo) const =0
size_t fRequiredTransferBufferAlignment
virtual void buildKeyForTexture(SkISize dimensions, const TextureInfo &, ResourceType, Shareable, GraphiteResourceKey *) const =0
bool allowCpuSync() const
const SkSL::ShaderCaps * shaderCaps() const
bool storageBufferSupport() const
size_t requiredTransferBufferAlignment() const
int maxPathAtlasTextureSize() const
ResourceBindingRequirements fResourceBindingReqs
size_t fTextureDataRowBytesAlignment
int maxTextureSize() const
bool fAllowMultipleAtlasTextures
FlutterSemanticsFlag flags
ColorTypeInfo(SkColorType ct, SkColorType transferCt, uint32_t flags, skgpu::Swizzle readSwizzle, skgpu::Swizzle writeSwizzle)
skgpu::Swizzle fWriteSwizzle
SkColorType fTransferColorType
skgpu::Swizzle fReadSwizzle
Layout fUniformBufferLayout
bool fDistinctIndexRanges
Layout fStorageBufferLayout
bool fSeparateTextureAndSamplerBinding