The Vulkan layers and extensions wrangler. More...
#include <capabilities_vk.h>
Public Types | |
| using | PhysicalDeviceFeatures = vk::StructureChain< vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR, vk::PhysicalDevice16BitStorageFeatures > |
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 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... | |
| 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... | |
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 140 of file capabilities_vk.h.
| using impeller::CapabilitiesVK::PhysicalDeviceFeatures = vk::StructureChain<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR, vk::PhysicalDevice16BitStorageFeatures> |
Definition at line 168 of file capabilities_vk.h.
|
explicit |
|
default |
| bool impeller::CapabilitiesVK::AreValidationsEnabled | ( | ) | const |
Definition at line 65 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 576 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 586 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 595 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 581 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 237 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 350 of file capabilities_vk.cc.
References GetEnabledDeviceExtensions(), impeller::HasRequiredProperties(), impeller::HasRequiredQueues(), impeller::IsExtensionInList(), 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 69 of file capabilities_vk.cc.
| const vk::PhysicalDeviceProperties & impeller::CapabilitiesVK::GetPhysicalDeviceProperties | ( | ) | const |
Definition at line 591 of file capabilities_vk.cc.
| bool impeller::CapabilitiesVK::HasExtension | ( | OptionalDeviceExtensionVK | ext | ) | const |
Definition at line 609 of file capabilities_vk.cc.
| bool impeller::CapabilitiesVK::HasExtension | ( | RequiredAndroidDeviceExtensionVK | ext | ) | const |
Definition at line 604 of file capabilities_vk.cc.
| bool impeller::CapabilitiesVK::HasExtension | ( | RequiredCommonDeviceExtensionVK | ext | ) | const |
| bool impeller::CapabilitiesVK::IsValid | ( | ) | const |
Definition at line 61 of file capabilities_vk.cc.
| void impeller::CapabilitiesVK::SetOffscreenFormat | ( | PixelFormat | pixel_format | ) | const |
Definition at line 433 of file capabilities_vk.cc.
Referenced by impeller::ContextVK::SetOffscreenFormat().
| bool impeller::CapabilitiesVK::SetPhysicalDevice | ( | const vk::PhysicalDevice & | physical_device | ) |
Definition at line 437 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 550 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports configuring ComputePass command subgroups.
Implements impeller::Capabilities.
Definition at line 556 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports SamplerAddressMode::Decal.
Implements impeller::Capabilities.
Definition at line 566 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 571 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 545 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 530 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports attaching offscreen MSAA color/stencil textures.
Implements impeller::Capabilities.
Definition at line 525 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 562 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 535 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 540 of file capabilities_vk.cc.