Listing the "Blender Foundation" as copyright holder implied the Blender Foundation holds copyright to files which may include work from many developers. While keeping copyright on headers makes sense for isolated libraries, Blender's own code may be refactored or moved between files in a way that makes the per file copyright holders less meaningful. Copyright references to the "Blender Foundation" have been replaced with "Blender Authors", with the exception of `./extern/` since these this contains libraries which are more isolated, any changed to license headers there can be handled on a case-by-case basis. Some directories in `./intern/` have also been excluded: - `./intern/cycles/` it's own `AUTHORS` file is planned. - `./intern/opensubdiv/`. An "AUTHORS" file has been added, using the chromium projects authors file as a template. Design task: #110784 Ref !110783.
60 lines
1.4 KiB
C++
60 lines
1.4 KiB
C++
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "BKE_global.h"
|
|
#include "CLG_log.h"
|
|
|
|
/** Options for organizing Metal GPU debug captures. */
|
|
/* Maximum nested debug group depth. Groups beyond this will still have the pass name pulled into
|
|
* the RenderCommandEncoder, but will not display in the trace.
|
|
* Use -1 for unlimited. */
|
|
#define METAL_DEBUG_CAPTURE_MAX_NESTED_GROUPS -1
|
|
|
|
/* Whether empty debug groups should be hidden. */
|
|
#define METAL_DEBUG_CAPTURE_HIDE_EMPTY 0
|
|
|
|
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) { \
|
|
CLOG_ERROR(&debug::LOG, info EXPAND_ARGS(__VA_ARGS__)); \
|
|
} \
|
|
BLI_assert(false); \
|
|
}
|
|
|
|
#define MTL_LOG_WARNING(info, ...) \
|
|
{ \
|
|
if (G.debug & G_DEBUG_GPU) { \
|
|
CLOG_WARN(&debug::LOG, info EXPAND_ARGS(__VA_ARGS__)); \
|
|
} \
|
|
}
|
|
|
|
#define MTL_LOG_INFO(info, ...) \
|
|
{ \
|
|
if (G.debug & G_DEBUG_GPU) { \
|
|
CLOG_INFO(&debug::LOG, 2, info EXPAND_ARGS(__VA_ARGS__)); \
|
|
} \
|
|
}
|
|
|
|
} // namespace debug
|
|
} // namespace gpu
|
|
} // namespace blender
|