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

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

◆ FOR_EACH_IMPELLER_EXT_PROC

#define FOR_EACH_IMPELLER_EXT_PROC (   PROC)
Value:
PROC(DebugMessageControlKHR); \
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 257 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 245 of file proc_table_gles.h.

◆ FOR_EACH_IMPELLER_PROC

#define FOR_EACH_IMPELLER_PROC (   PROC)

Definition at line 137 of file proc_table_gles.h.

◆ IMPELLER_PROC

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

Definition at line 291 of file proc_table_gles.h.

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