5#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_CAPABILITIES_VK_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_CAPABILITIES_VK_H_
171 vk::Format
format = vk::Format::eUndefined;
179 type(image_info.imageType),
192 bool fatal_missing_validations =
false,
193 bool use_embedder_extensions =
false,
219 vk::StructureChain<vk::PhysicalDeviceFeatures2,
220 vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR,
221 vk::PhysicalDevice16BitStorageFeatures,
222 vk::PhysicalDeviceImageCompressionControlFeaturesEXT,
223 vk::PhysicalDeviceTextureCompressionASTCHDRFeatures>;
340 bool validations_enabled_ =
false;
341 std::map<std::string, std::set<std::string>> exts_;
342 std::set<RequiredCommonDeviceExtensionVK> required_common_device_extensions_;
343 std::set<RequiredAndroidDeviceExtensionVK>
344 required_android_device_extensions_;
345 std::set<OptionalAndroidDeviceExtensionVK>
346 optional_android_device_extensions_;
347 std::set<OptionalDeviceExtensionVK> optional_device_extensions_;
351 vk::PhysicalDevice physical_device_;
352 vk::PhysicalDeviceProperties device_properties_;
353 size_t minimum_uniform_alignment_ = 256;
354 size_t minimum_storage_alignment_ = 256;
355 bool supports_compute_subgroups_ =
false;
356 bool supports_device_transient_textures_ =
false;
357 bool supports_texture_fixed_rate_compression_ =
false;
358 ISize max_render_pass_attachment_size_ =
ISize{0, 0};
359 bool has_triangle_fans_ =
true;
360 bool has_primitive_restart_ =
true;
361 bool has_framebuffer_fetch_ =
true;
362 bool supports_external_fence_and_semaphore_ =
false;
363 bool supports_texture_compression_bc_ =
false;
364 bool supports_texture_compression_etc2_ =
false;
365 bool supports_texture_compression_astc_ =
false;
366 bool supports_texture_compression_astc_hdr_ =
false;
367 bool is_valid_ =
false;
371 bool use_embedder_extensions_ =
false;
372 std::vector<std::string> embedder_instance_extensions_;
373 std::vector<std::string> embedder_device_extensions_;
377 bool HasLayer(
const std::string& layer)
const;
The Vulkan layers and extensions wrangler.
bool SupportsFramebufferRenderMipmap() const override
Whether a non-zero mip level of a texture can be attached as a render target. Rendering into a cube m...
bool SupportsTriangleFan() const override
Whether the primitive type TriangleFan is supported by the backend.
size_t GetMinimumUniformAlignment() const override
The minimum alignment of uniform value offsets in bytes.
bool SupportsDeviceTransientTextures() const override
Whether the context backend supports allocating StorageMode::kDeviceTransient (aka "memoryless") text...
std::optional< std::vector< std::string > > GetEnabledInstanceExtensions() const
bool AreValidationsEnabled() const
bool SetPhysicalDevice(const vk::PhysicalDevice &physical_device, const PhysicalDeviceFeatures &enabled_features)
ISize GetMaximumRenderPassAttachmentSize() const override
Return the maximum size of a render pass attachment.
bool SupportsSSBO() const override
Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines.
bool SupportsFramebufferFetch() const override
Whether the context backend is able to support pipelines with shaders that read from the framebuffer ...
bool SupportsExternalSemaphoreExtensions() const
bool SupportsManuallyMippedTextures() const override
Whether a texture whose mip levels were uploaded by hand (rather than produced by BlitPass::GenerateM...
bool SupportsOffscreenMSAA() const override
Whether the context backend supports attaching offscreen MSAA color/stencil textures.
bool SupportsCompute() const override
Whether the context backend supports ComputePass.
bool HasExtension(RequiredCommonDeviceExtensionVK ext) const
std::optional< vk::ImageCompressionFixedRateFlagBitsEXT > GetSupportedFRCRate(CompressionType compression_type, const FRCFormatDescriptor &desc) const
Get the fixed compression rate supported by the context for the given format and usage.
void SetOffscreenFormat(PixelFormat pixel_format) const
PixelFormat GetDefaultStencilFormat() const override
Returns a supported PixelFormat for textures that store stencil information. May include a depth chan...
void ApplyWorkarounds(const WorkaroundsVK &workarounds)
Update capabilities for the given set of workarounds.
bool SupportsComputeSubgroups() const override
Whether the context backend supports configuring ComputePass command subgroups.
size_t GetMinimumStorageBufferAlignment() const override
The minimum alignment of storage buffer value offsets in bytes.
PixelFormat GetDefaultDepthStencilFormat() const override
Returns a supported PixelFormat for textures that store both a stencil and depth component....
bool SupportsTextureToTextureBlits() const override
Whether the context backend supports blitting from one texture region to another texture region (via ...
bool Supports32BitPrimitiveIndices() const override
Whether 32-bit values are supported in index buffers used to draw primitives.
std::optional< std::vector< std::string > > GetEnabledDeviceExtensions(const vk::PhysicalDevice &physical_device) const
bool SupportsReadFromResolve() const override
Whether the context backend supports binding the current RenderPass attachments. This is supported if...
bool SupportsDecalSamplerAddressMode() const override
Whether the context backend supports SamplerAddressMode::Decal.
bool SupportsPrimitiveRestart() const override
Whether primitive restart is supported.
std::optional< std::vector< std::string > > GetEnabledLayers() const
bool SupportsTextureFixedRateCompression() const
bool NeedsPartitionedHostBuffer() const override
Whether the host buffer should use separate device buffers for indexes from other data.
PixelFormat GetDefaultGlyphAtlasFormat() const override
Returns the default pixel format for the alpha bitmap glyph atlas.
PixelFormat GetDefaultColorFormat() const override
Returns a supported PixelFormat for textures that store 4-channel colors (red/green/blue/alpha).
const vk::PhysicalDeviceProperties & GetPhysicalDeviceProperties() const
bool SupportsExtendedRangeFormats() const override
Whether the XR formats are supported on this device.
bool SupportsImplicitResolvingMSAA() const override
Whether the context backend supports multisampled rendering to the on-screen surface without requirin...
std::optional< PhysicalDeviceFeatures > GetEnabledDeviceFeatures(const vk::PhysicalDevice &physical_device) const
bool SupportsTextureCompression(CompressedTextureFamily family) const override
Whether the given family of block-compressed texture formats is supported by this device....
vk::StructureChain< vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR, vk::PhysicalDevice16BitStorageFeatures, vk::PhysicalDeviceImageCompressionControlFeaturesEXT, vk::PhysicalDeviceTextureCompressionASTCHDRFeatures > PhysicalDeviceFeatures
VkPhysicalDevice physical_device
std::vector< std::string > device_extensions
std::vector< std::string > instance_extensions
RequiredAndroidDeviceExtensionVK
A device extension available on all Android platforms. Without the presence of these extensions on An...
@ kKHRSamplerYcbcrConversion
@ kKHRDedicatedAllocation
@ kANDROIDExternalMemoryAndroidHardwareBuffer
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
CompressedTextureFamily
The family of a block-compressed pixel format. GPUs support compressed formats on a per-family basis,...
RequiredCommonDeviceExtensionVK
A device extension available on all platforms. Without the presence of these extensions,...
OptionalAndroidDeviceExtensionVK
A device extension available on some Android platforms.
@ kKHRExternalSemaphoreFd
CompressionType
Additional compression to apply to a texture. This value is ignored on platforms which do not support...
OptionalDeviceExtensionVK
A device extension enabled if available. Subsystems cannot assume availability and must check if thes...
@ kEXTImageCompressionControl
@ kEXTTextureCompressionAstcHdr
@ kVKKHRPortabilitySubset
@ kEXTPipelineCreationFeedback
A non-exhaustive set of driver specific workarounds.