Flutter Impeller
impeller::CapabilitiesGLES Class Referencefinal

The Vulkan layers and extensions wrangler. More...

#include <capabilities_gles.h>

Inheritance diagram for impeller::CapabilitiesGLES:
impeller::Capabilities impeller::BackendCast< CapabilitiesGLES, Capabilities >

Public Member Functions

 CapabilitiesGLES (const ProcTableGLES &gl)
 
 CapabilitiesGLES (const CapabilitiesGLES &)=delete
 
 CapabilitiesGLES (CapabilitiesGLES &&)=delete
 
CapabilitiesGLESoperator= (const CapabilitiesGLES &)=delete
 
CapabilitiesGLESoperator= (CapabilitiesGLES &&)=delete
 
size_t GetMaxTextureUnits (ShaderStage stage) const
 
bool IsANGLE () 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...
 
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 ()
 

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 CapabilitiesGLESCast (Capabilities &base)
 
static const CapabilitiesGLESCast (const Capabilities &base)
 
static CapabilitiesGLESCast (Capabilities *base)
 
static const CapabilitiesGLESCast (const Capabilities *base)
 
- Protected Member Functions inherited from impeller::Capabilities
 Capabilities ()
 
 Capabilities (const Capabilities &)=delete
 
Capabilitiesoperator= (const Capabilities &)=delete
 

Detailed Description

The Vulkan layers and extensions wrangler.

Definition at line 23 of file capabilities_gles.h.

Constructor & Destructor Documentation

◆ CapabilitiesGLES() [1/3]

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

Definition at line 25 of file capabilities_gles.cc.

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

References impeller::ProcTableGLES::GetDescription(), impeller::kA8UNormInt, impeller::kFramebufferFetchExt, impeller::kMultisampledRenderToTextureExt, impeller::kNvidiaTextureBorderClampExt, impeller::kR8UNormInt, 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
overridevirtual

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

Implements impeller::Capabilities.

Definition at line 188 of file capabilities_gles.cc.

188  {
190 }

References impeller::kR8G8B8A8UNormInt.

◆ GetDefaultDepthStencilFormat()

PixelFormat impeller::CapabilitiesGLES::GetDefaultDepthStencilFormat ( ) const
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 196 of file capabilities_gles.cc.

196  {
198 }

References impeller::kD24UnormS8Uint.

◆ GetDefaultGlyphAtlasFormat()

PixelFormat impeller::CapabilitiesGLES::GetDefaultGlyphAtlasFormat ( ) const
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 204 of file capabilities_gles.cc.

204  {
205  return default_glyph_atlas_format_;
206 }

◆ GetDefaultStencilFormat()

PixelFormat impeller::CapabilitiesGLES::GetDefaultStencilFormat ( ) const
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 192 of file capabilities_gles.cc.

192  {
193  return PixelFormat::kS8UInt;
194 }

References impeller::kS8UInt.

◆ GetMaxTextureUnits()

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

Definition at line 131 of file capabilities_gles.cc.

131  {
132  switch (stage) {
139  return 0u;
140  }
141  FML_UNREACHABLE();
142 }

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

◆ IsANGLE()

bool impeller::CapabilitiesGLES::IsANGLE ( ) const

Definition at line 200 of file capabilities_gles.cc.

200  {
201  return is_angle_;
202 }

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

156  {
157  return false;
158 }

◆ SupportsCompute()

bool impeller::CapabilitiesGLES::SupportsCompute ( ) const
overridevirtual

Whether the context backend supports ComputePass.

Implements impeller::Capabilities.

Definition at line 168 of file capabilities_gles.cc.

168  {
169  return false;
170 }

◆ SupportsComputeSubgroups()

bool impeller::CapabilitiesGLES::SupportsComputeSubgroups ( ) const
overridevirtual

Whether the context backend supports configuring ComputePass command subgroups.

Implements impeller::Capabilities.

Definition at line 172 of file capabilities_gles.cc.

172  {
173  return false;
174 }

◆ SupportsDecalSamplerAddressMode()

bool impeller::CapabilitiesGLES::SupportsDecalSamplerAddressMode ( ) const
overridevirtual

Whether the context backend supports SamplerAddressMode::Decal.

Implements impeller::Capabilities.

Definition at line 180 of file capabilities_gles.cc.

180  {
181  return supports_decal_sampler_address_mode_;
182 }

◆ SupportsDeviceTransientTextures()

bool impeller::CapabilitiesGLES::SupportsDeviceTransientTextures ( ) const
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 184 of file capabilities_gles.cc.

184  {
185  return false;
186 }

◆ SupportsFramebufferFetch()

bool impeller::CapabilitiesGLES::SupportsFramebufferFetch ( ) const
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 164 of file capabilities_gles.cc.

164  {
165  return supports_framebuffer_fetch_;
166 }

◆ SupportsImplicitResolvingMSAA()

bool impeller::CapabilitiesGLES::SupportsImplicitResolvingMSAA ( ) const
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 148 of file capabilities_gles.cc.

148  {
149  return supports_implicit_msaa_;
150 }

◆ SupportsOffscreenMSAA()

bool impeller::CapabilitiesGLES::SupportsOffscreenMSAA ( ) const
overridevirtual

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

Implements impeller::Capabilities.

Definition at line 144 of file capabilities_gles.cc.

144  {
145  return supports_offscreen_msaa_;
146 }

◆ SupportsReadFromResolve()

bool impeller::CapabilitiesGLES::SupportsReadFromResolve ( ) const
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 176 of file capabilities_gles.cc.

176  {
177  return false;
178 }

◆ SupportsSSBO()

bool impeller::CapabilitiesGLES::SupportsSSBO ( ) const
overridevirtual

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

Implements impeller::Capabilities.

Definition at line 152 of file capabilities_gles.cc.

152  {
153  return false;
154 }

◆ SupportsTextureToTextureBlits()

bool impeller::CapabilitiesGLES::SupportsTextureToTextureBlits ( ) const
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 160 of file capabilities_gles.cc.

160  {
161  return false;
162 }

Member Data Documentation

◆ max_combined_texture_image_units

size_t impeller::CapabilitiesGLES::max_combined_texture_image_units = 8

Definition at line 38 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 41 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

◆ max_fragment_uniform_vectors

size_t impeller::CapabilitiesGLES::max_fragment_uniform_vectors = 16

Definition at line 44 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

◆ max_renderbuffer_size

size_t impeller::CapabilitiesGLES::max_renderbuffer_size = 1

Definition at line 47 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

◆ max_texture_image_units

size_t impeller::CapabilitiesGLES::max_texture_image_units = 8

Definition at line 50 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 53 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

◆ max_varying_vectors

size_t impeller::CapabilitiesGLES::max_varying_vectors = 8

Definition at line 56 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

◆ max_vertex_attribs

size_t impeller::CapabilitiesGLES::max_vertex_attribs = 8

Definition at line 59 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 62 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 65 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

◆ max_viewport_dims

ISize impeller::CapabilitiesGLES::max_viewport_dims

Definition at line 68 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

◆ num_compressed_texture_formats

size_t impeller::CapabilitiesGLES::num_compressed_texture_formats = 0

Definition at line 71 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().

◆ num_shader_binary_formats

size_t impeller::CapabilitiesGLES::num_shader_binary_formats = 0

Definition at line 74 of file capabilities_gles.h.

Referenced by CapabilitiesGLES().


The documentation for this class was generated from the following files:
impeller::CapabilitiesGLES::max_vertex_attribs
size_t max_vertex_attribs
Definition: capabilities_gles.h:59
impeller::CapabilitiesGLES::max_viewport_dims
ISize max_viewport_dims
Definition: capabilities_gles.h:68
impeller::PixelFormat::kS8UInt
@ kS8UInt
impeller::kMultisampledRenderToTextureExt
static const constexpr char * kMultisampledRenderToTextureExt
Definition: capabilities_gles.cc:22
impeller::ShaderStage::kUnknown
@ kUnknown
impeller::PixelFormat::kA8UNormInt
@ kA8UNormInt
impeller::PixelFormat::kR8UNormInt
@ kR8UNormInt
impeller::CapabilitiesGLES::max_fragment_uniform_vectors
size_t max_fragment_uniform_vectors
Definition: capabilities_gles.h:44
impeller::PixelFormat::kR8G8B8A8UNormInt
@ kR8G8B8A8UNormInt
impeller::kFramebufferFetchExt
static const constexpr char * kFramebufferFetchExt
Definition: capabilities_gles.cc:13
impeller::CapabilitiesGLES::max_cube_map_texture_size
size_t max_cube_map_texture_size
Definition: capabilities_gles.h:41
impeller::CapabilitiesGLES::max_vertex_uniform_vectors
size_t max_vertex_uniform_vectors
Definition: capabilities_gles.h:65
impeller::CapabilitiesGLES::max_combined_texture_image_units
size_t max_combined_texture_image_units
Definition: capabilities_gles.h:38
impeller::CapabilitiesGLES::max_vertex_texture_image_units
size_t max_vertex_texture_image_units
Definition: capabilities_gles.h:62
impeller::CapabilitiesGLES::max_texture_size
ISize max_texture_size
Definition: capabilities_gles.h:53
impeller::CapabilitiesGLES::max_texture_image_units
size_t max_texture_image_units
Definition: capabilities_gles.h:50
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:18
impeller::CapabilitiesGLES::max_renderbuffer_size
size_t max_renderbuffer_size
Definition: capabilities_gles.h:47
impeller::CapabilitiesGLES::num_shader_binary_formats
size_t num_shader_binary_formats
Definition: capabilities_gles.h:74
impeller::ShaderStage::kVertex
@ kVertex
impeller::ShaderStage::kCompute
@ kCompute
impeller::kTextureBorderClampExt
static const constexpr char * kTextureBorderClampExt
Definition: capabilities_gles.cc:16
impeller::CapabilitiesGLES::num_compressed_texture_formats
size_t num_compressed_texture_formats
Definition: capabilities_gles.h:71
impeller::CapabilitiesGLES::max_varying_vectors
size_t max_varying_vectors
Definition: capabilities_gles.h:56