From 0f7875a2249911d5a80dec8d18d6aef1f38e16a9 Mon Sep 17 00:00:00 2001 From: Camille Martel Date: Thu, 28 May 2020 15:12:03 -0700 Subject: [PATCH] Don't call CheckImplicitThread when GL hook is disabled --- renderdoc/driver/gl/gl_hooks.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/renderdoc/driver/gl/gl_hooks.cpp b/renderdoc/driver/gl/gl_hooks.cpp index 99945aacb..5462c436d 100644 --- a/renderdoc/driver/gl/gl_hooks.cpp +++ b/renderdoc/driver/gl/gl_hooks.cpp @@ -87,18 +87,24 @@ int ScopedPrinter::depth = 0; // This checks that we're not infinite looping by calling our own hooks from ourselves. Mostly // useful on android where you can only debug by printf and the stack dumps are often corrupted when // the callstack overflows. -#define SCOPED_GLCALL(funcname) \ - SCOPED_LOCK(glLock); \ - gl_CurChunk = GLChunk::funcname; \ - glhook.driver->CheckImplicitThread(); \ +#define SCOPED_GLCALL(funcname) \ + SCOPED_LOCK(glLock); \ + gl_CurChunk = GLChunk::funcname; \ + if(glhook.enabled) \ + { \ + glhook.driver->CheckImplicitThread(); \ + } \ ScopedPrinter CONCAT(scopedprint, __LINE__)(STRINGIZE(funcname)); #else -#define SCOPED_GLCALL(funcname) \ - SCOPED_LOCK(glLock); \ - gl_CurChunk = GLChunk::funcname; \ - glhook.driver->CheckImplicitThread(); +#define SCOPED_GLCALL(funcname) \ + SCOPED_LOCK(glLock); \ + gl_CurChunk = GLChunk::funcname; \ + if(glhook.enabled) \ + { \ + glhook.driver->CheckImplicitThread(); \ + } #endif