5#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PROC_TABLE_GLES_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PROC_TABLE_GLES_H_
11#include "flutter/fml/logging.h"
12#include "flutter/fml/mapping.h"
35 if (
error == GL_NO_ERROR) {
40 <<
error <<
")" <<
" encountered on call to " <<
name;
43 <<
")" <<
" encountered on call to " <<
name;
59 const char*
name =
nullptr;
78 template <
class... Args>
86 <<
"This is likely due to a missing extension.";
99#define FOR_EACH_IMPELLER_PROC(PROC) \
100 PROC(ActiveTexture); \
101 PROC(AttachShader); \
102 PROC(BindAttribLocation); \
104 PROC(BindFramebuffer); \
105 PROC(BindRenderbuffer); \
107 PROC(BlendEquationSeparate); \
108 PROC(BlendFuncSeparate); \
110 PROC(CheckFramebufferStatus); \
113 PROC(ClearStencil); \
115 PROC(CompileShader); \
116 PROC(CreateProgram); \
117 PROC(CreateShader); \
119 PROC(DeleteBuffers); \
120 PROC(DeleteFramebuffers); \
121 PROC(DeleteProgram); \
122 PROC(DeleteRenderbuffers); \
123 PROC(DeleteShader); \
124 PROC(DeleteTextures); \
127 PROC(DetachShader); \
129 PROC(DisableVertexAttribArray); \
131 PROC(DrawElements); \
133 PROC(EnableVertexAttribArray); \
135 PROC(FramebufferRenderbuffer); \
136 PROC(FramebufferTexture2D); \
139 PROC(GenerateMipmap); \
140 PROC(GenFramebuffers); \
141 PROC(GenRenderbuffers); \
143 PROC(GetActiveUniform); \
146 PROC(GetFramebufferAttachmentParameteriv); \
148 PROC(GetProgramInfoLog); \
149 PROC(GetProgramiv); \
150 PROC(GetShaderInfoLog); \
154 PROC(GetUniformLocation); \
156 PROC(IsFramebuffer); \
158 PROC(IsRenderbuffer); \
163 PROC(RenderbufferStorage); \
165 PROC(ShaderBinary); \
166 PROC(ShaderSource); \
167 PROC(StencilFuncSeparate); \
168 PROC(StencilMaskSeparate); \
169 PROC(StencilOpSeparate); \
171 PROC(TexSubImage2D); \
172 PROC(TexParameteri); \
173 PROC(TexParameterfv); \
179 PROC(UniformMatrix4fv); \
181 PROC(VertexAttribPointer); \
183 PROC(GetShaderSource); \
190#define FOR_EACH_IMPELLER_ES_ONLY_PROC(PROC) \
198#define FOR_EACH_IMPELLER_DESKTOP_ONLY_PROC(PROC) \
202#define FOR_EACH_IMPELLER_GLES3_PROC(PROC) PROC(BlitFramebuffer);
204#define FOR_EACH_IMPELLER_EXT_PROC(PROC) \
205 PROC(DebugMessageControlKHR); \
206 PROC(DiscardFramebufferEXT); \
207 PROC(FramebufferTexture2DMultisampleEXT); \
208 PROC(PushDebugGroupKHR); \
209 PROC(PopDebugGroupKHR); \
210 PROC(ObjectLabelKHR); \
211 PROC(RenderbufferStorageMultisampleEXT); \
212 PROC(GenQueriesEXT); \
213 PROC(DeleteQueriesEXT); \
214 PROC(GetQueryObjectui64vEXT); \
215 PROC(BeginQueryEXT); \
217 PROC(GetQueryObjectuivEXT);
236#define IMPELLER_PROC(name) \
237 GLProc<decltype(gl##name)> name = {"gl" #name, nullptr};
256 const std::vector<Scalar>& defines = {})
const;
260 const std::shared_ptr<const CapabilitiesGLES>&
GetCapabilities()
const;
270 const std::string& label)
const;
279 const std::vector<Scalar>& defines)
const;
282 bool is_valid_ =
false;
283 std::unique_ptr<DescriptionGLES> description_;
284 std::shared_ptr<const CapabilitiesGLES> capabilities_;
285 GLint debug_label_max_length_ = 0;
FOR_EACH_IMPELLER_ES_ONLY_PROC(IMPELLER_PROC)
ProcTableGLES(ProcTableGLES &&other)=default
std::optional< std::string > ComputeShaderWithDefines(const fml::Mapping &mapping, const std::vector< Scalar > &defines) const
void PopDebugGroup() const
FOR_EACH_IMPELLER_GLES3_PROC(IMPELLER_PROC)
std::function< void *(const char *function_name)> Resolver
void ShaderSourceMapping(GLuint shader, const fml::Mapping &mapping, const std::vector< Scalar > &defines={}) const
Set the source for the attached [shader].
FOR_EACH_IMPELLER_DESKTOP_ONLY_PROC(IMPELLER_PROC)
std::string GetProgramInfoLogString(GLuint program) const
bool SetDebugLabel(DebugResourceType type, GLint name, const std::string &label) const
std::string DescribeCurrentFramebuffer() const
const std::shared_ptr< const CapabilitiesGLES > & GetCapabilities() const
bool IsCurrentFramebufferComplete() const
ProcTableGLES(Resolver resolver)
FOR_EACH_IMPELLER_PROC(IMPELLER_PROC)
FOR_EACH_IMPELLER_EXT_PROC(IMPELLER_PROC)
void PushDebugGroup(const std::string &string) const
const DescriptionGLES * GetDescription() const
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
#define FML_LOG(severity)
#define FML_CHECK(condition)
Dart_NativeFunction function
const char *const function_name
DEF_SWITCHES_START aot vmservice shared library name
void() glClearDepth(GLdouble depth)
bool GLErrorIsFatal(GLenum value)
void() glDepthRangef(GLfloat n, GLfloat f)
const char * GLErrorToString(GLenum value)
void() glDepthRange(GLdouble n, GLdouble f)
void() glClearDepthf(GLfloat depth)
#define IMPELLER_PROC(name)
AutoErrorCheck(PFNGLGETERRORPROC error, const char *name)
const PFNGLGETERRORPROC error_fn
auto operator()(Args &&... args) const
Call the GL function with the appropriate parameters. Lookup the documentation for the GL function be...
constexpr bool IsAvailable() const
GLFunctionType * function
PFNGLGETERRORPROC error_fn