This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/gpu/metal/mtl_debug.hh
Campbell Barton 2a89509e45 License headers: add missing license headers
Add missing license headers based on files in the same directory.
2022-05-04 13:58:53 +10:00

61 lines
1.3 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*/
#pragma once
#include "BKE_global.h"
#include "CLG_log.h"
namespace blender {
namespace gpu {
namespace debug {
extern CLG_LogRef LOG;
/* Initialize debugging. */
void mtl_debug_init();
/* Using Macro's instead of variadic template due to non-string-literal
* warning for CLG_logf when indirectly passing format string. */
#define EXPAND_ARGS(...) , ##__VA_ARGS__
#define MTL_LOG_ERROR(info, ...) \
{ \
if (G.debug & G_DEBUG_GPU) { \
CLG_logf(debug::LOG.type, \
CLG_SEVERITY_ERROR, \
"[Metal Viewport Error]", \
"", \
info EXPAND_ARGS(__VA_ARGS__)); \
} \
BLI_assert(false); \
}
#define MTL_LOG_WARNING(info, ...) \
{ \
if (G.debug & G_DEBUG_GPU) { \
CLG_logf(debug::LOG.type, \
CLG_SEVERITY_WARN, \
"[Metal Viewport Warning]", \
"", \
info EXPAND_ARGS(__VA_ARGS__)); \
} \
}
#define MTL_LOG_INFO(info, ...) \
{ \
if (G.debug & G_DEBUG_GPU) { \
CLG_logf(debug::LOG.type, \
CLG_SEVERITY_INFO, \
"[Metal Viewport Info]", \
"", \
info EXPAND_ARGS(__VA_ARGS__)); \
} \
}
} // namespace debug
} // namespace gpu
} // namespace blender