Sets up stage bindings for single draw call in the OpenGLES backend.
More...
#include <buffer_bindings_gles.h>
Sets up stage bindings for single draw call in the OpenGLES backend.
Definition at line 22 of file buffer_bindings_gles.h.
◆ BufferBindingsGLES()
impeller::BufferBindingsGLES::BufferBindingsGLES |
( |
| ) |
|
|
default |
◆ ~BufferBindingsGLES()
impeller::BufferBindingsGLES::~BufferBindingsGLES |
( |
| ) |
|
|
default |
◆ BindUniformData()
Definition at line 162 of file buffer_bindings_gles.cc.
165 {
166 for (
const auto&
buffer : vertex_bindings.buffers) {
167 if (!BindUniformBuffer(
gl, transients_allocator,
buffer.view)) {
168 return false;
169 }
170 }
171 for (
const auto&
buffer : fragment_bindings.buffers) {
172 if (!BindUniformBuffer(
gl, transients_allocator,
buffer.view)) {
173 return false;
174 }
175 }
176
177 std::optional<size_t> next_unit_index =
179 if (!next_unit_index.has_value()) {
180 return false;
181 }
182
184 *next_unit_index)
185 .has_value()) {
186 return false;
187 }
188
189 return true;
190}
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
◆ BindVertexAttributes()
bool impeller::BufferBindingsGLES::BindVertexAttributes |
( |
const ProcTableGLES & |
gl, |
|
|
size_t |
vertex_offset |
|
) |
| const |
Definition at line 145 of file buffer_bindings_gles.cc.
146 {
147 for (const auto& array : vertex_attrib_arrays_) {
148 gl.EnableVertexAttribArray(array.index);
149 gl.VertexAttribPointer(array.index,
150 array.size,
151 array.type,
152 array.normalized,
153 array.stride,
154 reinterpret_cast<const GLvoid*>(static_cast<GLsizei>(
155 vertex_offset + array.offset))
156 );
157 }
158
159 return true;
160}
◆ ReadUniformsBindings()
bool impeller::BufferBindingsGLES::ReadUniformsBindings |
( |
const ProcTableGLES & |
gl, |
|
|
GLuint |
program |
|
) |
| |
Definition at line 89 of file buffer_bindings_gles.cc.
90 {
91 if (!
gl.IsProgram(program)) {
92 return false;
93 }
94 GLint max_name_size = 0;
95 gl.GetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &max_name_size);
96
97 GLint uniform_count = 0;
98 gl.GetProgramiv(program, GL_ACTIVE_UNIFORMS, &uniform_count);
99
100
101
102 for (GLint
i = 0;
i < uniform_count;
i++) {
103 std::vector<GLchar>
name;
104 name.resize(max_name_size);
105 GLsizei written_count = 0u;
106 GLint uniform_var_size = 0u;
107 GLenum uniform_type = GL_FLOAT;
108
109
110
111 gl.GetActiveUniform(program,
113 max_name_size,
114 &written_count,
115 &uniform_var_size,
116 &uniform_type,
118 );
119
120
121 if (
gl.GetCapabilities()->IsANGLE()) {
122 if (written_count >=
126 continue;
127 }
128 }
129
130 auto location =
gl.GetUniformLocation(program,
name.data());
131 if (location == -1) {
132 VALIDATION_LOG <<
"Could not query the location of an active uniform.";
133 return false;
134 }
135 if (written_count <= 0) {
136 VALIDATION_LOG <<
"Uniform name could not be read for active uniform.";
137 return false;
138 }
140 name.data(),
static_cast<size_t>(written_count)})] = location;
141 }
142 return true;
143}
DEF_SWITCHES_START aot vmservice shared library name
static constexpr std::string_view kAngleInputAttachmentPrefix
static std::string NormalizeUniformKey(const std::string &key)
◆ RegisterVertexStageInput()
Definition at line 28 of file buffer_bindings_gles.cc.
31 {
32 std::vector<VertexAttribPointer> vertex_attrib_arrays;
33 for (
auto i = 0u;
i < p_inputs.size();
i++) {
34 const auto& input = p_inputs[
i];
35 const auto& layout = layouts[input.binding];
36 VertexAttribPointer attrib;
37 attrib.index = input.location;
38
39 if (input.vec_size < 1u || input.vec_size > 4u) {
40 return false;
41 }
42 attrib.size = input.vec_size;
44 if (!
type.has_value()) {
45 return false;
46 }
47 attrib.type =
type.value();
48 attrib.normalized = GL_FALSE;
49 attrib.offset = input.offset;
50 attrib.stride = layout.stride;
51 vertex_attrib_arrays.emplace_back(attrib);
52 }
53 vertex_attrib_arrays_ = std::move(vertex_attrib_arrays);
54 return true;
55}
constexpr std::optional< GLenum > ToVertexAttribType(ShaderType type)
◆ UnbindVertexAttributes()
bool impeller::BufferBindingsGLES::UnbindVertexAttributes |
( |
const ProcTableGLES & |
gl | ) |
const |
Definition at line 192 of file buffer_bindings_gles.cc.
192 {
193 for (const auto& array : vertex_attrib_arrays_) {
194 gl.DisableVertexAttribArray(array.index);
195 }
196 return true;
197}
The documentation for this class was generated from the following files: