This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,14 @@ config("impeller_public_config") {
2525 defines += [ " IMPELLER_ENABLE_OPENGLES=1" ]
2626 }
2727
28+ if (impeller_trace_all_gl_calls ) {
29+ defines += [ " IMPELLER_TRACE_ALL_GL_CALLS" ]
30+ }
31+
32+ if (impeller_error_check_all_gl_calls ) {
33+ defines += [ " IMPELLER_ERROR_CHECK_ALL_GL_CALLS" ]
34+ }
35+
2836 if (is_win ) {
2937 defines += [
3038 " _USE_MATH_DEFINES" ,
Original file line number Diff line number Diff line change 1111#include " flutter/fml/logging.h"
1212#include " flutter/fml/macros.h"
1313#include " flutter/fml/mapping.h"
14+ #include " flutter/fml/trace_event.h"
1415#include " impeller/renderer/backend/gles/capabilities_gles.h"
1516#include " impeller/renderer/backend/gles/description_gles.h"
1617#include " impeller/renderer/backend/gles/gles.h"
@@ -64,7 +65,12 @@ struct GLProc {
6465 // /
6566 template <class ... Args>
6667 auto operator ()(Args&&... args) const {
68+ #ifdef IMPELLER_ERROR_CHECK_ALL_GL_CALLS
6769 AutoErrorCheck error (error_fn, name);
70+ #endif // IMPELLER_ERROR_CHECK_ALL_GL_CALLS
71+ #ifdef IMPELLER_TRACE_ALL_GL_CALLS
72+ TRACE_EVENT0 (" impeller" , name);
73+ #endif // IMPELLER_TRACE_ALL_GL_CALLS
6874 return function (std::forward<Args>(args)...);
6975 }
7076
Original file line number Diff line number Diff line change @@ -23,6 +23,13 @@ declare_args() {
2323 # If this is the empty string, impellerc will be built.
2424 # If it is non-empty, it should be the absolute path to impellerc.
2525 impeller_use_prebuilt_impellerc = " "
26+
27+ # If enabled, all OpenGL calls will be traced. Because additional trace
28+ # overhead may be substantial, this is not enabled by default.
29+ impeller_trace_all_gl_calls = false
30+
31+ # Call glGetError after each OpenGL call and log failures.
32+ impeller_error_check_all_gl_calls = is_debug
2633}
2734
2835declare_args () {
You can’t perform that action at this time.
0 commit comments