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.";
88#ifdef IMPELLER_TRACE_ALL_GL_CALLS
102#define FOR_EACH_IMPELLER_PROC(PROC) \
103 PROC(ActiveTexture); \
104 PROC(AttachShader); \
105 PROC(BindAttribLocation); \
107 PROC(BindFramebuffer); \
108 PROC(BindRenderbuffer); \
110 PROC(BlendEquationSeparate); \
111 PROC(BlendFuncSeparate); \
113 PROC(CheckFramebufferStatus); \
116 PROC(ClearStencil); \
118 PROC(CompileShader); \
119 PROC(CreateProgram); \
120 PROC(CreateShader); \
122 PROC(DeleteBuffers); \
123 PROC(DeleteFramebuffers); \
124 PROC(DeleteProgram); \
125 PROC(DeleteRenderbuffers); \
126 PROC(DeleteShader); \
127 PROC(DeleteTextures); \
130 PROC(DetachShader); \
132 PROC(DisableVertexAttribArray); \
134 PROC(DrawElements); \
136 PROC(EnableVertexAttribArray); \
138 PROC(FramebufferRenderbuffer); \
139 PROC(FramebufferTexture2D); \
142 PROC(GenerateMipmap); \
143 PROC(GenFramebuffers); \
144 PROC(GenRenderbuffers); \
146 PROC(GetActiveUniform); \
149 PROC(GetFramebufferAttachmentParameteriv); \
151 PROC(GetProgramInfoLog); \
152 PROC(GetProgramiv); \
153 PROC(GetShaderInfoLog); \
157 PROC(GetUniformLocation); \
159 PROC(IsFramebuffer); \
161 PROC(IsRenderbuffer); \
165 PROC(RenderbufferStorage); \
167 PROC(ShaderBinary); \
168 PROC(ShaderSource); \
169 PROC(StencilFuncSeparate); \
170 PROC(StencilMaskSeparate); \
171 PROC(StencilOpSeparate); \
173 PROC(TexParameteri); \
174 PROC(TexParameterfv); \
180 PROC(UniformMatrix4fv); \
182 PROC(VertexAttribPointer); \
184 PROC(GetShaderSource); \
191#define FOR_EACH_IMPELLER_ES_ONLY_PROC(PROC) \
199#define FOR_EACH_IMPELLER_DESKTOP_ONLY_PROC(PROC) \
203#define FOR_EACH_IMPELLER_GLES3_PROC(PROC) PROC(BlitFramebuffer);
205#define FOR_EACH_IMPELLER_EXT_PROC(PROC) \
206 PROC(DebugMessageControlKHR); \
207 PROC(DiscardFramebufferEXT); \
208 PROC(FramebufferTexture2DMultisampleEXT); \
209 PROC(PushDebugGroupKHR); \
210 PROC(PopDebugGroupKHR); \
211 PROC(ObjectLabelKHR); \
212 PROC(RenderbufferStorageMultisampleEXT); \
213 PROC(GenQueriesEXT); \
214 PROC(DeleteQueriesEXT); \
215 PROC(GetQueryObjectui64vEXT); \
216 PROC(BeginQueryEXT); \
218 PROC(GetQueryObjectuivEXT);
231 using Resolver = std::function<
void*(
const char* function_name)>;
237#define IMPELLER_PROC(name) \
238 GLProc<decltype(gl##name)> name = {"gl" #name, nullptr};
257 const std::vector<Scalar>& defines = {})
const;
261 const std::shared_ptr<const CapabilitiesGLES>&
GetCapabilities()
const;
271 const std::string& label)
const;
280 const std::vector<Scalar>& defines)
const;
283 bool is_valid_ =
false;
284 std::unique_ptr<DescriptionGLES> description_;
285 std::shared_ptr<const CapabilitiesGLES> capabilities_;
286 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
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)
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(proc_ivar)
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
#define TRACE_EVENT0(category_group, name)