From d1c5db388a5b05aa6f0ef511df3c98632bad15e8 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Thu, 19 May 2022 09:25:19 +0100 Subject: [PATCH] Tweak METAL helper macros METAL_NOT_HOOKED Get class name directly from self pointer instead of getting the class type from self and then the class name from the class type Change the log to be an RDCERR instead of an RDCWARN METAL_NOT_IMPLEMENTED_ONCE Change the log to be an RDCWARN instead of RDCDEBUG to match METAL_NOT_IMPLEMENTED macro --- renderdoc/driver/metal/metal_common.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/renderdoc/driver/metal/metal_common.h b/renderdoc/driver/metal/metal_common.h index 4508cc4a6..e8b2c95cb 100644 --- a/renderdoc/driver/metal/metal_common.h +++ b/renderdoc/driver/metal/metal_common.h @@ -162,10 +162,10 @@ DECLARE_REFLECTION_ENUM(MetalChunk); #define IsReplayingAndReading() (ser.IsReading() && IsReplayMode(m_Device->GetState())) #ifdef __OBJC__ -#define METAL_NOT_HOOKED() \ - do \ - { \ - RDCWARN("Metal %s %s not hooked", class_getName([self class]), sel_getName(_cmd)); \ +#define METAL_NOT_HOOKED() \ + do \ + { \ + RDCERR("Metal %s %s not hooked", object_getClassName(self), sel_getName(_cmd)); \ } while((void)0, 0) #endif @@ -178,11 +178,11 @@ DECLARE_REFLECTION_ENUM(MetalChunk); // similar to RDCUNIMPLEMENTED but for things that are hit often so we don't want to fire the // debugbreak. -#define METAL_NOT_IMPLEMENTED_ONCE(...) \ - do \ - { \ - static bool msgprinted = false; \ - if(!msgprinted) \ - RDCDEBUG("Metal '%s' not implemented - " __VA_ARGS__, __PRETTY_FUNCTION__); \ - msgprinted = true; \ +#define METAL_NOT_IMPLEMENTED_ONCE(...) \ + do \ + { \ + static bool msgprinted = false; \ + if(!msgprinted) \ + RDCWARN("Metal '%s' not implemented - " __VA_ARGS__, __PRETTY_FUNCTION__); \ + msgprinted = true; \ } while((void)0, 0)