| Flutter Impeller |

Public Member Functions | Protected Member Functions | List of all members
impeller::Capabilities Class Referenceabstract

`#include <capabilities.h>`

Inheritance diagram for impeller::Capabilities:

## Public Member Functions
virtual | ~Capabilities ()
virtual bool | SupportsOffscreenMSAA () const =0
| Whether the context backend supports attaching offscreen MSAA color/stencil textures. More...
virtual bool | SupportsImplicitResolvingMSAA () const =0
| Whether the context backend supports multisampled rendering to the on-screen surface without requiring an explicit resolve of the MSAA color attachment. More...
virtual bool | SupportsSSBO () const =0
| Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines. More...
virtual bool | SupportsTextureToTextureBlits () const =0
| Whether the context backend supports blitting from one texture region to another texture region (via the relevant `BlitPass::AddCopy` overloads). More...
virtual bool | SupportsFramebufferFetch () const =0
| 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...
virtual bool | SupportsCompute () const =0
| Whether the context backend supports `ComputePass`. More...
virtual bool | SupportsComputeSubgroups () const =0
| Whether the context backend supports configuring `ComputePass` command subgroups. More...
virtual bool | SupportsReadFromResolve () const =0
| 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...
virtual bool | SupportsDecalSamplerAddressMode () const =0
| Whether the context backend supports `SamplerAddressMode::Decal`. More...
virtual bool | SupportsDeviceTransientTextures () const =0
| 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...
virtual bool | SupportsTriangleFan () const =0
| Whether the primitive type TriangleFan is supported by the backend. More...
virtual bool | SupportsPrimitiveRestart () const =0
| Whether primitive restart is supported. More...
virtual PixelFormat | GetDefaultColorFormat () const =0
| Returns a supported `PixelFormat` for textures that store 4-channel colors (red/green/blue/alpha). More...
virtual PixelFormat | GetDefaultStencilFormat () const =0
| Returns a supported `PixelFormat` for textures that store stencil information. May include a depth channel if a stencil-only format is not available. More...
virtual PixelFormat | GetDefaultDepthStencilFormat () const =0
| 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...
virtual PixelFormat | GetDefaultGlyphAtlasFormat () const =0
| Returns the default pixel format for the alpha bitmap glyph atlas. More...
virtual ISize | GetMaximumRenderPassAttachmentSize () const =0
| Return the maximum size of a render pass attachment. More...
virtual bool | SupportsExtendedRangeFormats () const =0
| Whether the XR formats are supported on this device. More...

## Protected Member Functions
| Capabilities ()
| Capabilities (const Capabilities &)=delete
Capabilities & | operator= (const Capabilities &)=delete

## Detailed Description

Definition at line 14 of file capabilities.h.

## Constructor & Destructor Documentation

## ◆ ~Capabilities()

impeller::Capabilities::~Capabilities | ( |  | ) |
| virtual default

## ◆ Capabilities() [1/2]

impeller::Capabilities::Capabilities | ( |  | ) |
| protected default

## ◆ Capabilities() [2/2]

impeller::Capabilities::Capabilities | ( | const Capabilities & |  | ) |
| protected delete

## Member Function Documentation

## ◆ GetDefaultColorFormat()

virtual PixelFormat impeller::Capabilities::GetDefaultColorFormat | ( |  | ) | const
| pure virtual

Returns a supported `PixelFormat` for textures that store 4-channel colors (red/green/blue/alpha).

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

Referenced by impeller::testing::CreateTestCanvas().

## ◆ GetDefaultDepthStencilFormat()

virtual PixelFormat impeller::Capabilities::GetDefaultDepthStencilFormat | ( |  | ) | const
| pure virtual

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.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ GetDefaultGlyphAtlasFormat()

virtual PixelFormat impeller::Capabilities::GetDefaultGlyphAtlasFormat | ( |  | ) | const
| pure virtual

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

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ GetDefaultStencilFormat()

virtual PixelFormat impeller::Capabilities::GetDefaultStencilFormat | ( |  | ) | const
| pure virtual

Returns a supported `PixelFormat` for textures that store stencil information. May include a depth channel if a stencil-only format is not available.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ GetMaximumRenderPassAttachmentSize()

virtual ISize impeller::Capabilities::GetMaximumRenderPassAttachmentSize | ( |  | ) | const
| pure virtual

Return the maximum size of a render pass attachment.

Note that this may be smaller than the maximum allocatable texture size.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ operator=()

Capabilities& impeller::Capabilities::operator= | ( | const Capabilities & |  | ) |
| protected delete

## ◆ SupportsCompute()

virtual bool impeller::Capabilities::SupportsCompute | ( |  | ) | const
| pure virtual

Whether the context backend supports `ComputePass`.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ SupportsComputeSubgroups()

virtual bool impeller::Capabilities::SupportsComputeSubgroups | ( |  | ) | const
| pure virtual

Whether the context backend supports configuring `ComputePass` command subgroups.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ SupportsDecalSamplerAddressMode()

virtual bool impeller::Capabilities::SupportsDecalSamplerAddressMode | ( |  | ) | const
| pure virtual

Whether the context backend supports `SamplerAddressMode::Decal`.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

Referenced by impeller::TileModeToAddressMode().

## ◆ SupportsDeviceTransientTextures()

virtual bool impeller::Capabilities::SupportsDeviceTransientTextures | ( |  | ) | const
| pure virtual

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.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ SupportsExtendedRangeFormats()

virtual bool impeller::Capabilities::SupportsExtendedRangeFormats | ( |  | ) | const
| pure virtual

Whether the XR formats are supported on this device.

This is only ever true for iOS and macOS devices. We may need to revisit this API when approaching wide gamut rendering for Vulkan and GLES.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ SupportsFramebufferFetch()

virtual bool impeller::Capabilities::SupportsFramebufferFetch | ( |  | ) | const
| pure virtual

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); } ```

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

Referenced by impeller::RequiresReadbackForBlends(), impeller::Canvas::Restore(), impeller::Canvas::SaveLayer(), and impeller::testing::TEST_P().

## ◆ SupportsImplicitResolvingMSAA()

virtual bool impeller::Capabilities::SupportsImplicitResolvingMSAA | ( |  | ) | const
| pure virtual

Whether the context backend supports multisampled rendering to the on-screen surface without requiring an explicit resolve of the MSAA color attachment.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ SupportsOffscreenMSAA()

virtual bool impeller::Capabilities::SupportsOffscreenMSAA | ( |  | ) | const
| pure virtual

Whether the context backend supports attaching offscreen MSAA color/stencil textures.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ SupportsPrimitiveRestart()

virtual bool impeller::Capabilities::SupportsPrimitiveRestart | ( |  | ) | const
| pure virtual

Whether primitive restart is supported.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ SupportsReadFromResolve()

virtual bool impeller::Capabilities::SupportsReadFromResolve | ( |  | ) | const
| pure virtual

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`.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ SupportsSSBO()

virtual bool impeller::Capabilities::SupportsSSBO | ( |  | ) | const
| pure virtual

Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

Referenced by impeller::ConicalGradientContents::Render(), impeller::LinearGradientContents::Render(), impeller::RadialGradientContents::Render(), and impeller::SweepGradientContents::Render().

## ◆ SupportsTextureToTextureBlits()

virtual bool impeller::Capabilities::SupportsTextureToTextureBlits | ( |  | ) | const
| pure virtual

Whether the context backend supports blitting from one texture region to another texture region (via the relevant `BlitPass::AddCopy` overloads).

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

## ◆ SupportsTriangleFan()

virtual bool impeller::Capabilities::SupportsTriangleFan | ( |  | ) | const
| pure virtual

Whether the primitive type TriangleFan is supported by the backend.

Implemented in impeller::StandardCapabilities, impeller::CapabilitiesVK, and impeller::CapabilitiesGLES.

The documentation for this class was generated from the following files:

- impeller/renderer/capabilities.h
- impeller/renderer/capabilities.cc