2022-02-11 13:53:21 +01:00
|
|
|
/* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
* Copyright 2011-2022 Blender Foundation */
|
2014-09-08 18:01:24 +06:00
|
|
|
|
|
|
|
|
#ifndef __UTIL_LOGGING_H__
|
|
|
|
|
#define __UTIL_LOGGING_H__
|
|
|
|
|
|
|
|
|
|
#if defined(WITH_CYCLES_LOGGING) && !defined(__KERNEL_GPU__)
|
2018-03-23 14:32:18 +01:00
|
|
|
# include <gflags/gflags.h>
|
2014-09-08 18:01:24 +06:00
|
|
|
# include <glog/logging.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2017-07-05 20:39:34 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
|
2014-09-08 18:01:24 +06:00
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
|
|
#if !defined(WITH_CYCLES_LOGGING) || defined(__KERNEL_GPU__)
|
2017-07-05 12:01:12 +02:00
|
|
|
class StubStream {
|
|
|
|
|
public:
|
|
|
|
|
template<class T> StubStream &operator<<(const T &)
|
|
|
|
|
{
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
2014-09-08 18:01:24 +06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class LogMessageVoidify {
|
|
|
|
|
public:
|
|
|
|
|
LogMessageVoidify()
|
|
|
|
|
{
|
|
|
|
|
}
|
2021-07-29 14:27:26 +02:00
|
|
|
void operator&(const StubStream &)
|
2017-07-05 12:01:12 +02:00
|
|
|
{
|
|
|
|
|
}
|
2014-09-08 18:01:24 +06:00
|
|
|
};
|
|
|
|
|
|
2018-11-09 12:08:51 +01:00
|
|
|
# define LOG_SUPPRESS() (true) ? ((void)0) : LogMessageVoidify() & StubStream()
|
2014-09-08 18:01:24 +06:00
|
|
|
# define LOG(severity) LOG_SUPPRESS()
|
|
|
|
|
# define VLOG(severity) LOG_SUPPRESS()
|
2019-11-05 14:19:33 +01:00
|
|
|
# define VLOG_IF(severity, condition) LOG_SUPPRESS()
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
# define VLOG_IS_ON(severity) false
|
2021-07-29 14:27:26 +02:00
|
|
|
|
|
|
|
|
# define CHECK(expression) LOG_SUPPRESS()
|
|
|
|
|
|
|
|
|
|
# define CHECK_NOTNULL(expression) LOG_SUPPRESS()
|
|
|
|
|
# define CHECK_NULL(expression) LOG_SUPPRESS()
|
|
|
|
|
|
|
|
|
|
# define CHECK_NEAR(actual, expected, eps) LOG_SUPPRESS()
|
|
|
|
|
|
|
|
|
|
# define CHECK_GE(a, b) LOG_SUPPRESS()
|
|
|
|
|
# define CHECK_NE(a, b) LOG_SUPPRESS()
|
|
|
|
|
# define CHECK_EQ(a, b) LOG_SUPPRESS()
|
|
|
|
|
# define CHECK_GT(a, b) LOG_SUPPRESS()
|
|
|
|
|
# define CHECK_LT(a, b) LOG_SUPPRESS()
|
|
|
|
|
# define CHECK_LE(a, b) LOG_SUPPRESS()
|
|
|
|
|
|
|
|
|
|
# define DCHECK(expression) LOG_SUPPRESS()
|
|
|
|
|
|
|
|
|
|
# define DCHECK_NOTNULL(expression) LOG_SUPPRESS()
|
|
|
|
|
# define DCHECK_NULL(expression) LOG_SUPPRESS()
|
|
|
|
|
|
|
|
|
|
# define DCHECK_NEAR(actual, expected, eps) LOG_SUPPRESS()
|
|
|
|
|
|
|
|
|
|
# define DCHECK_GE(a, b) LOG_SUPPRESS()
|
|
|
|
|
# define DCHECK_NE(a, b) LOG_SUPPRESS()
|
|
|
|
|
# define DCHECK_EQ(a, b) LOG_SUPPRESS()
|
|
|
|
|
# define DCHECK_GT(a, b) LOG_SUPPRESS()
|
|
|
|
|
# define DCHECK_LT(a, b) LOG_SUPPRESS()
|
|
|
|
|
# define DCHECK_LE(a, b) LOG_SUPPRESS()
|
|
|
|
|
|
|
|
|
|
# define LOG_ASSERT(expression) LOG_SUPPRESS()
|
2014-09-08 18:01:24 +06:00
|
|
|
#endif
|
|
|
|
|
|
2022-06-16 19:39:13 +02:00
|
|
|
/* Verbose logging categories. */
|
|
|
|
|
|
|
|
|
|
/* Warnings. */
|
|
|
|
|
#define VLOG_WARNING VLOG(1)
|
|
|
|
|
/* Info about devices, scene contents and features used. */
|
|
|
|
|
#define VLOG_INFO VLOG(2)
|
|
|
|
|
#define VLOG_INFO_IS_ON VLOG_IS_ON(2)
|
|
|
|
|
/* Work being performed and timing/memory stats about that work. */
|
|
|
|
|
#define VLOG_WORK VLOG(3)
|
|
|
|
|
#define VLOG_WORK_IS_ON VLOG_IS_ON(3)
|
|
|
|
|
/* Detailed device timing stats. */
|
|
|
|
|
#define VLOG_DEVICE_STATS VLOG(4)
|
|
|
|
|
#define VLOG_DEVICE_STATS_IS_ON VLOG_IS_ON(4)
|
|
|
|
|
/* Verbose debug messages. */
|
|
|
|
|
#define VLOG_DEBUG VLOG(5)
|
|
|
|
|
#define VLOG_DEBUG_IS_ON VLOG_IS_ON(5)
|
2016-01-06 20:25:19 +05:00
|
|
|
|
2017-02-20 13:02:11 +01:00
|
|
|
struct int2;
|
2014-11-01 03:09:46 +05:00
|
|
|
struct float3;
|
2014-09-08 18:01:24 +06:00
|
|
|
|
2014-11-16 01:12:19 +05:00
|
|
|
void util_logging_init(const char *argv0);
|
2018-11-09 12:01:38 +01:00
|
|
|
void util_logging_start();
|
2014-11-16 01:12:19 +05:00
|
|
|
void util_logging_verbosity_set(int verbosity);
|
|
|
|
|
|
2017-02-20 13:02:11 +01:00
|
|
|
std::ostream &operator<<(std::ostream &os, const int2 &value);
|
2014-09-08 18:01:24 +06:00
|
|
|
std::ostream &operator<<(std::ostream &os, const float3 &value);
|
|
|
|
|
|
|
|
|
|
CCL_NAMESPACE_END
|
|
|
|
|
|
|
|
|
|
#endif /* __UTIL_LOGGING_H__ */
|