16 "GL_EXT_shader_framebuffer_fetch";
19 "GL_EXT_texture_border_clamp";
21 "GL_NV_texture_border_clamp";
25 "GL_EXT_multisampled_render_to_texture";
29 "GL_EXT_multisampled_render_to_texture2";
38 "GL_EXT_texture_compression_s3tc";
41 "GL_EXT_texture_compression_rgtc";
44 "GL_EXT_texture_compression_bptc";
48 "GL_KHR_texture_compression_astc_ldr";
51 "GL_OES_texture_compression_astc";
54 "GL_KHR_texture_compression_astc_hdr";
58 "GL_APPLE_texture_max_level";
62 "GL_EXT_texture_filter_anisotropic";
67 gl.GetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &
value);
73 gl.GetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &
value);
81 gl.GetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &
value);
87 gl.GetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &
value);
93 gl.GetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &
value);
99 gl.GetIntegerv(GL_MAX_TEXTURE_SIZE, &
value);
105 gl.GetIntegerv(GL_MAX_VARYING_VECTORS, &
value);
111 gl.GetIntegerv(GL_MAX_VERTEX_ATTRIBS, &
value);
117 gl.GetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &
value);
123 gl.GetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &
value);
128 GLint values[2] = {};
129 gl.GetIntegerv(GL_MAX_VIEWPORT_DIMS, values);
135 gl.GetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &
value);
141 gl.GetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &
value);
151 if (desc->GetGlVersion().major_version >= 3) {
152 supports_texture_to_texture_blits_ =
true;
159 supports_decal_sampler_address_mode_ =
true;
163 supports_32bit_primitive_indices_ =
true;
167 supports_implicit_msaa_ =
true;
172 gl.GetIntegerv(GL_MAX_SAMPLES_EXT, &
value);
173 supports_offscreen_msaa_ =
value >= 4;
175 }
else if (desc->GetGlVersion().major_version >= 3 && desc->IsES()) {
177 gl.GetIntegerv(GL_MAX_SAMPLES, &
value);
178 supports_offscreen_msaa_ =
value >= 4;
180 is_es_ = desc->IsES();
181 is_angle_ = desc->IsANGLE();
186 supports_texture_compression_bc_ =
193 supports_texture_compression_astc_ =
198 supports_texture_compression_astc_hdr_ =
201 supports_texture_compression_etc2_ =
202 desc->IsES() && desc->GetGlVersion().major_version >= 3;
206 supports_texture_max_level_ = !desc->IsES() ||
207 desc->GetGlVersion().major_version >= 3 ||
215 GLfloat
value = 1.0f;
219 max_sampler_anisotropy_ =
static_cast<uint32_t
>(std::max(
value, 2.0f));
238 return supports_texture_max_level_;
255 return supports_offscreen_msaa_;
259 return supports_implicit_msaa_;
267 return supports_texture_to_texture_blits_;
271 return supports_framebuffer_fetch_;
287 return supports_decal_sampler_address_mode_;
319 return supports_32bit_primitive_indices_;
326 return supports_texture_max_level_;
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_;
349 return default_glyph_atlas_format_;
357 return max_sampler_anisotropy_;
365#ifdef FML_OS_EMSCRIPTEN
bool IsES() const
Whether this is an ES GL variant or (if false) desktop GL.
bool SupportsImplicitResolvingMSAA() const override
Whether the context backend supports multisampled rendering to the on-screen surface without requirin...
PixelFormat GetDefaultDepthStencilFormat() const override
Returns a supported PixelFormat for textures that store both a stencil and depth component....
size_t max_vertex_uniform_vectors
PixelFormat GetDefaultColorFormat() const override
Returns a supported PixelFormat for textures that store 4-channel colors (red/green/blue/alpha).
bool SupportsSSBO() const override
Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines.
size_t max_fragment_uniform_vectors
bool SupportsTextureToTextureBlits() const override
Whether the context backend supports blitting from one texture region to another texture region (via ...
ISize GetMaximumRenderPassAttachmentSize() const override
Return the maximum size of a render pass attachment.
bool SupportsFramebufferRenderMipmap() const override
CapabilitiesGLES(const ProcTableGLES &gl)
size_t max_renderbuffer_size
bool SupportsPrimitiveRestart() const override
Whether primitive restart is supported.
size_t GetMaxTextureUnits(ShaderStage stage) const
bool NeedsPartitionedHostBuffer() const override
Whether the host buffer should use separate device buffers for indexes from other data.
size_t max_cube_map_texture_size
size_t max_vertex_texture_image_units
bool SupportsTriangleFan() const override
Whether the primitive type TriangleFan is supported by the backend.
size_t num_shader_binary_formats
bool Supports32BitPrimitiveIndices() const override
Whether 32-bit values are supported in index buffers used to draw primitives.
size_t max_combined_texture_image_units
uint32_t GetMaxSamplerAnisotropy() const override
The maximum anisotropy clamp supported by device samplers.
bool SupportsTextureCompression(CompressedTextureFamily family) const override
Whether the given family of block-compressed texture formats is supported by this device....
bool SupportsTextureMaxLevel() const
Whether GL_TEXTURE_MAX_LEVEL can be set to bound a texture's sampled mip range. Core on desktop GL an...
bool SupportsOffscreenMSAA() const override
Whether the context backend supports attaching offscreen MSAA color/stencil textures.
size_t GetMinimumUniformAlignment() const override
The minimum alignment of uniform value offsets in bytes.
PixelFormat GetDefaultStencilFormat() const override
Returns a supported PixelFormat for textures that store stencil information. May include a depth chan...
bool SupportsReadFromResolve() const override
Whether the context backend supports binding the current RenderPass attachments. This is supported if...
bool SupportsDeviceTransientTextures() const override
Whether the context backend supports allocating StorageMode::kDeviceTransient (aka "memoryless") text...
bool SupportsDecalSamplerAddressMode() const override
Whether the context backend supports SamplerAddressMode::Decal.
size_t max_texture_image_units
PixelFormat GetDefaultGlyphAtlasFormat() const override
Returns the default pixel format for the alpha bitmap glyph atlas.
size_t max_vertex_attribs
bool SupportsExtendedRangeFormats() const override
Whether the XR formats are supported on this device.
bool SupportsCompute() const override
Whether the context backend supports ComputePass.
bool SupportsManuallyMippedTextures() const override
Whether a texture whose mip levels were uploaded by hand (rather than produced by BlitPass::GenerateM...
size_t max_varying_vectors
bool SupportsComputeSubgroups() const override
Whether the context backend supports configuring ComputePass command subgroups.
size_t num_compressed_texture_formats
bool SupportsFramebufferFetch() const override
Whether the context backend is able to support pipelines with shaders that read from the framebuffer ...
const DescriptionGLES * GetDescription() const
#define FML_UNREACHABLE()
static const constexpr char * kTextureCompressionAstcOesExt
static const constexpr char * kMultisampledRenderToTexture2Ext
static const constexpr char * kTextureFilterAnisotropicExt
static const constexpr char * kTextureCompressionAstcHdrExt
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
static const constexpr char * kMultisampledRenderToTextureExt
static const constexpr char * kTextureCompressionBPTCExt
static const constexpr char * kTextureCompressionAstcLdrExt
CompressedTextureFamily
The family of a block-compressed pixel format. GPUs support compressed formats on a per-family basis,...
@ 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.
static const constexpr char * kTextureCompressionRGTCExt
static const constexpr char * kTextureCompressionS3TCExt
static const constexpr char * kTextureBorderClampExt
static const constexpr char * kNvidiaTextureBorderClampExt
static const constexpr char * kAppleTextureMaxLevelExt
static const constexpr char * kFramebufferFetchExt
static const constexpr char * kElementIndexUintExt
#define IMPELLER_GL_MAX_TEXTURE_MAX_ANISOTROPY