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 255 of file proc_table_gles.h.

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

◆ FOR_EACH_IMPELLER_ES_ONLY_PROC

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

Definition at line 247 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 272 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); \
PROC(InvalidateFramebuffer);

Definition at line 259 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 307 of file proc_table_gles.h.

308 {"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.