| Flutter Impeller |

capabilities_gles.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_CAPABILITIES_GLES_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_CAPABILITIES_GLES_H_
7
8 #include <cstddef>
9
10 #include "impeller/base/backend_cast.h"
11 #include "impeller/core/formats.h"
12 #include "impeller/core/shader_types.h"
13 #include "impeller/geometry/size.h"
14 #include "impeller/renderer/capabilities.h"
15
16 namespace impeller {
17
18 class ProcTableGLES;
19
20 //------------------------------------------------------------------------------
21 /// @brief The Vulkan layers and extensions wrangler.
22 ///
23 class CapabilitiesGLES final
24 : public Capabilities,
25 public BackendCast<CapabilitiesGLES, Capabilities> {
26 public:
27 explicit CapabilitiesGLES(const ProcTableGLES& gl);
28
29 CapabilitiesGLES(const CapabilitiesGLES&) = delete;
30
31 CapabilitiesGLES(CapabilitiesGLES&&) = delete;
32
33 CapabilitiesGLES& operator=(const CapabilitiesGLES&) = delete;
34
35 CapabilitiesGLES& operator=(CapabilitiesGLES&&) = delete;
36
37 // Must be at least 8.
38 size_t max_combined_texture_image_units = 8;
39
40 // Must be at least 16.
41 size_t max_cube_map_texture_size = 16;
42
43 // Must be at least 16.
44 size_t max_fragment_uniform_vectors = 16;
45
46 // Must be at least 1.
47 size_t max_renderbuffer_size = 1;
48
49 // Must be at least 8.
50 size_t max_texture_image_units = 8;
51
52 // Must be at least 64.
53 ISize max_texture_size = ISize{64, 64};
54
55 // Must be at least 8.
56 size_t max_varying_vectors = 8;
57
58 // Must be at least 8.
59 size_t max_vertex_attribs = 8;
60
61 // May be 0.
62 size_t max_vertex_texture_image_units = 0;
63
64 // Must be at least 128.
65 size_t max_vertex_uniform_vectors = 128;
66
67 // Must be at least display size.
68 ISize max_viewport_dims;
69
70 // May be 0.
71 size_t num_compressed_texture_formats = 0;
72
73 // May be 0.
74 size_t num_shader_binary_formats = 0;
75
76 size_t GetMaxTextureUnits(ShaderStage stage) const;
77
78 bool IsANGLE() const;
79
80 /// @brief Whether this is an ES GL variant or (if false) desktop GL.
81 bool IsES() const;
82
83 // |Capabilities|
84 bool SupportsOffscreenMSAA() const override;
85
86 // |Capabilities|
87 bool SupportsImplicitResolvingMSAA() const override;
88
89 // |Capabilities|
90 bool SupportsSSBO() const override;
91
92 // |Capabilities|
93 bool SupportsTextureToTextureBlits() const override;
94
95 // |Capabilities|
96 bool SupportsFramebufferFetch() const override;
97
98 // |Capabilities|
99 bool SupportsCompute() const override;
100
101 // |Capabilities|
102 bool SupportsComputeSubgroups() const override;
103
104 // |Capabilities|
105 bool SupportsReadFromResolve() const override;
106
107 // |Capabilities|
108 bool SupportsDecalSamplerAddressMode() const override;
109
110 // |Capabilities|
111 bool SupportsDeviceTransientTextures() const override;
112
113 // |Capabilities|
114 bool SupportsTriangleFan() const override;
115
116 // |Capabilities|
117 bool SupportsPrimitiveRestart() const override;
118
119 // |Capabilities|
120 bool Supports32BitPrimitiveIndices() const override;
121
122 // |Capabilities|
123 bool SupportsExtendedRangeFormats() const override;
124
125 // |Capabilities|
126 PixelFormat GetDefaultColorFormat() const override;
127
128 // |Capabilities|
129 PixelFormat GetDefaultStencilFormat() const override;
130
131 // |Capabilities|
132 PixelFormat GetDefaultDepthStencilFormat() const override;
133
134 // |Capabilities|
135 PixelFormat GetDefaultGlyphAtlasFormat() const override;
136
137 // |Capabilities|
138 ISize GetMaximumRenderPassAttachmentSize() const override;
139
140 // |Capabilities|
141 size_t GetMinimumUniformAlignment() const override;
142
143 // |Capabilities|
144 bool NeedsPartitionedHostBuffer() const override;
145
146 private:
147 bool supports_texture_to_texture_blits_ = false;
148 bool supports_framebuffer_fetch_ = false;
149 bool supports_decal_sampler_address_mode_ = false;
150 bool supports_offscreen_msaa_ = false;
151 bool supports_implicit_msaa_ = false;
152 bool supports_32bit_primitive_indices_ = false;
153 bool is_angle_ = false;
154 bool is_es_ = false;
155 PixelFormat default_glyph_atlas_format_ = PixelFormat::kUnknown;
156 };
157
158 } // namespace impeller
159
160 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_CAPABILITIES_GLES_H_
backend_cast.h
capabilities.h
impeller::BackendCast
Definition: backend_cast.h:11
impeller::CapabilitiesGLES
The Vulkan layers and extensions wrangler.
Definition: capabilities_gles.h:25
impeller::CapabilitiesGLES::IsES
bool IsES() const
Whether this is an ES GL variant or (if false) desktop GL.
Definition: capabilities_gles.cc:152
impeller::CapabilitiesGLES::SupportsImplicitResolvingMSAA
bool SupportsImplicitResolvingMSAA() const override
Whether the context backend supports multisampled rendering to the on-screen surface without requirin...
Definition: capabilities_gles.cc:173
impeller::CapabilitiesGLES::GetDefaultDepthStencilFormat
PixelFormat GetDefaultDepthStencilFormat() const override
Returns a supported PixelFormat for textures that store both a stencil and depth component....
Definition: capabilities_gles.cc:221
impeller::CapabilitiesGLES::operator=
CapabilitiesGLES & operator=(const CapabilitiesGLES &)=delete
impeller::CapabilitiesGLES::max_vertex_uniform_vectors
size_t max_vertex_uniform_vectors
Definition: capabilities_gles.h:65
impeller::CapabilitiesGLES::GetDefaultColorFormat
PixelFormat GetDefaultColorFormat() const override
Returns a supported PixelFormat for textures that store 4-channel colors (red/green/blue/alpha).
Definition: capabilities_gles.cc:213
impeller::CapabilitiesGLES::SupportsSSBO
bool SupportsSSBO() const override
Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines.
Definition: capabilities_gles.cc:177
impeller::CapabilitiesGLES::max_fragment_uniform_vectors
size_t max_fragment_uniform_vectors
Definition: capabilities_gles.h:44
impeller::CapabilitiesGLES::SupportsTextureToTextureBlits
bool SupportsTextureToTextureBlits() const override
Whether the context backend supports blitting from one texture region to another texture region (via ...
Definition: capabilities_gles.cc:181
impeller::CapabilitiesGLES::GetMaximumRenderPassAttachmentSize
ISize GetMaximumRenderPassAttachmentSize() const override
Return the maximum size of a render pass attachment.
Definition: capabilities_gles.cc:245
impeller::CapabilitiesGLES::CapabilitiesGLES
CapabilitiesGLES(const CapabilitiesGLES &)=delete
impeller::CapabilitiesGLES::CapabilitiesGLES
CapabilitiesGLES(const ProcTableGLES &gl)
Definition: capabilities_gles.cc:32
impeller::CapabilitiesGLES::max_viewport_dims
ISize max_viewport_dims
Definition: capabilities_gles.h:68
impeller::CapabilitiesGLES::max_renderbuffer_size
size_t max_renderbuffer_size
Definition: capabilities_gles.h:47
impeller::CapabilitiesGLES::SupportsPrimitiveRestart
bool SupportsPrimitiveRestart() const override
Whether primitive restart is supported.
Definition: capabilities_gles.cc:229
impeller::CapabilitiesGLES::GetMaxTextureUnits
size_t GetMaxTextureUnits(ShaderStage stage) const
Definition: capabilities_gles.cc:156
impeller::CapabilitiesGLES::NeedsPartitionedHostBuffer
bool NeedsPartitionedHostBuffer() const override
Whether the host buffer should use separate device buffers for indexes from other data.
Definition: capabilities_gles.cc:253
impeller::CapabilitiesGLES::IsANGLE
bool IsANGLE() const
Definition: capabilities_gles.cc:225
impeller::CapabilitiesGLES::max_cube_map_texture_size
size_t max_cube_map_texture_size
Definition: capabilities_gles.h:41
impeller::CapabilitiesGLES::max_vertex_texture_image_units
size_t max_vertex_texture_image_units
Definition: capabilities_gles.h:62
impeller::CapabilitiesGLES::SupportsTriangleFan
bool SupportsTriangleFan() const override
Whether the primitive type TriangleFan is supported by the backend.
Definition: capabilities_gles.cc:209
impeller::CapabilitiesGLES::num_shader_binary_formats
size_t num_shader_binary_formats
Definition: capabilities_gles.h:74
impeller::CapabilitiesGLES::Supports32BitPrimitiveIndices
bool Supports32BitPrimitiveIndices() const override
Whether 32-bit values are supported in index buffers used to draw primitives.
Definition: capabilities_gles.cc:233
impeller::CapabilitiesGLES::max_combined_texture_image_units
size_t max_combined_texture_image_units
Definition: capabilities_gles.h:38
impeller::CapabilitiesGLES::CapabilitiesGLES
CapabilitiesGLES(CapabilitiesGLES &&)=delete
impeller::CapabilitiesGLES::SupportsOffscreenMSAA
bool SupportsOffscreenMSAA() const override
Whether the context backend supports attaching offscreen MSAA color/stencil textures.
Definition: capabilities_gles.cc:169
impeller::CapabilitiesGLES::GetMinimumUniformAlignment
size_t GetMinimumUniformAlignment() const override
The minimum alignment of uniform value offsets in bytes.
Definition: capabilities_gles.cc:249
impeller::CapabilitiesGLES::GetDefaultStencilFormat
PixelFormat GetDefaultStencilFormat() const override
Returns a supported PixelFormat for textures that store stencil information. May include a depth chan...
Definition: capabilities_gles.cc:217
impeller::CapabilitiesGLES::SupportsReadFromResolve
bool SupportsReadFromResolve() const override
Whether the context backend supports binding the current RenderPass attachments. This is supported if...
Definition: capabilities_gles.cc:197
impeller::CapabilitiesGLES::operator=
CapabilitiesGLES & operator=(CapabilitiesGLES &&)=delete
impeller::CapabilitiesGLES::SupportsDeviceTransientTextures
bool SupportsDeviceTransientTextures() const override
Whether the context backend supports allocating StorageMode::kDeviceTransient (aka "memoryless") text...
Definition: capabilities_gles.cc:205
impeller::CapabilitiesGLES::SupportsDecalSamplerAddressMode
bool SupportsDecalSamplerAddressMode() const override
Whether the context backend supports SamplerAddressMode::Decal.
Definition: capabilities_gles.cc:201
impeller::CapabilitiesGLES::max_texture_image_units
size_t max_texture_image_units
Definition: capabilities_gles.h:50
impeller::CapabilitiesGLES::GetDefaultGlyphAtlasFormat
PixelFormat GetDefaultGlyphAtlasFormat() const override
Returns the default pixel format for the alpha bitmap glyph atlas.
Definition: capabilities_gles.cc:241
impeller::CapabilitiesGLES::max_texture_size
ISize max_texture_size
Definition: capabilities_gles.h:53
impeller::CapabilitiesGLES::max_vertex_attribs
size_t max_vertex_attribs
Definition: capabilities_gles.h:59
impeller::CapabilitiesGLES::SupportsExtendedRangeFormats
bool SupportsExtendedRangeFormats() const override
Whether the XR formats are supported on this device.
Definition: capabilities_gles.cc:237
impeller::CapabilitiesGLES::SupportsCompute
bool SupportsCompute() const override
Whether the context backend supports ComputePass.
Definition: capabilities_gles.cc:189
impeller::CapabilitiesGLES::max_varying_vectors
size_t max_varying_vectors
Definition: capabilities_gles.h:56
impeller::CapabilitiesGLES::SupportsComputeSubgroups
bool SupportsComputeSubgroups() const override
Whether the context backend supports configuring ComputePass command subgroups.
Definition: capabilities_gles.cc:193
impeller::CapabilitiesGLES::num_compressed_texture_formats
size_t num_compressed_texture_formats
Definition: capabilities_gles.h:71
impeller::CapabilitiesGLES::SupportsFramebufferFetch
bool SupportsFramebufferFetch() const override
Whether the context backend is able to support pipelines with shaders that read from the framebuffer ...
Definition: capabilities_gles.cc:185
impeller::Capabilities
Definition: capabilities.h:14
impeller::ProcTableGLES
Definition: proc_table_gles.h:283
formats.h
impeller
Definition: allocation.cc:12
impeller::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:99
impeller::PixelFormat::kUnknown
@ kUnknown
impeller::ShaderStage
ShaderStage
Definition: shader_types.h:22
shader_types.h
size.h
impeller::TSize
Definition: size.h:25