| 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/shader_types.h"
12 #include "impeller/geometry/size.h"
13 #include "impeller/renderer/capabilities.h"
14
15 namespace impeller {
16
17 class ProcTableGLES;
18
19 //------------------------------------------------------------------------------
20 /// @brief The Vulkan layers and extensions wrangler.
21 ///
22 class CapabilitiesGLES final
23 : public Capabilities,
24 public BackendCast<CapabilitiesGLES, Capabilities> {
25 public:
26 explicit CapabilitiesGLES(const ProcTableGLES& gl);
27
28 CapabilitiesGLES(const CapabilitiesGLES&) = delete;
29
30 CapabilitiesGLES(CapabilitiesGLES&&) = delete;
31
32 CapabilitiesGLES& operator=(const CapabilitiesGLES&) = delete;
33
34 CapabilitiesGLES& operator=(CapabilitiesGLES&&) = delete;
35
36 // Must be at least 8.
37 size_t max_combined_texture_image_units = 8;
38
39 // Must be at least 16.
40 size_t max_cube_map_texture_size = 16;
41
42 // Must be at least 16.
43 size_t max_fragment_uniform_vectors = 16;
44
45 // Must be at least 1.
46 size_t max_renderbuffer_size = 1;
47
48 // Must be at least 8.
49 size_t max_texture_image_units = 8;
50
51 // Must be at least 64.
52 ISize max_texture_size = ISize{64, 64};
53
54 // Must be at least 8.
55 size_t max_varying_vectors = 8;
56
57 // Must be at least 8.
58 size_t max_vertex_attribs = 8;
59
60 // May be 0.
61 size_t max_vertex_texture_image_units = 0;
62
63 // Must be at least 128.
64 size_t max_vertex_uniform_vectors = 128;
65
66 // Must be at least display size.
67 ISize max_viewport_dims;
68
69 // May be 0.
70 size_t num_compressed_texture_formats = 0;
71
72 // May be 0.
73 size_t num_shader_binary_formats = 0;
74
75 size_t GetMaxTextureUnits(ShaderStage stage) const;
76
77 // |Capabilities|
78 bool SupportsOffscreenMSAA() const override;
79
80 // |Capabilities|
81 bool SupportsImplicitResolvingMSAA() const override;
82
83 // |Capabilities|
84 bool SupportsSSBO() const override;
85
86 // |Capabilities|
87 bool SupportsBufferToTextureBlits() const override;
88
89 // |Capabilities|
90 bool SupportsTextureToTextureBlits() const override;
91
92 // |Capabilities|
93 bool SupportsFramebufferFetch() const override;
94
95 // |Capabilities|
96 bool SupportsCompute() const override;
97
98 // |Capabilities|
99 bool SupportsComputeSubgroups() const override;
100
101 // |Capabilities|
102 bool SupportsReadFromResolve() const override;
103
104 // |Capabilities|
105 bool SupportsDecalSamplerAddressMode() const override;
106
107 // |Capabilities|
108 bool SupportsDeviceTransientTextures() const override;
109
110 // |Capabilities|
111 PixelFormat GetDefaultColorFormat() const override;
112
113 // |Capabilities|
114 PixelFormat GetDefaultStencilFormat() const override;
115
116 // |Capabilities|
117 PixelFormat GetDefaultDepthStencilFormat() const override;
118
119 private:
120 bool supports_framebuffer_fetch_ = false;
121 bool supports_decal_sampler_address_mode_ = false;
122 bool supports_offscreen_msaa_ = false;
123 bool supports_implicit_msaa_ = false;
124 };
125
126 } // namespace impeller
127
128 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_CAPABILITIES_GLES_H_
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::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:155
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:187
impeller::CapabilitiesGLES::max_fragment_uniform_vectors
size_t max_fragment_uniform_vectors
Definition: capabilities_gles.h:43
impeller::CapabilitiesGLES::GetMaxTextureUnits
size_t GetMaxTextureUnits(ShaderStage stage) const
Definition: capabilities_gles.cc:122
impeller::CapabilitiesGLES::CapabilitiesGLES
CapabilitiesGLES(const ProcTableGLES &gl)
Definition: capabilities_gles.cc:24
impeller::ShaderStage
ShaderStage
Definition: shader_types.h:22
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::SupportsImplicitResolvingMSAA
bool SupportsImplicitResolvingMSAA() const override
Whether the context backend supports multisampled rendering to the on-screen surface without requirin...
Definition: capabilities_gles.cc:139
impeller::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:94
impeller::Capabilities
Definition: capabilities.h:15
impeller::TSize< int64_t >
impeller::CapabilitiesGLES::SupportsSSBO
bool SupportsSSBO() const override
Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines.
Definition: capabilities_gles.cc:143
impeller::CapabilitiesGLES::max_combined_texture_image_units
size_t max_combined_texture_image_units
Definition: capabilities_gles.h:37
impeller::CapabilitiesGLES::SupportsDecalSamplerAddressMode
bool SupportsDecalSamplerAddressMode() const override
Whether the context backend supports SamplerAddressMode::Decal.
Definition: capabilities_gles.cc:171
impeller::CapabilitiesGLES::max_vertex_texture_image_units
size_t max_vertex_texture_image_units
Definition: capabilities_gles.h:61
impeller::CapabilitiesGLES::SupportsDeviceTransientTextures
bool SupportsDeviceTransientTextures() const override
Whether the context backend supports allocating StorageMode::kDeviceTransient (aka "memoryless") text...
Definition: capabilities_gles.cc:175
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:183
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
backend_cast.h
capabilities.h
impeller::ProcTableGLES
Definition: proc_table_gles.h:217
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:151
impeller::CapabilitiesGLES::SupportsComputeSubgroups
bool SupportsComputeSubgroups() const override
Whether the context backend supports configuring ComputePass command subgroups.
Definition: capabilities_gles.cc:163
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:167
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:179
impeller::CapabilitiesGLES::SupportsBufferToTextureBlits
bool SupportsBufferToTextureBlits() const override
Whether the context backend supports blitting from a given DeviceBuffer view to a texture region (via...
Definition: capabilities_gles.cc:147
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::CapabilitiesGLES
The Vulkan layers and extensions wrangler.
Definition: capabilities_gles.h:22
impeller::BackendCast
Definition: backend_cast.h:13
impeller::CapabilitiesGLES::SupportsCompute
bool SupportsCompute() const override
Whether the context backend supports ComputePass.
Definition: capabilities_gles.cc:159
impeller::CapabilitiesGLES::operator=
CapabilitiesGLES & operator=(const CapabilitiesGLES &)=delete
impeller::CapabilitiesGLES::num_compressed_texture_formats
size_t num_compressed_texture_formats
Definition: capabilities_gles.h:70
shader_types.h
impeller
Definition: aiks_context.cc:10
size.h
impeller::CapabilitiesGLES::SupportsOffscreenMSAA
bool SupportsOffscreenMSAA() const override
Whether the context backend supports attaching offscreen MSAA color/stencil textures.
Definition: capabilities_gles.cc:135
impeller::CapabilitiesGLES::max_varying_vectors
size_t max_varying_vectors
Definition: capabilities_gles.h:55