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
 
CapabilitiesGLES & operator= (const CapabilitiesGLES &)=delete
 
CapabilitiesGLES & operator= (CapabilitiesGLES &&)=delete
 
size_t GetMaxTextureUnits (ShaderStage stage) const
 
bool IsANGLE () const
 
bool IsES () const
 Whether this is an ES GL variant or (if false) desktop GL. More...
 
bool SupportsFramebufferRenderMipmap () const override
 
bool SupportsTextureMaxLevel () const
 Whether GL_TEXTURE_MAX_LEVEL can be set to bound a texture's sampled mip range. Core on desktop GL and ES 3.0+; on ES 2.0 it requires the GL_APPLE_texture_max_level extension. Without it a partial mip chain cannot be made mipmap complete and samples as black. More...
 
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...
 
bool SupportsTriangleFan () const override
 Whether the primitive type TriangleFan is supported by the backend. More...
 
bool SupportsPrimitiveRestart () const override
 Whether primitive restart is supported. More...
 
bool Supports32BitPrimitiveIndices () const override
 Whether 32-bit values are supported in index buffers used to draw primitives. More...
 
bool SupportsManuallyMippedTextures () const override
 Whether a texture whose mip levels were uploaded by hand (rather than produced by BlitPass::GenerateMipmap) samples with correct per-level selection. True everywhere except OpenGL ES 2.0 without GL_APPLE_texture_max_level, where the sampled mip range cannot be bounded to the levels the texture declares. More...
 
bool SupportsExtendedRangeFormats () const override
 Whether the XR formats are supported on this device. More...
 
bool SupportsTextureCompression (CompressedTextureFamily family) const override
 Whether the given family of block-compressed texture formats is supported by this device. Compressed formats are sample-only and their support varies by hardware, so callers must check this before allocating a compressed texture. 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...
 
ISize GetMaximumRenderPassAttachmentSize () const override
 Return the maximum size of a render pass attachment. More...
 
uint32_t GetMaxSamplerAnisotropy () const override
 The maximum anisotropy clamp supported by device samplers. More...
 
size_t GetMinimumUniformAlignment () const override
 The minimum alignment of uniform value offsets in bytes. More...
 
bool NeedsPartitionedHostBuffer () const override
 Whether the host buffer should use separate device buffers for indexes from other data. More...
 
- Public Member Functions inherited from impeller::Capabilities
virtual ~Capabilities ()
 
virtual size_t GetMinimumStorageBufferAlignment () const
 The minimum alignment of storage buffer value offsets in bytes. More...
 

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 23 of file capabilities_gles.h.

Constructor & Destructor Documentation

◆ CapabilitiesGLES() [1/3]

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

Definition at line 64 of file capabilities_gles.cc.

64  {
65  {
66  GLint value = 0;
67  gl.GetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &value);
69  }
70 
71  {
72  GLint value = 0;
73  gl.GetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &value);
75  }
76 
77  auto const desc = gl.GetDescription();
78 
79  if (desc->IsES()) {
80  GLint value = 0;
81  gl.GetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &value);
83  }
84 
85  {
86  GLint value = 0;
87  gl.GetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &value);
89  }
90 
91  {
92  GLint value = 0;
93  gl.GetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &value);
95  }
96 
97  {
98  GLint value = 0;
99  gl.GetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
101  }
102 
103  if (desc->IsES()) {
104  GLint value = 0;
105  gl.GetIntegerv(GL_MAX_VARYING_VECTORS, &value);
107  }
108 
109  {
110  GLint value = 0;
111  gl.GetIntegerv(GL_MAX_VERTEX_ATTRIBS, &value);
113  }
114 
115  {
116  GLint value = 0;
117  gl.GetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &value);
119  }
120 
121  if (desc->IsES()) {
122  GLint value = 0;
123  gl.GetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &value);
125  }
126 
127  {
128  GLint values[2] = {};
129  gl.GetIntegerv(GL_MAX_VIEWPORT_DIMS, values);
130  max_viewport_dims = ISize{values[0], values[1]};
131  }
132 
133  {
134  GLint value = 0;
135  gl.GetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &value);
137  }
138 
139  if (desc->IsES()) {
140  GLint value = 0;
141  gl.GetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &value);
143  }
144 
145  if (desc->IsES()) {
146  default_glyph_atlas_format_ = PixelFormat::kA8UNormInt;
147  } else {
148  default_glyph_atlas_format_ = PixelFormat::kR8UNormInt;
149  }
150 
151  if (desc->GetGlVersion().major_version >= 3) {
152  supports_texture_to_texture_blits_ = true;
153  }
154 
155  supports_framebuffer_fetch_ = desc->HasExtension(kFramebufferFetchExt);
156 
157  if (desc->HasExtension(kTextureBorderClampExt) ||
158  desc->HasExtension(kNvidiaTextureBorderClampExt)) {
159  supports_decal_sampler_address_mode_ = true;
160  }
161 
162  if (desc->HasExtension(kElementIndexUintExt)) {
163  supports_32bit_primitive_indices_ = true;
164  }
165 
166  if (desc->HasExtension(kMultisampledRenderToTextureExt)) {
167  supports_implicit_msaa_ = true;
168 
169  if (desc->HasExtension(kMultisampledRenderToTexture2Ext)) {
170  // We hard-code 4x MSAA, so let's make sure it's supported.
171  GLint value = 0;
172  gl.GetIntegerv(GL_MAX_SAMPLES_EXT, &value);
173  supports_offscreen_msaa_ = value >= 4;
174  }
175  } else if (desc->GetGlVersion().major_version >= 3 && desc->IsES()) {
176  GLint value = 0;
177  gl.GetIntegerv(GL_MAX_SAMPLES, &value);
178  supports_offscreen_msaa_ = value >= 4;
179  }
180  is_es_ = desc->IsES();
181  is_angle_ = desc->IsANGLE();
182 
183  // ETC2 and EAC are mandatory in OpenGL ES 3.0. BC and ASTC are gated behind
184  // extensions and are not present on most mobile or desktop GLES. The whole BC
185  // family requires S3TC, RGTC, and BPTC to all be present.
186  supports_texture_compression_bc_ =
187  desc->HasExtension(kTextureCompressionS3TCExt) &&
188  desc->HasExtension(kTextureCompressionRGTCExt) &&
189  desc->HasExtension(kTextureCompressionBPTCExt);
190  // Either extension is sufficient: both expose the same LDR 2D ASTC internal
191  // formats this backend uses. KHR is the common one; OES is a superset that
192  // also adds HDR and 3D, which are not used here.
193  supports_texture_compression_astc_ =
194  desc->HasExtension(kTextureCompressionAstcLdrExt) ||
195  desc->HasExtension(kTextureCompressionAstcOesExt);
196  // HDR reuses the same internal formats as LDR, gated by a separate extension.
197  // The OES extension is a superset that also covers HDR.
198  supports_texture_compression_astc_hdr_ =
199  desc->HasExtension(kTextureCompressionAstcHdrExt) ||
200  desc->HasExtension(kTextureCompressionAstcOesExt);
201  supports_texture_compression_etc2_ =
202  desc->IsES() && desc->GetGlVersion().major_version >= 3;
203 
204  // GL_TEXTURE_MAX_LEVEL is core on desktop GL and ES 3.0+, and available on
205  // ES 2.0 through GL_APPLE_texture_max_level.
206  supports_texture_max_level_ = !desc->IsES() ||
207  desc->GetGlVersion().major_version >= 3 ||
208  desc->HasExtension(kAppleTextureMaxLevelExt);
209 
210  // Anisotropic filtering is not part of any core GL or GLES version; it is
211  // always gated on GL_EXT_texture_filter_anisotropic. The query and the
212  // texture parameter are applied with core ES 2.0 entry points (GetFloatv
213  // and TexParameterfv), so only the extension check is needed here.
214  if (desc->HasExtension(kTextureFilterAnisotropicExt)) {
215  GLfloat value = 1.0f;
217  // The extension guarantees a maximum of at least 2. The limit is a float
218  // but is always an integer in practice, so floor it.
219  max_sampler_anisotropy_ = static_cast<uint32_t>(std::max(value, 2.0f));
220  }
221 }
int32_t value
static constexpr const char * kTextureBorderClampExt
static constexpr const char * kTextureCompressionAstcLdrExt
static constexpr const char * kMultisampledRenderToTexture2Ext
static constexpr const char * kTextureCompressionBPTCExt
static constexpr const char * kNvidiaTextureBorderClampExt
static constexpr const char * kTextureFilterAnisotropicExt
static constexpr const char * kAppleTextureMaxLevelExt
static constexpr const char * kFramebufferFetchExt
static constexpr const char * kTextureCompressionAstcOesExt
static constexpr const char * kTextureCompressionRGTCExt
static constexpr const char * kElementIndexUintExt
ISize64 ISize
Definition: size.h:162
static constexpr const char * kMultisampledRenderToTextureExt
static constexpr const char * kTextureCompressionS3TCExt
static constexpr const char * kTextureCompressionAstcHdrExt
#define IMPELLER_GL_MAX_TEXTURE_MAX_ANISOTROPY
Definition: gles.h:17

References impeller::ProcTableGLES::GetDescription(), IMPELLER_GL_MAX_TEXTURE_MAX_ANISOTROPY, impeller::kA8UNormInt, impeller::kAppleTextureMaxLevelExt, impeller::kElementIndexUintExt, impeller::kFramebufferFetchExt, impeller::kMultisampledRenderToTexture2Ext, impeller::kMultisampledRenderToTextureExt, impeller::kNvidiaTextureBorderClampExt, impeller::kR8UNormInt, impeller::kTextureBorderClampExt, impeller::kTextureCompressionAstcHdrExt, impeller::kTextureCompressionAstcLdrExt, impeller::kTextureCompressionAstcOesExt, impeller::kTextureCompressionBPTCExt, impeller::kTextureCompressionRGTCExt, impeller::kTextureCompressionS3TCExt, impeller::kTextureFilterAnisotropicExt, 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, num_shader_binary_formats, and value.

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

298  {
300 }

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

306  {
308 }

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

348  {
349  return default_glyph_atlas_format_;
350 }

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

302  {
303  return PixelFormat::kS8UInt;
304 }

References impeller::kS8UInt.

◆ GetMaximumRenderPassAttachmentSize()

ISize impeller::CapabilitiesGLES::GetMaximumRenderPassAttachmentSize ( ) const
overridevirtual

Return the maximum size of a render pass attachment.

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

Implements impeller::Capabilities.

Definition at line 352 of file capabilities_gles.cc.

352  {
353  return max_texture_size;
354 }

References max_texture_size.

◆ GetMaxSamplerAnisotropy()

uint32_t impeller::CapabilitiesGLES::GetMaxSamplerAnisotropy ( ) const
overridevirtual

The maximum anisotropy clamp supported by device samplers.

   A value of 1 means anisotropic filtering is not supported.
   Sampler descriptors with `max_anisotropy` greater than this value
   are clamped to it. 

Implements impeller::Capabilities.

Definition at line 356 of file capabilities_gles.cc.

356  {
357  return max_sampler_anisotropy_;
358 }

◆ GetMaxTextureUnits()

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

◆ GetMinimumUniformAlignment()

size_t impeller::CapabilitiesGLES::GetMinimumUniformAlignment ( ) const
overridevirtual

The minimum alignment of uniform value offsets in bytes.

Implements impeller::Capabilities.

Definition at line 360 of file capabilities_gles.cc.

360  {
361  return 256;
362 }

◆ IsANGLE()

bool impeller::CapabilitiesGLES::IsANGLE ( ) const

Definition at line 310 of file capabilities_gles.cc.

310  {
311  return is_angle_;
312 }

◆ IsES()

bool impeller::CapabilitiesGLES::IsES ( ) const

Whether this is an ES GL variant or (if false) desktop GL.

Definition at line 223 of file capabilities_gles.cc.

223  {
224  return is_es_;
225 }

◆ NeedsPartitionedHostBuffer()

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

Whether the host buffer should use separate device buffers for indexes from other data.

Implements impeller::Capabilities.

Definition at line 364 of file capabilities_gles.cc.

364  {
365 #ifdef FML_OS_EMSCRIPTEN
366  // WebGL has special requirements here to keep indexes and other data
367  // separate. See
368  // https://registry.khronos.org/webgl/specs/latest/2.0/#BUFFER_OBJECT_BINDING
369  return true;
370 #else
371  return false;
372 #endif
373 }

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ Supports32BitPrimitiveIndices()

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

Whether 32-bit values are supported in index buffers used to draw primitives.

Implements impeller::Capabilities.

Definition at line 318 of file capabilities_gles.cc.

318  {
319  return supports_32bit_primitive_indices_;
320 }

◆ SupportsCompute()

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

Whether the context backend supports ComputePass.

Implements impeller::Capabilities.

Definition at line 274 of file capabilities_gles.cc.

274  {
275  return false;
276 }

◆ SupportsComputeSubgroups()

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

Whether the context backend supports configuring ComputePass command subgroups.

Implements impeller::Capabilities.

Definition at line 278 of file capabilities_gles.cc.

278  {
279  return false;
280 }

◆ SupportsDecalSamplerAddressMode()

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

Whether the context backend supports SamplerAddressMode::Decal.

Implements impeller::Capabilities.

Definition at line 286 of file capabilities_gles.cc.

286  {
287  return supports_decal_sampler_address_mode_;
288 }

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

290  {
291  return false;
292 }

◆ SupportsExtendedRangeFormats()

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

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.

Implements impeller::Capabilities.

Definition at line 329 of file capabilities_gles.cc.

329  {
330  return false;
331 }

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

270  {
271  return supports_framebuffer_fetch_;
272 }

◆ SupportsFramebufferRenderMipmap()

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

Always false. Rendering into a non-zero mip level is not yet implemented on the GLES backend; see SupportsFramebufferRenderMipmap in the .cc file.

Implements impeller::Capabilities.

Definition at line 227 of file capabilities_gles.cc.

227  {
228  // Rendering into a non-zero mip level is not yet supported on the GLES
229  // backend. The texture storage path allocates levels with mutable, lazily
230  // allocated glTexImage2D storage, which yields an incomplete framebuffer
231  // when a non-base mip level is attached. Until that is reworked, do not
232  // advertise the capability so callers fall back instead of failing to
233  // create the framebuffer. Rendering into a cube map face is unaffected.
234  return false;
235 }

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

258  {
259  return supports_implicit_msaa_;
260 }

◆ SupportsManuallyMippedTextures()

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

Whether a texture whose mip levels were uploaded by hand (rather than produced by BlitPass::GenerateMipmap) samples with correct per-level selection. True everywhere except OpenGL ES 2.0 without GL_APPLE_texture_max_level, where the sampled mip range cannot be bounded to the levels the texture declares.

Implements impeller::Capabilities.

Definition at line 322 of file capabilities_gles.cc.

322  {
323  // Without GL_TEXTURE_MAX_LEVEL the sampled mip range cannot be bounded to
324  // the levels the texture declares, so a hand-uploaded chain is mipmap
325  // incomplete and samples as black.
326  return supports_texture_max_level_;
327 }

◆ SupportsOffscreenMSAA()

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

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

Implements impeller::Capabilities.

Definition at line 254 of file capabilities_gles.cc.

254  {
255  return supports_offscreen_msaa_;
256 }

◆ SupportsPrimitiveRestart()

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

Whether primitive restart is supported.

Implements impeller::Capabilities.

Definition at line 314 of file capabilities_gles.cc.

314  {
315  return false;
316 }

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

282  {
283  return false;
284 }

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

262  {
263  return false;
264 }

◆ SupportsTextureCompression()

bool impeller::CapabilitiesGLES::SupportsTextureCompression ( CompressedTextureFamily  family) const
overridevirtual

Whether the given family of block-compressed texture formats is supported by this device. Compressed formats are sample-only and their support varies by hardware, so callers must check this before allocating a compressed texture.

Implements impeller::Capabilities.

Definition at line 333 of file capabilities_gles.cc.

334  {
335  switch (family) {
337  return supports_texture_compression_bc_;
339  return supports_texture_compression_etc2_;
341  return supports_texture_compression_astc_;
343  return supports_texture_compression_astc_hdr_;
344  }
345  return false;
346 }
@ kASTCHDR
ASTC HDR. A separate device feature from ASTC LDR.
@ kBC
S3TC, RGTC, and BPTC (BC1 through BC7). Desktop GPUs.
@ kETC2
ETC2 and EAC. Mobile, OpenGL ES 3.0, and WebGL2.
@ kASTC
ASTC LDR. Modern mobile and some desktop.

References impeller::kASTC, impeller::kASTCHDR, impeller::kBC, and impeller::kETC2.

◆ SupportsTextureMaxLevel()

bool impeller::CapabilitiesGLES::SupportsTextureMaxLevel ( ) const

Whether GL_TEXTURE_MAX_LEVEL can be set to bound a texture's sampled mip range. Core on desktop GL and ES 3.0+; on ES 2.0 it requires the GL_APPLE_texture_max_level extension. Without it a partial mip chain cannot be made mipmap complete and samples as black.

Definition at line 237 of file capabilities_gles.cc.

237  {
238  return supports_texture_max_level_;
239 }

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

266  {
267  return supports_texture_to_texture_blits_;
268 }

◆ SupportsTriangleFan()

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

Whether the primitive type TriangleFan is supported by the backend.

Implements impeller::Capabilities.

Definition at line 294 of file capabilities_gles.cc.

294  {
295  return true;
296 }

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(), and GetMaximumRenderPassAttachmentSize().

◆ 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: