Flutter Engine
The Flutter Engine
|
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. | |
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. | |
bool | SupportsSSBO () const override |
Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines. | |
bool | SupportsBufferToTextureBlits () const override |
Whether the context backend supports blitting from a given DeviceBuffer view to a texture region (via the relevant BlitPass::AddCopy overloads). | |
bool | SupportsTextureToTextureBlits () const override |
Whether the context backend supports blitting from one texture region to another texture region (via the relevant BlitPass::AddCopy overloads). | |
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). | |
bool | SupportsCompute () const override |
Whether the context backend supports ComputePass . | |
bool | SupportsComputeSubgroups () const override |
Whether the context backend supports configuring ComputePass command subgroups. | |
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. | |
bool | SupportsDecalSamplerAddressMode () const override |
Whether the context backend supports SamplerAddressMode::Decal . | |
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. | |
PixelFormat | GetDefaultColorFormat () const override |
Returns a supported PixelFormat for textures that store 4-channel colors (red/green/blue/alpha). | |
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. | |
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. | |
PixelFormat | GetDefaultGlyphAtlasFormat () const override |
Returns the default pixel format for the alpha bitmap glyph atlas. | |
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 113 of file capabilities_vk.h.
using impeller::CapabilitiesVK::PhysicalDeviceFeatures = vk::StructureChain<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR, vk::PhysicalDevice16BitStorageFeatures> |
Definition at line 138 of file capabilities_vk.h.
|
explicit |
Definition at line 17 of file capabilities_vk.cc.
|
default |
bool impeller::CapabilitiesVK::AreValidationsEnabled | ( | ) | const |
Definition at line 65 of file capabilities_vk.cc.
|
overridevirtual |
Returns a supported PixelFormat
for textures that store 4-channel colors (red/green/blue/alpha).
Implements impeller::Capabilities.
Definition at line 573 of file capabilities_vk.cc.
|
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 583 of file capabilities_vk.cc.
|
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 592 of file capabilities_vk.cc.
|
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 578 of file capabilities_vk.cc.
std::optional< std::vector< std::string > > impeller::CapabilitiesVK::GetEnabledDeviceExtensions | ( | const vk::PhysicalDevice & | physical_device | ) | const |
Definition at line 229 of file capabilities_vk.cc.
std::optional< CapabilitiesVK::PhysicalDeviceFeatures > impeller::CapabilitiesVK::GetEnabledDeviceFeatures | ( | const vk::PhysicalDevice & | physical_device | ) | const |
Definition at line 342 of file capabilities_vk.cc.
std::optional< std::vector< std::string > > impeller::CapabilitiesVK::GetEnabledInstanceExtensions | ( | ) | const |
Definition at line 82 of file capabilities_vk.cc.
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 588 of file capabilities_vk.cc.
bool impeller::CapabilitiesVK::HasExtension | ( | OptionalDeviceExtensionVK | ext | ) | const |
Definition at line 606 of file capabilities_vk.cc.
bool impeller::CapabilitiesVK::HasExtension | ( | RequiredAndroidDeviceExtensionVK | ext | ) | const |
Definition at line 601 of file capabilities_vk.cc.
bool impeller::CapabilitiesVK::HasExtension | ( | RequiredCommonDeviceExtensionVK | ext | ) | const |
Definition at line 596 of file capabilities_vk.cc.
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 425 of file capabilities_vk.cc.
bool impeller::CapabilitiesVK::SetPhysicalDevice | ( | const vk::PhysicalDevice & | physical_device | ) |
Definition at line 429 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports blitting from a given DeviceBuffer
view to a texture region (via the relevant BlitPass::AddCopy
overloads).
Implements impeller::Capabilities.
Definition at line 532 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports ComputePass
.
Implements impeller::Capabilities.
Definition at line 547 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports configuring ComputePass
command subgroups.
Implements impeller::Capabilities.
Definition at line 553 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports SamplerAddressMode::Decal
.
Implements impeller::Capabilities.
Definition at line 563 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 568 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 542 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 522 of file capabilities_vk.cc.
|
overridevirtual |
Whether the context backend supports attaching offscreen MSAA color/stencil textures.
Implements impeller::Capabilities.
Definition at line 517 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 559 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 527 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 537 of file capabilities_vk.cc.