| Flutter Impeller |

Public Member Functions | Public Attributes | List of all members
impeller::CapabilitiesGLES Class Referencefinal

The Vulkan layers and extensions wrangler. More...

`#include <capabilities_gles.h>`

Inheritance diagram for impeller::CapabilitiesGLES:

## Public Member Functions
| CapabilitiesGLES (const ProcTableGLES &gl)
| CapabilitiesGLES (const CapabilitiesGLES &)=delete
| CapabilitiesGLES (CapabilitiesGLES &&)=delete
CapabilitiesGLES & | operator= (const CapabilitiesGLES &)=delete
CapabilitiesGLES & | operator= (CapabilitiesGLES &&)=delete
size_t | GetMaxTextureUnits (ShaderStage stage) 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 | SupportsBufferToTextureBlits () const override
| Whether the context backend supports blitting from a given `DeviceBuffer` view to a texture region (via the relevant `BlitPass::AddCopy` overloads). 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...
Public Member Functions inherited from impeller::Capabilities
virtual | ~Capabilities ()

## Public Attributes
size_t | max_combined_texture_image_units = 8
size_t | max_cube_map_texture_size = 16
size_t | max_fragment_uniform_vectors = 16
size_t | max_renderbuffer_size = 1
size_t | max_texture_image_units = 8
ISize | max_texture_size = ISize{64, 64}
size_t | max_varying_vectors = 8
size_t | max_vertex_attribs = 8
size_t | max_vertex_texture_image_units = 0
size_t | max_vertex_uniform_vectors = 128
ISize | max_viewport_dims
size_t | num_compressed_texture_formats = 0
size_t | num_shader_binary_formats = 0

## Additional Inherited Members
Static Public Member Functions inherited from impeller::BackendCast< CapabilitiesGLES, Capabilities >
static CapabilitiesGLES & | Cast (Capabilities &base)
static const CapabilitiesGLES & | Cast (const Capabilities &base)
static CapabilitiesGLES * | Cast (Capabilities *base)
static const CapabilitiesGLES * | Cast (const Capabilities *base)
Protected Member Functions inherited from impeller::Capabilities
| Capabilities ()
| Capabilities (const Capabilities &)=delete
Capabilities & | operator= (const Capabilities &)=delete

## Detailed Description

The Vulkan layers and extensions wrangler.

Definition at line 22 of file capabilities_gles.h.

## Constructor & Destructor Documentation

## ◆ CapabilitiesGLES() [1/3]

impeller::CapabilitiesGLES::CapabilitiesGLES | ( | const ProcTableGLES & | gl | ) |
| explicit

Definition at line 24 of file capabilities_gles.cc.

24 {
25 {
26 GLint value = 0;
27 gl.GetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &value);
28 max_combined_texture_image_units = value;
29 }
30
31 {
32 GLint value = 0;
33 gl.GetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &value);
34 max_cube_map_texture_size = value;
35 }
36
37 auto const desc = gl.GetDescription();
38
39 if (desc->IsES()) {
40 GLint value = 0;
41 gl.GetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &value);
42 max_fragment_uniform_vectors = value;
43 }
44
45 {
46 GLint value = 0;
47 gl.GetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &value);
48 max_renderbuffer_size = value;
49 }
50
51 {
52 GLint value = 0;
53 gl.GetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &value);
54 max_texture_image_units = value;
55 }
56
57 {
58 GLint value = 0;
59 gl.GetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
60 max_texture_size = ISize{value, value};
61 }
62
63 if (desc->IsES()) {
64 GLint value = 0;
65 gl.GetIntegerv(GL_MAX_VARYING_VECTORS, &value);
66 max_varying_vectors = value;
67 }
68
69 {
70 GLint value = 0;
71 gl.GetIntegerv(GL_MAX_VERTEX_ATTRIBS, &value);
72 max_vertex_attribs = value;
73 }
74
75 {
76 GLint value = 0;
77 gl.GetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &value);
78 max_vertex_texture_image_units = value;
79 }
80
81 if (desc->IsES()) {
82 GLint value = 0;
83 gl.GetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &value);
84 max_vertex_uniform_vectors = value;
85 }
86
87 {
88 GLint values[2] = {};
89 gl.GetIntegerv(GL_MAX_VIEWPORT_DIMS, values);
90 max_viewport_dims = ISize{values[0], values[1]};
91 }
92
93 {
94 GLint value = 0;
95 gl.GetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &value);
96 num_compressed_texture_formats = value;
97 }
98
99 if (desc->IsES()) {
100 GLint value = 0;
101 gl.GetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &value);
102 num_shader_binary_formats = value;
103 }
104
105 supports_framebuffer_fetch_ = desc->HasExtension(kFramebufferFetchExt);
106
107 if (desc->HasExtension(kTextureBorderClampExt) ||
108 desc->HasExtension(kNvidiaTextureBorderClampExt)) {
109 supports_decal_sampler_address_mode_ = true;
110 }
111
112 if (desc->HasExtension(kMultisampledRenderToTextureExt)) {
113 supports_implicit_msaa_ = true;
114
115 // We hard-code 4x MSAA, so let's make sure it's supported.
116 GLint value = 0;
117 gl.GetIntegerv(GL_MAX_SAMPLES_EXT, &value);
118 supports_offscreen_msaa_ = value >= 4;
119 }
120 }

References impeller::ProcTableGLES::GetDescription(), impeller::kFramebufferFetchExt, impeller::kMultisampledRenderToTextureExt, impeller::kNvidiaTextureBorderClampExt, impeller::kTextureBorderClampExt, max_combined_texture_image_units, max_cube_map_texture_size, max_fragment_uniform_vectors, max_renderbuffer_size, max_texture_image_units, max_texture_size, max_varying_vectors, max_vertex_attribs, max_vertex_texture_image_units, max_vertex_uniform_vectors, max_viewport_dims, num_compressed_texture_formats, and num_shader_binary_formats.

## ◆ CapabilitiesGLES() [2/3]

impeller::CapabilitiesGLES::CapabilitiesGLES | ( | const CapabilitiesGLES & |  | ) |
| delete

## ◆ CapabilitiesGLES() [3/3]

impeller::CapabilitiesGLES::CapabilitiesGLES | ( | CapabilitiesGLES && |  | ) |
| delete

## Member Function Documentation

## ◆ GetDefaultColorFormat()

PixelFormat impeller::CapabilitiesGLES::GetDefaultColorFormat | ( |  | ) | const
| override virtual

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

Implements impeller::Capabilities.

Definition at line 179 of file capabilities_gles.cc.

179 {
180 return PixelFormat::kR8G8B8A8UNormInt;
181 }

References impeller::kR8G8B8A8UNormInt.

## ◆ GetDefaultDepthStencilFormat()

PixelFormat impeller::CapabilitiesGLES::GetDefaultDepthStencilFormat | ( |  | ) | const
| override 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.

Implements impeller::Capabilities.

Definition at line 187 of file capabilities_gles.cc.

187 {
188 return PixelFormat::kD24UnormS8Uint;
189 }

References impeller::kD24UnormS8Uint.

## ◆ GetDefaultStencilFormat()

PixelFormat impeller::CapabilitiesGLES::GetDefaultStencilFormat | ( |  | ) | const
| override virtual

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 183 of file capabilities_gles.cc.

183 {
184 return PixelFormat::kS8UInt;
185 }

References impeller::kS8UInt.

## ◆ GetMaxTextureUnits()

size_t impeller::CapabilitiesGLES::GetMaxTextureUnits | ( | ShaderStage | stage | ) | const

Definition at line 122 of file capabilities_gles.cc.

122 {
123 switch (stage) {
124 case ShaderStage::kVertex:
125 return max_vertex_texture_image_units;
126 case ShaderStage::kFragment:
127 return max_texture_image_units;
128 case ShaderStage::kUnknown:
129 case ShaderStage::kCompute:
130 return 0u;
131 }
132 FML_UNREACHABLE();
133 }

References impeller::kCompute, impeller::kFragment, impeller::kUnknown, impeller::kVertex, max_texture_image_units, and max_vertex_texture_image_units.

## ◆ operator=() [1/2]

CapabilitiesGLES& impeller::CapabilitiesGLES::operator= | ( | CapabilitiesGLES && |  | ) |
| delete

## ◆ operator=() [2/2]

CapabilitiesGLES& impeller::CapabilitiesGLES::operator= | ( | const CapabilitiesGLES & |  | ) |
| delete

## ◆ SupportsBufferToTextureBlits()

bool impeller::CapabilitiesGLES::SupportsBufferToTextureBlits | ( |  | ) | const
| override virtual

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 147 of file capabilities_gles.cc.

147 {
148 return false;
149 }

## ◆ SupportsCompute()

bool impeller::CapabilitiesGLES::SupportsCompute | ( |  | ) | const
| override virtual

Whether the context backend supports `ComputePass`.

Implements impeller::Capabilities.

Definition at line 159 of file capabilities_gles.cc.

159 {
160 return false;
161 }

## ◆ SupportsComputeSubgroups()

bool impeller::CapabilitiesGLES::SupportsComputeSubgroups | ( |  | ) | const
| override virtual

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

Implements impeller::Capabilities.

Definition at line 163 of file capabilities_gles.cc.

163 {
164 return false;
165 }

## ◆ SupportsDecalSamplerAddressMode()

bool impeller::CapabilitiesGLES::SupportsDecalSamplerAddressMode | ( |  | ) | const
| override virtual

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

Implements impeller::Capabilities.

Definition at line 171 of file capabilities_gles.cc.

171 {
172 return supports_decal_sampler_address_mode_;
173 }

## ◆ SupportsDeviceTransientTextures()

bool impeller::CapabilitiesGLES::SupportsDeviceTransientTextures | ( |  | ) | const
| override 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.

Implements impeller::Capabilities.

Definition at line 175 of file capabilities_gles.cc.

175 {
176 return false;
177 }

## ◆ SupportsFramebufferFetch()

bool impeller::CapabilitiesGLES::SupportsFramebufferFetch | ( |  | ) | const
| override 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); } ```

Implements impeller::Capabilities.

Definition at line 155 of file capabilities_gles.cc.

155 {
156 return supports_framebuffer_fetch_;
157 }

## ◆ SupportsImplicitResolvingMSAA()

bool impeller::CapabilitiesGLES::SupportsImplicitResolvingMSAA | ( |  | ) | const
| override virtual

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 139 of file capabilities_gles.cc.

139 {
140 return supports_implicit_msaa_;
141 }

## ◆ SupportsOffscreenMSAA()

bool impeller::CapabilitiesGLES::SupportsOffscreenMSAA | ( |  | ) | const
| override virtual

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

Implements impeller::Capabilities.

Definition at line 135 of file capabilities_gles.cc.

135 {
136 return supports_offscreen_msaa_;
137 }

## ◆ SupportsReadFromResolve()

bool impeller::CapabilitiesGLES::SupportsReadFromResolve | ( |  | ) | const
| override 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`.

Implements impeller::Capabilities.

Definition at line 167 of file capabilities_gles.cc.

167 {
168 return false;
169 }

## ◆ SupportsSSBO()

bool impeller::CapabilitiesGLES::SupportsSSBO | ( |  | ) | const
| override virtual

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

Implements impeller::Capabilities.

Definition at line 143 of file capabilities_gles.cc.

143 {
144 return false;
145 }

## ◆ SupportsTextureToTextureBlits()

bool impeller::CapabilitiesGLES::SupportsTextureToTextureBlits | ( |  | ) | const
| override virtual

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 151 of file capabilities_gles.cc.

151 {
152 return false;
153 }

## Member Data Documentation

## ◆ max_combined_texture_image_units

size_t impeller::CapabilitiesGLES::max_combined_texture_image_units = 8

Definition at line 37 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

## ◆ max_cube_map_texture_size

size_t impeller::CapabilitiesGLES::max_cube_map_texture_size = 16

Definition at line 40 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

## ◆ max_fragment_uniform_vectors

size_t impeller::CapabilitiesGLES::max_fragment_uniform_vectors = 16

Definition at line 43 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

## ◆ max_renderbuffer_size

size_t impeller::CapabilitiesGLES::max_renderbuffer_size = 1

Definition at line 46 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

## ◆ max_texture_image_units

size_t impeller::CapabilitiesGLES::max_texture_image_units = 8

Definition at line 49 of file capabilities_gles.h.

Referenced by CapabilitiesGLES(), and GetMaxTextureUnits().

## ◆ max_texture_size

ISize impeller::CapabilitiesGLES::max_texture_size = ISize{64, 64}

Definition at line 52 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

## ◆ max_varying_vectors

size_t impeller::CapabilitiesGLES::max_varying_vectors = 8

Definition at line 55 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

## ◆ max_vertex_attribs

size_t impeller::CapabilitiesGLES::max_vertex_attribs = 8

Definition at line 58 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

## ◆ max_vertex_texture_image_units

size_t impeller::CapabilitiesGLES::max_vertex_texture_image_units = 0

Definition at line 61 of file capabilities_gles.h.

Referenced by CapabilitiesGLES(), and GetMaxTextureUnits().

## ◆ max_vertex_uniform_vectors

size_t impeller::CapabilitiesGLES::max_vertex_uniform_vectors = 128

Definition at line 64 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

## ◆ max_viewport_dims

ISize impeller::CapabilitiesGLES::max_viewport_dims

Definition at line 67 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

## ◆ num_compressed_texture_formats

size_t impeller::CapabilitiesGLES::num_compressed_texture_formats = 0

Definition at line 70 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

## ◆ num_shader_binary_formats

size_t impeller::CapabilitiesGLES::num_shader_binary_formats = 0

Definition at line 73 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

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

- impeller/renderer/backend/gles/capabilities_gles.h
- impeller/renderer/backend/gles/capabilities_gles.cc

impeller::CapabilitiesGLES::max_vertex_attribs
size_t max_vertex_attribs
Definition: capabilities_gles.h:58
impeller::CapabilitiesGLES::max_viewport_dims
ISize max_viewport_dims
Definition: capabilities_gles.h:67
impeller::PixelFormat::kS8UInt
@ kS8UInt
impeller::kMultisampledRenderToTextureExt
static const constexpr char * kMultisampledRenderToTextureExt
Definition: capabilities_gles.cc:21
impeller::ShaderStage::kUnknown
@ kUnknown
impeller::CapabilitiesGLES::max_fragment_uniform_vectors
size_t max_fragment_uniform_vectors
Definition: capabilities_gles.h:43
impeller::PixelFormat::kR8G8B8A8UNormInt
@ kR8G8B8A8UNormInt
impeller::kFramebufferFetchExt
static const constexpr char * kFramebufferFetchExt
Definition: capabilities_gles.cc:12
impeller::CapabilitiesGLES::max_cube_map_texture_size
size_t max_cube_map_texture_size
Definition: capabilities_gles.h:40
impeller::CapabilitiesGLES::max_vertex_uniform_vectors
size_t max_vertex_uniform_vectors
Definition: capabilities_gles.h:64
impeller::CapabilitiesGLES::max_combined_texture_image_units
size_t max_combined_texture_image_units
Definition: capabilities_gles.h:37
impeller::CapabilitiesGLES::max_vertex_texture_image_units
size_t max_vertex_texture_image_units
Definition: capabilities_gles.h:61
impeller::CapabilitiesGLES::max_texture_size
ISize max_texture_size
Definition: capabilities_gles.h:52
impeller::CapabilitiesGLES::max_texture_image_units
size_t max_texture_image_units
Definition: capabilities_gles.h:49
impeller::PixelFormat::kD24UnormS8Uint
@ kD24UnormS8Uint
impeller::ShaderStage::kFragment
@ kFragment
impeller::ISize
TSize< int64_t > ISize
Definition: size.h:138
impeller::kNvidiaTextureBorderClampExt
static const constexpr char * kNvidiaTextureBorderClampExt
Definition: capabilities_gles.cc:17
impeller::CapabilitiesGLES::max_renderbuffer_size
size_t max_renderbuffer_size
Definition: capabilities_gles.h:46
impeller::CapabilitiesGLES::num_shader_binary_formats
size_t num_shader_binary_formats
Definition: capabilities_gles.h:73
impeller::ShaderStage::kVertex
@ kVertex
impeller::ShaderStage::kCompute
@ kCompute
impeller::kTextureBorderClampExt
static const constexpr char * kTextureBorderClampExt
Definition: capabilities_gles.cc:15
impeller::CapabilitiesGLES::num_compressed_texture_formats
size_t num_compressed_texture_formats
Definition: capabilities_gles.h:70
impeller::CapabilitiesGLES::max_varying_vectors
size_t max_varying_vectors
Definition: capabilities_gles.h:55