5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_CAPABILITIES_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_CAPABILITIES_VK_H_
163 vk::Format
format = vk::Format::eUndefined;
171 type(image_info.imageType),
184 bool fatal_missing_validations =
false,
185 bool use_embedder_extensions =
false,
186 std::vector<std::string> instance_extensions = {},
187 std::vector<std::string> device_extensions = {});
208 const vk::PhysicalDevice& physical_device)
const;
211 vk::StructureChain<vk::PhysicalDeviceFeatures2,
212 vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR,
213 vk::PhysicalDevice16BitStorageFeatures,
214 vk::PhysicalDeviceImageCompressionControlFeaturesEXT>;
217 const vk::PhysicalDevice& physical_device)
const;
220 const vk::PhysicalDevice& physical_device,
312 bool validations_enabled_ =
false;
313 std::map<std::string, std::set<std::string>> exts_;
314 std::set<RequiredCommonDeviceExtensionVK> required_common_device_extensions_;
315 std::set<RequiredAndroidDeviceExtensionVK>
316 required_android_device_extensions_;
317 std::set<OptionalAndroidDeviceExtensionVK>
318 optional_android_device_extensions_;
319 std::set<OptionalDeviceExtensionVK> optional_device_extensions_;
323 vk::PhysicalDevice physical_device_;
324 vk::PhysicalDeviceProperties device_properties_;
325 size_t minimum_uniform_alignment_ = 256;
326 bool supports_compute_subgroups_ =
false;
327 bool supports_device_transient_textures_ =
false;
328 bool supports_texture_fixed_rate_compression_ =
false;
329 ISize max_render_pass_attachment_size_ =
ISize{0, 0};
330 bool has_triangle_fans_ =
true;
331 bool has_primitive_restart_ =
true;
332 bool has_framebuffer_fetch_ =
true;
333 bool supports_external_fence_and_semaphore_ =
false;
334 bool is_valid_ =
false;
338 bool use_embedder_extensions_ =
false;
339 std::vector<std::string> embedder_instance_extensions_;
340 std::vector<std::string> embedder_device_extensions_;
344 bool HasLayer(
const std::string& layer)
const;
The Vulkan layers and extensions wrangler.
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
CapabilitiesVK(bool enable_validations, bool fatal_missing_validations=false, bool use_embedder_extensions=false, std::vector< std::string > instance_extensions={}, std::vector< std::string > device_extensions={})
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.
vk::StructureChain< vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR, vk::PhysicalDevice16BitStorageFeatures, vk::PhysicalDeviceImageCompressionControlFeaturesEXT > PhysicalDeviceFeatures
bool SupportsComputeSubgroups() const override
Whether the context backend supports configuring ComputePass command subgroups.
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 ...
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
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
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,...
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
@ kVKKHRPortabilitySubset
@ kEXTPipelineCreationFeedback
A non-exhaustive set of driver specific workarounds.