The Vulkan layers and extensions wrangler. More...
#include <capabilities_vk.h>
Public Types | |
| using | PhysicalDeviceFeatures = vk::StructureChain< vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR, vk::PhysicalDevice16BitStorageFeatures, vk::PhysicalDeviceImageCompressionControlFeaturesEXT > |
Public Member Functions | |
| CapabilitiesVK (bool enable_validations, bool fatal_missing_validations=false) | |
| ~CapabilitiesVK () | |
| bool | IsValid () const |
| bool | AreValidationsEnabled () const |
| bool | HasExtension (RequiredCommonDeviceExtensionVK ext) const |
| bool | HasExtension (RequiredAndroidDeviceExtensionVK ext) const |
| bool | HasExtension (OptionalDeviceExtensionVK ext) const |
| std::optional< std::vector< std::string > > | GetEnabledLayers () const |
| std::optional< std::vector< std::string > > | GetEnabledInstanceExtensions () const |
| std::optional< std::vector< std::string > > | GetEnabledDeviceExtensions (const vk::PhysicalDevice &physical_device) const |
| std::optional< PhysicalDeviceFeatures > | GetEnabledDeviceFeatures (const vk::PhysicalDevice &physical_device) const |
| bool | SetPhysicalDevice (const vk::PhysicalDevice &physical_device, const PhysicalDeviceFeatures &enabled_features) |
| const vk::PhysicalDeviceProperties & | GetPhysicalDeviceProperties () const |
| void | SetOffscreenFormat (PixelFormat pixel_format) const |
| bool | SupportsOffscreenMSAA () const override |
| Whether the context backend supports attaching offscreen MSAA color/stencil textures. More... | |
| bool | SupportsImplicitResolvingMSAA () const override |
| Whether the context backend supports multisampled rendering to the on-screen surface without requiring an explicit resolve of the MSAA color attachment. More... | |
| bool | SupportsSSBO () const override |
| Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines. More... | |
| bool | SupportsTextureToTextureBlits () const override |
Whether the context backend supports blitting from one texture region to another texture region (via the relevant BlitPass::AddCopy overloads). More... | |
| bool | SupportsFramebufferFetch () const override |
| Whether the context backend is able to support pipelines with shaders that read from the framebuffer (i.e. pixels that have been written by previous draw calls in the current render pass). More... | |
| bool | SupportsCompute () const override |
Whether the context backend supports ComputePass. More... | |
| bool | SupportsComputeSubgroups () const override |
Whether the context backend supports configuring ComputePass command subgroups. More... | |
| bool | SupportsReadFromResolve () const override |
Whether the context backend supports binding the current RenderPass attachments. This is supported if the backend can guarantee that attachment textures will not be mutated until the render pass has fully completed. More... | |
| bool | SupportsDecalSamplerAddressMode () const override |
Whether the context backend supports SamplerAddressMode::Decal. More... | |
| bool | SupportsDeviceTransientTextures () const override |
Whether the context backend supports allocating StorageMode::kDeviceTransient (aka "memoryless") textures, which are temporary textures kept in tile memory for the duration of the RenderPass it's attached to. More... | |
| bool | SupportsTriangleFan () const override |
| Whether the primitive type TriangleFan is supported by the backend. More... | |
| PixelFormat | GetDefaultColorFormat () const override |
Returns a supported PixelFormat for textures that store 4-channel colors (red/green/blue/alpha). More... | |
| PixelFormat | GetDefaultStencilFormat () const override |
Returns a supported PixelFormat for textures that store stencil information. May include a depth channel if a stencil-only format is not available. More... | |
| PixelFormat | GetDefaultDepthStencilFormat () const override |
Returns a supported PixelFormat for textures that store both a stencil and depth component. This will never return a depth-only or stencil-only texture. Returns PixelFormat::kUnknown if no suitable depth+stencil format was found. More... | |
| PixelFormat | GetDefaultGlyphAtlasFormat () const override |
| Returns the default pixel format for the alpha bitmap glyph atlas. More... | |
| ISize | GetMaximumRenderPassAttachmentSize () const override |
| Return the maximum size of a render pass attachment. More... | |
| bool | SupportsTextureFixedRateCompression () 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. More... | |
Public Member Functions inherited from impeller::Capabilities | |
| virtual | ~Capabilities () |
Additional Inherited Members | |
Static Public Member Functions inherited from impeller::BackendCast< CapabilitiesVK, Capabilities > | |
| static CapabilitiesVK & | Cast (Capabilities &base) |
| static const CapabilitiesVK & | Cast (const Capabilities &base) |
| static CapabilitiesVK * | Cast (Capabilities *base) |
| static const CapabilitiesVK * | Cast (const Capabilities *base) |
Protected Member Functions inherited from impeller::Capabilities | |
| Capabilities () | |
| Capabilities (const Capabilities &)=delete | |
| Capabilities & | operator= (const Capabilities &)=delete |
The Vulkan layers and extensions wrangler.
Definition at line 169 of file capabilities_vk.h.
| using impeller::CapabilitiesVK::PhysicalDeviceFeatures = vk::StructureChain<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR, vk::PhysicalDevice16BitStorageFeatures, vk::PhysicalDeviceImageCompressionControlFeaturesEXT> |
Definition at line 198 of file capabilities_vk.h.
|
explicit |
|
default |
| bool impeller::CapabilitiesVK::AreValidationsEnabled | ( | ) | const |
Definition at line 66 of file capabilities_vk.cc.
Referenced by impeller::DebugReportVK::DebugReportVK(), and impeller::testing::TEST().
|
overridevirtual |
Returns a supported PixelFormat for textures that store 4-channel colors (red/green/blue/alpha).
Implements impeller::Capabilities.
Definition at line 620 of file capabilities_vk.cc.
Referenced by impeller::testing::TEST().
|
overridevirtual |
Returns a supported PixelFormat for textures that store both a stencil and depth component. This will never return a depth-only or stencil-only texture. Returns PixelFormat::kUnknown if no suitable depth+stencil format was found.
Implements impeller::Capabilities.
Definition at line 630 of file capabilities_vk.cc.
Referenced by impeller::testing::TEST().
|
overridevirtual |
Returns the default pixel format for the alpha bitmap glyph atlas.
Some backends may use Red channel while others use grey. This should not have any impact
Implements impeller::Capabilities.
Definition at line 639 of file capabilities_vk.cc.
References impeller::kR8UNormInt.
|
overridevirtual |
Returns a supported PixelFormat for textures that store stencil information. May include a depth channel if a stencil-only format is not available.
Implements impeller::Capabilities.
Definition at line 625 of file capabilities_vk.cc.
Referenced by impeller::testing::TEST().
| std::optional< std::vector< std::string > > impeller::CapabilitiesVK::GetEnabledDeviceExtensions | ( | const vk::PhysicalDevice & | physical_device | ) | const |
Definition at line 240 of file capabilities_vk.cc.
References impeller::GetExtensionName(), impeller::GetSupportedDeviceExtensions(), and VALIDATION_LOG.
Referenced by GetEnabledDeviceFeatures().
| std::optional< CapabilitiesVK::PhysicalDeviceFeatures > impeller::CapabilitiesVK::GetEnabledDeviceFeatures | ( | const vk::PhysicalDevice & | physical_device | ) | const |
Definition at line 353 of file capabilities_vk.cc.
References GetEnabledDeviceExtensions(), impeller::HasRequiredProperties(), impeller::HasRequiredQueues(), impeller::IsExtensionInList(), impeller::kEXTImageCompressionControl, impeller::kKHRSamplerYcbcrConversion, impeller::PhysicalDeviceSupportsRequiredFormats(), and VALIDATION_LOG.
Referenced by impeller::PickPhysicalDevice().
| std::optional< std::vector< std::string > > impeller::CapabilitiesVK::GetEnabledInstanceExtensions | ( | ) | const |
| std::optional< std::vector< std::string > > impeller::CapabilitiesVK::GetEnabledLayers | ( | ) | const |
Definition at line 70 of file capabilities_vk.cc.
|
overridevirtual |
Return the maximum size of a render pass attachment.
Note that this may be smaller than the maximum allocatable texture size.
Implements impeller::Capabilities.
Definition at line 719 of file capabilities_vk.cc.
| const vk::PhysicalDeviceProperties & impeller::CapabilitiesVK::GetPhysicalDeviceProperties | ( | ) | const |
Definition at line 635 of file capabilities_vk.cc.
| std::optional< vk::ImageCompressionFixedRateFlagBitsEXT > impeller::CapabilitiesVK::GetSupportedFRCRate | ( | CompressionType | compression_type, |
| const FRCFormatDescriptor & | desc | ||
| ) | const |
Get the fixed compression rate supported by the context for the given format and usage.
| [in] | compression_type | The compression type. |
| [in] | desc | The format and usage of the image. |
Definition at line 663 of file capabilities_vk.cc.
References impeller::FRCFormatDescriptor::flags, impeller::FRCFormatDescriptor::format, impeller::kLossy, impeller::FRCFormatDescriptor::tiling, impeller::FRCFormatDescriptor::type, and impeller::FRCFormatDescriptor::usage.
| bool impeller::CapabilitiesVK::HasExtension | ( | OptionalDeviceExtensionVK | ext | ) | const |
Definition at line 653 of file capabilities_vk.cc.
| bool impeller::CapabilitiesVK::HasExtension | ( | RequiredAndroidDeviceExtensionVK | ext | ) | const |
Definition at line 648 of file capabilities_vk.cc.
| bool impeller::CapabilitiesVK::HasExtension | ( | RequiredCommonDeviceExtensionVK | ext | ) | const |
| bool impeller::CapabilitiesVK::IsValid | ( | ) | const |
Definition at line 62 of file capabilities_vk.cc.
| void impeller::CapabilitiesVK::SetOffscreenFormat | ( | PixelFormat | pixel_format | ) | const |
Definition at line 464 of file capabilities_vk.cc.
Referenced by impeller::ContextVK::SetOffscreenFormat().
| bool impeller::CapabilitiesVK::SetPhysicalDevice | ( | const vk::PhysicalDevice & | physical_device, |
| const PhysicalDeviceFeatures & | enabled_features | ||
| ) |
Definition at line 468 of file capabilities_vk.cc.
References impeller::GetExtensionName(), impeller::GetSupportedDeviceExtensions(), impeller::HasSuitableColorFormat(), impeller::HasSuitableDepthStencilFormat(), impeller::kD24UnormS8Uint, impeller::kD32FloatS8UInt, impeller::kR8G8B8A8UNormInt, impeller::kS8UInt, and impeller::kUnknown.
|
overridevirtual |
Whether the context backend supports ComputePass.
Implements impeller::Capabilities.
Definition at line 594 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports configuring ComputePass command subgroups.
Implements impeller::Capabilities.
Definition at line 600 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports SamplerAddressMode::Decal.
Implements impeller::Capabilities.
Definition at line 610 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports allocating StorageMode::kDeviceTransient (aka "memoryless") textures, which are temporary textures kept in tile memory for the duration of the RenderPass it's attached to.
This feature is especially useful for MSAA and stencils.
Implements impeller::Capabilities.
Definition at line 615 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend is able to support pipelines with shaders that read from the framebuffer (i.e. pixels that have been written by previous draw calls in the current render pass).
Example of reading from the first color attachment in a GLSL shader: ``` uniform subpassInput subpass_input;
out vec4 frag_color;
void main() { vec4 color = subpassLoad(subpass_input); // Invert the colors drawn to the framebuffer. frag_color = vec4(vec3(1) - color.rgb, color.a); } ```
Implements impeller::Capabilities.
Definition at line 589 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports multisampled rendering to the on-screen surface without requiring an explicit resolve of the MSAA color attachment.
Implements impeller::Capabilities.
Definition at line 574 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports attaching offscreen MSAA color/stencil textures.
Implements impeller::Capabilities.
Definition at line 569 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports binding the current RenderPass attachments. This is supported if the backend can guarantee that attachment textures will not be mutated until the render pass has fully completed.
This is possible because many mobile graphics cards track RenderPass attachment state in intermediary tile memory prior to Storing the pass in the heap allocated attachments on DRAM. Metal's hazard tracking and Vulkan's barriers are granular enough to allow for safely accessing attachment textures prior to storage in the same RenderPass.
Implements impeller::Capabilities.
Definition at line 606 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines.
Implements impeller::Capabilities.
Definition at line 579 of file capabilities_vk.cc.
| bool impeller::CapabilitiesVK::SupportsTextureFixedRateCompression | ( | ) | const |
Definition at line 658 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports blitting from one texture region to another texture region (via the relevant BlitPass::AddCopy overloads).
Implements impeller::Capabilities.
Definition at line 584 of file capabilities_vk.cc.
|
overridevirtual |
Whether the primitive type TriangleFan is supported by the backend.
Implements impeller::Capabilities.
Definition at line 715 of file capabilities_vk.cc.