[Impeller] Remove implicit calls to glGetError in opt modes. (flutter/engine#54016)

This many explicit calls are all but useless unless you are doing bringup. And we do that in unopt modes anyway. Having this on in even the debug and profile opt modes was turning out to be pretty egregious.
This commit is contained in:
Chinmay Garde 2024-07-22 10:16:02 -07:00 committed by GitHub
parent 508890ef88
commit 3a10aabff9

View File

@ -74,14 +74,14 @@ struct GLProc {
/// ///
template <class... Args> template <class... Args>
auto operator()(Args&&... args) const { auto operator()(Args&&... args) const {
#ifdef IMPELLER_DEBUG #if defined(IMPELLER_DEBUG) && !defined(NDEBUG)
AutoErrorCheck error(error_fn, name); AutoErrorCheck error(error_fn, name);
// We check for the existence of extensions, and reset the function pointer // We check for the existence of extensions, and reset the function pointer
// but it's still called unconditionally below, and will segfault. This // but it's still called unconditionally below, and will segfault. This
// validation log will at least give us a hint as to what's going on. // validation log will at least give us a hint as to what's going on.
FML_CHECK(IsAvailable()) << "GL function " << name << " is not available. " FML_CHECK(IsAvailable()) << "GL function " << name << " is not available. "
<< "This is likely due to a missing extension."; << "This is likely due to a missing extension.";
#endif // IMPELLER_DEBUG #endif // defined(IMPELLER_DEBUG) && !defined(NDEBUG)
return function(std::forward<Args>(args)...); return function(std::forward<Args>(args)...);
} }