mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
glGetError() polling loops now only when debug switch is on
This commit is contained in:
@@ -129,6 +129,10 @@ static bool NativeDebugLoggingEnabled() {
|
||||
return g_native_debug_logging_enabled.load() && !g_native_debug_log_path.empty();
|
||||
}
|
||||
|
||||
extern "C" bool xemu_android_is_debug_logging_enabled(void) {
|
||||
return NativeDebugLoggingEnabled();
|
||||
}
|
||||
|
||||
static void AppendNativeDebugLog(const char* level, const char* message) {
|
||||
if (!NativeDebugLoggingEnabled() || !level || !message || !g_native_debug_log_mutex) {
|
||||
return;
|
||||
|
||||
@@ -31,10 +31,16 @@
|
||||
#endif
|
||||
|
||||
#ifdef __ANDROID__
|
||||
extern bool xemu_android_is_debug_logging_enabled(void);
|
||||
|
||||
static void gl_log_errors(const char *ctx)
|
||||
{
|
||||
GLenum gl_err;
|
||||
|
||||
if (!xemu_android_is_debug_logging_enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
while ((gl_err = glGetError()) != GL_NO_ERROR) {
|
||||
__android_log_print(ANDROID_LOG_WARN, "xemu-android",
|
||||
"GL error 0x%X at %s", gl_err, ctx);
|
||||
|
||||
@@ -31,11 +31,17 @@
|
||||
#endif
|
||||
|
||||
#ifdef __ANDROID__
|
||||
extern bool xemu_android_is_debug_logging_enabled(void);
|
||||
|
||||
static bool android_log_and_drain_gl_errors(const char *ctx)
|
||||
{
|
||||
GLenum err;
|
||||
bool had_error = false;
|
||||
|
||||
if (!xemu_android_is_debug_logging_enabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
while ((err = glGetError()) != GL_NO_ERROR) {
|
||||
__android_log_print(ANDROID_LOG_WARN, "xemu-android",
|
||||
"GL error 0x%X at %s", err, ctx);
|
||||
@@ -75,6 +81,10 @@ static bool android_drain_gl_errors_silent(void)
|
||||
GLenum err;
|
||||
bool had_error = false;
|
||||
|
||||
if (!xemu_android_is_debug_logging_enabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
while ((err = glGetError()) != GL_NO_ERROR) {
|
||||
had_error = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user