Flutter Engine
 
Loading...
Searching...
No Matches
proc_table_gles.h File Reference
#include <functional>
#include <string>
#include <string_view>
#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 240 of file proc_table_gles.h.

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

◆ FOR_EACH_IMPELLER_PROC

#define FOR_EACH_IMPELLER_PROC (   PROC)

Definition at line 136 of file proc_table_gles.h.

◆ IMPELLER_PROC

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

Definition at line 290 of file proc_table_gles.h.

291 {"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 19 of file proc_table_gles.h.