Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mtl_debug.hh « metal « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 455a6da5ddcb4b2c6cf749f624762b57e995e1ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/** \file
 * \ingroup gpu
 */

#pragma once

#include "BKE_global.h"
#include "CLG_log.h"

namespace blender {
namespace gpu {
namespace debug {

extern CLG_LogRef LOG;

/* Initialise 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