8#ifndef skgpu_graphite_VulkanCaps_DEFINED
9#define skgpu_graphite_VulkanCaps_DEFINED
18struct VulkanTextureInfo;
25 uint32_t physicalDeviceVersion,
72 return fShouldAlwaysUseDedicatedImageMemory;
85 return fShouldPersistentlyMapCpuToGpuBuffers;
93 return fMaxVertexAttributes;
98 return fPhysicalDeviceMemoryProperties2;
106 kAMD_VkVendor = 4098,
107 kARM_VkVendor = 5045,
108 kImagination_VkVendor = 4112,
109 kIntel_VkVendor = 32902,
110 kNvidia_VkVendor = 4318,
111 kQualcomm_VkVendor = 20803,
114 void init(
const ContextOptions&,
117 uint32_t physicalDeviceVersion,
132 const ColorTypeInfo* getColorTypeInfo(
SkColorType,
const TextureInfo&)
const override;
134 bool onIsTexturable(
const TextureInfo&)
const override;
136 bool supportsWritePixels(
const TextureInfo&)
const override;
137 bool supportsReadPixels(
const TextureInfo&)
const override;
139 std::pair<
SkColorType,
bool > supportedWritePixelsColorType(
141 const TextureInfo& dstTextureInfo,
143 std::pair<
SkColorType,
bool > supportedReadPixelsColorType(
145 const TextureInfo& srcTextureInfo,
149 struct SupportedSampleCounts {
156 bool isSampleCountSupported(
int requestedCount)
const;
164 for (
int i = 0;
i < fColorTypeInfoCount; ++
i) {
166 return fColorTypeInfos[
i].fFlags;
183 std::unique_ptr<ColorTypeInfo[]> fColorTypeInfos;
184 int fColorTypeInfoCount = 0;
187 SupportedSampleCounts fSupportedSampleCounts;
195 void setColorType(
SkColorType, std::initializer_list<VkFormat> formats);
199 static const size_t kNumVkFormats = 22;
200 FormatInfo fFormatTable[kNumVkFormats];
202 FormatInfo& getFormatInfo(
VkFormat);
203 const FormatInfo& getFormatInfo(
VkFormat)
const;
206 struct DepthStencilFormatInfo {
214 SupportedSampleCounts fSupportedSampleCounts;
218 static const size_t kNumDepthStencilFlags = 4;
219 VkFormat fDepthStencilFlagsToFormatTable[kNumDepthStencilFlags];
223 static const size_t kNumDepthStencilVkFormats = 5;
224 DepthStencilFormatInfo fDepthStencilFormatTable[kNumDepthStencilVkFormats];
226 DepthStencilFormatInfo& getDepthStencilFormatInfo(
VkFormat);
227 const DepthStencilFormatInfo& getDepthStencilFormatInfo(
VkFormat)
const;
229 uint32_t fMaxVertexAttributes;
230 uint64_t fMaxUniformBufferRange;
241 bool fSupportsMemorylessAttachments =
false;
242 bool fSupportsYcbcrConversion =
false;
243 bool fShouldAlwaysUseDedicatedImageMemory =
false;
244 bool fGpuOnlyBuffersMorePerformant =
false;
245 bool fShouldPersistentlyMapCpuToGpuBuffers =
true;
246 bool fSupportsDeviceFaultInfo =
false;
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
static constexpr int kSkColorTypeCnt
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
static constexpr Swizzle RGBA()
bool isTexturable(const TextureInfo &) const
bool gpuOnlyBuffersMorePerformant() const
TextureInfo getDefaultDepthStencilTextureInfo(SkEnumBitMask< DepthStencilFlags >, uint32_t sampleCount, Protected) const override
bool shouldAlwaysUseDedicatedImageMemory() const
ImmutableSamplerInfo getImmutableSamplerInfo(const TextureProxy *proxy) const override
void buildKeyForTexture(SkISize dimensions, const TextureInfo &, ResourceType, Shareable, GraphiteResourceKey *) const override
TextureInfo getTextureInfoForSampledCopy(const TextureInfo &textureInfo, Mipmapped mipmapped) const override
UniqueKey makeGraphicsPipelineKey(const GraphicsPipelineDesc &, const RenderPassDesc &) const override
GraphiteResourceKey makeSamplerKey(const SamplerDesc &) const override
bool supportsYcbcrConversion() const
bool isStorage(const TextureInfo &) const override
bool isRenderable(const TextureInfo &) const override
TextureInfo getDefaultSampledTextureInfo(SkColorType, Mipmapped mipmapped, Protected, Renderable) const override
bool isTransferSrc(const VulkanTextureInfo &) const
bool isTransferDst(const VulkanTextureInfo &) const
UniqueKey makeComputePipelineKey(const ComputePipelineDesc &) const override
const VkPhysicalDeviceMemoryProperties2 & physicalDeviceMemoryProperties2() const
uint64_t maxUniformBufferRange() const
TextureInfo getDefaultCompressedTextureInfo(SkTextureCompressionType, Mipmapped mipmapped, Protected) const override
TextureInfo getDefaultMSAATextureInfo(const TextureInfo &singleSampledInfo, Discardable discardable) const override
bool supportsDeviceFaultInfo() const
uint32_t maxVertexAttributes() const
uint32_t channelMask(const TextureInfo &) const override
bool shouldPersistentlyMapCpuToGpuBuffers() const
TextureInfo getDefaultStorageTextureInfo(SkColorType) const override
VulkanCaps(const ContextOptions &, const skgpu::VulkanInterface *, VkPhysicalDevice, uint32_t physicalDeviceVersion, const VkPhysicalDeviceFeatures2 *, const skgpu::VulkanExtensions *, Protected)
FlutterSemanticsFlag flags
VkFlags VkImageUsageFlags
VkFlags VkFormatFeatureFlags