Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
proc_table_gles.h File Reference
#include <functional>
#include <string>
#include <string_view>
#include "GLES3/gl3.h"
#include "flutter/fml/logging.h"
#include "flutter/fml/mapping.h"
#include "impeller/renderer/backend/gles/capabilities_gles.h"
#include "impeller/renderer/backend/gles/description_gles.h"
#include "impeller/renderer/backend/gles/gles.h"

Go to the source code of this file.

Classes

struct  impeller::AutoErrorCheck
 
struct  impeller::ArgLogger< Type >
 
struct  impeller::ArgLogger< R(*)(Args...)>
 
struct  impeller::GLProc< T >
 
class  impeller::ProcTableGLES
 

Namespaces

namespace  impeller
 

Macros

#define IP_ENABLE_GLES_LABELING   false
 Enable to allow GLES to push/pop labels for usage in GPU traces.
 
#define FOR_EACH_IMPELLER_PROC(PROC)
 
#define FOR_EACH_IMPELLER_ES_ONLY_PROC(PROC)
 
#define FOR_EACH_IMPELLER_DESKTOP_ONLY_PROC(PROC)
 
#define FOR_EACH_IMPELLER_GLES3_PROC(PROC)
 
#define FOR_EACH_IMPELLER_EXT_PROC(PROC)
 
#define IMPELLER_PROC(name)    GLProc<decltype(gl##name)> name = {"gl" #name, nullptr};
 

Enumerations

enum class  impeller::DebugResourceType {
  impeller::kTexture ,
  impeller::kBuffer ,
  impeller::kProgram ,
  impeller::kShader ,
  impeller::kRenderBuffer ,
  impeller::kFrameBuffer ,
  impeller::kFence
}
 

Functions

std::string_view impeller::GLErrorToString (GLenum value)
 
bool impeller::GLErrorIsFatal (GLenum value)
 
template<class Type >
void impeller::BuildGLArgumentsStream (std::stringstream &stream, Type arg)
 
constexpr void impeller::BuildGLArgumentsStream (std::stringstream &stream)
 
template<class Type , class... Rest>
void impeller::BuildGLArgumentsStream (std::stringstream &stream, Type arg, Rest... other_args)
 
template<class... Type>
std::string impeller::BuildGLArguments (Type... args)
 
void() impeller::glClearDepthf (GLfloat depth)
 
void() impeller::glDepthRangef (GLfloat n, GLfloat f)
 
void() impeller::glClearDepth (GLdouble depth)
 
void() impeller::glDepthRange (GLdouble n, GLdouble f)
 

Macro Definition Documentation

◆ FOR_EACH_IMPELLER_DESKTOP_ONLY_PROC

#define FOR_EACH_IMPELLER_DESKTOP_ONLY_PROC (   PROC)
Value:
PROC(ClearDepth); \
PROC(DepthRange);

Definition at line 253 of file proc_table_gles.h.

285 {
286 kTexture,
287 kBuffer,
288 kProgram,
289 kShader,
292 kFence,
293};
294
295class ProcTableGLES {
296 public:
297 using Resolver = std::function<void*(const char* function_name)>;
298 explicit ProcTableGLES(Resolver resolver);
299 ProcTableGLES(ProcTableGLES&& other) = default;
300
301 ~ProcTableGLES();
302
303#define IMPELLER_PROC(name) \
304 GLProc<decltype(gl##name)> name = {"gl" #name, nullptr};
305
311
312#undef IMPELLER_PROC
313
314 bool IsValid() const;
315
316 /// @brief Set the source for the attached [shader].
317 ///
318 /// Optionally, [defines] may contain a string value that will be
319 /// append to the shader source after the version marker. This can be used to
320 /// support static specialization. For example, setting "#define Foo 1".
321 void ShaderSourceMapping(GLuint shader,
322 const fml::Mapping& mapping,
323 const std::vector<Scalar>& defines = {}) const;
324
325 const DescriptionGLES* GetDescription() const;
326
327 const std::shared_ptr<const CapabilitiesGLES>& GetCapabilities() const;
328
329 std::string DescribeCurrentFramebuffer() const;
330
331 std::string GetProgramInfoLogString(GLuint program) const;
332
333 // Only check framebuffer status in debug builds.
334 // Prefer this if possible to direct calls to CheckFramebufferStatus,
335 // which can cause CPU<->GPU round-trips.
336 GLenum CheckFramebufferStatusDebug(GLenum target) const;
337
338 bool IsCurrentFramebufferComplete() const;
339
340 bool SupportsDebugLabels() const;
341
342 bool SetDebugLabel(DebugResourceType type,
343 GLint name,
344 std::string_view label) const;
345
346 void PushDebugGroup(const std::string& string) const;
347
348 void PopDebugGroup() const;
349
350 // Visible For testing.
351 std::optional<std::string> ComputeShaderWithDefines(
352 const fml::Mapping& mapping,
353 const std::vector<Scalar>& defines) const;
354
355 private:
356 bool is_valid_ = false;
357 std::unique_ptr<DescriptionGLES> description_;
358 std::shared_ptr<const CapabilitiesGLES> capabilities_;
359 GLint debug_label_max_length_ = 0;
360
361 ProcTableGLES(const ProcTableGLES&) = delete;
362
363 ProcTableGLES& operator=(const ProcTableGLES&) = delete;
364};
365
366} // namespace impeller
367
368#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PROC_TABLE_GLES_H_
GLenum type
uint32_t * target
const char * name
Definition fuchsia.cc:49
#define IMPELLER_PROC(proc_ivar)
#define FOR_EACH_IMPELLER_EXT_PROC(PROC)
#define FOR_EACH_IMPELLER_GLES3_PROC(PROC)
#define FOR_EACH_IMPELLER_DESKTOP_ONLY_PROC(PROC)
#define FOR_EACH_IMPELLER_ES_ONLY_PROC(PROC)
#define FOR_EACH_IMPELLER_PROC(PROC)

◆ FOR_EACH_IMPELLER_ES_ONLY_PROC

#define FOR_EACH_IMPELLER_ES_ONLY_PROC (   PROC)
Value:
PROC(ClearDepthf); \
PROC(DepthRangef);

Definition at line 245 of file proc_table_gles.h.

◆ FOR_EACH_IMPELLER_EXT_PROC

#define FOR_EACH_IMPELLER_EXT_PROC (   PROC)
Value:
PROC(DebugMessageControlKHR); \
PROC(DebugMessageCallbackKHR); \
PROC(DiscardFramebufferEXT); \
PROC(FramebufferTexture2DMultisampleEXT); \
PROC(PushDebugGroupKHR); \
PROC(PopDebugGroupKHR); \
PROC(ObjectLabelKHR); \
PROC(RenderbufferStorageMultisampleEXT); \
PROC(GenQueriesEXT); \
PROC(DeleteQueriesEXT); \
PROC(GetQueryObjectui64vEXT); \
PROC(BeginQueryEXT); \
PROC(EndQueryEXT); \
PROC(GetQueryObjectuivEXT); \
PROC(BlitFramebufferANGLE);

Definition at line 269 of file proc_table_gles.h.

◆ FOR_EACH_IMPELLER_GLES3_PROC

#define FOR_EACH_IMPELLER_GLES3_PROC (   PROC)
Value:
PROC(FenceSync); \
PROC(DeleteSync); \
PROC(GetActiveUniformBlockiv); \
PROC(GetActiveUniformBlockName); \
PROC(GetUniformBlockIndex); \
PROC(UniformBlockBinding); \
PROC(BindBufferRange); \
PROC(WaitSync); \
PROC(RenderbufferStorageMultisample) \
PROC(BlitFramebuffer);

Definition at line 257 of file proc_table_gles.h.

◆ FOR_EACH_IMPELLER_PROC

#define FOR_EACH_IMPELLER_PROC (   PROC)

Definition at line 149 of file proc_table_gles.h.

◆ IMPELLER_PROC

#define IMPELLER_PROC (   name)     GLProc<decltype(gl##name)> name = {"gl" #name, nullptr};

Definition at line 304 of file proc_table_gles.h.

305 {"gl" #name, nullptr};

◆ IP_ENABLE_GLES_LABELING

#define IP_ENABLE_GLES_LABELING   false

Enable to allow GLES to push/pop labels for usage in GPU traces.

Definition at line 20 of file proc_table_gles.h.