2011-04-27 11:58:34 +00:00
|
|
|
/*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Copyright 2011-2013 Blender Foundation
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
2014-12-25 02:50:24 +01:00
|
|
|
* limitations under the License.
|
2011-04-27 11:58:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UTIL_DEBUG_H__
|
|
|
|
#define __UTIL_DEBUG_H__
|
|
|
|
|
2016-01-12 16:00:48 +05:00
|
|
|
#include <cassert>
|
|
|
|
#include <iostream>
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2018-01-19 10:59:58 +01:00
|
|
|
#include "bvh/bvh_params.h"
|
|
|
|
|
2016-01-12 16:00:48 +05:00
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
/* Global storage for all sort of flags used to fine-tune behavior of particular
|
|
|
|
* areas for the development purposes, without officially exposing settings to
|
|
|
|
* the interface.
|
|
|
|
*/
|
|
|
|
class DebugFlags {
|
|
|
|
public:
|
2017-08-21 15:09:03 +02:00
|
|
|
/* Use static BVH in viewport, to match final render exactly. */
|
|
|
|
bool viewport_static_bvh;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-08-29 12:32:27 +02:00
|
|
|
bool running_inside_blender;
|
|
|
|
|
2016-01-12 16:00:48 +05:00
|
|
|
/* Descriptor of CPU feature-set to be used. */
|
|
|
|
struct CPU {
|
|
|
|
CPU();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-01-12 16:00:48 +05:00
|
|
|
/* Reset flags to their defaults. */
|
|
|
|
void reset();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-01-12 16:00:48 +05:00
|
|
|
/* Flags describing which instructions sets are allowed for use. */
|
|
|
|
bool avx2;
|
|
|
|
bool avx;
|
|
|
|
bool sse41;
|
|
|
|
bool sse3;
|
|
|
|
bool sse2;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-01-19 15:47:53 +01:00
|
|
|
/* Check functions to see whether instructions up to the given one
|
|
|
|
* are allowed for use.
|
|
|
|
*/
|
|
|
|
bool has_avx2()
|
|
|
|
{
|
|
|
|
return has_avx() && avx2;
|
|
|
|
}
|
|
|
|
bool has_avx()
|
|
|
|
{
|
|
|
|
return has_sse41() && avx;
|
|
|
|
}
|
|
|
|
bool has_sse41()
|
|
|
|
{
|
|
|
|
return has_sse3() && sse41;
|
|
|
|
}
|
|
|
|
bool has_sse3()
|
|
|
|
{
|
|
|
|
return has_sse2() && sse3;
|
|
|
|
}
|
|
|
|
bool has_sse2()
|
|
|
|
{
|
|
|
|
return sse2;
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
2020-06-10 18:55:33 +02:00
|
|
|
/* Requested BVH layout.
|
2018-01-19 10:59:58 +01:00
|
|
|
*
|
2020-06-10 18:55:33 +02:00
|
|
|
* By default the fastest will be used. For debugging the BVH used by other
|
|
|
|
* CPUs and GPUs can be selected here instead.
|
2018-01-19 10:59:58 +01:00
|
|
|
*/
|
|
|
|
BVHLayout bvh_layout;
|
2016-01-12 16:00:48 +05:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-05-06 22:34:15 +02:00
|
|
|
/* Descriptor of CUDA feature-set to be used. */
|
|
|
|
struct CUDA {
|
|
|
|
CUDA();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-05-06 22:34:15 +02:00
|
|
|
/* Reset flags to their defaults. */
|
|
|
|
void reset();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-05-06 22:34:15 +02:00
|
|
|
/* Whether adaptive feature based runtime compile is enabled or not.
|
2021-09-24 11:31:23 +10:00
|
|
|
* Requires the CUDA Toolkit and only works on Linux at the moment. */
|
2016-05-06 22:34:15 +02:00
|
|
|
bool adaptive_compile;
|
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-09-28 16:51:14 +02:00
|
|
|
/* Descriptor of HIP feature-set to be used. */
|
|
|
|
struct HIP {
|
|
|
|
HIP();
|
|
|
|
|
|
|
|
/* Reset flags to their defaults. */
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
/* Whether adaptive feature based runtime compile is enabled or not.*/
|
|
|
|
bool adaptive_compile;
|
|
|
|
};
|
|
|
|
|
2019-09-12 14:50:06 +02:00
|
|
|
/* Descriptor of OptiX feature-set to be used. */
|
|
|
|
struct OptiX {
|
|
|
|
OptiX();
|
|
|
|
|
|
|
|
/* Reset flags to their defaults. */
|
|
|
|
void reset();
|
|
|
|
|
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
|
|
|
/* Load OptiX module with debug capabilities. Will lower logging verbosity level, enable
|
|
|
|
* validations, and lower optimization level. */
|
|
|
|
bool use_debug;
|
2016-01-12 16:00:48 +05:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-01-12 16:00:48 +05:00
|
|
|
/* Get instance of debug flags registry. */
|
|
|
|
static DebugFlags &get()
|
|
|
|
{
|
|
|
|
static DebugFlags instance;
|
|
|
|
return instance;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-01-12 16:00:48 +05:00
|
|
|
/* Reset flags to their defaults. */
|
|
|
|
void reset();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-01-12 16:00:48 +05:00
|
|
|
/* Requested CPU flags. */
|
|
|
|
CPU cpu;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-05-06 22:34:15 +02:00
|
|
|
/* Requested CUDA flags. */
|
|
|
|
CUDA cuda;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-12 14:50:06 +02:00
|
|
|
/* Requested OptiX flags. */
|
|
|
|
OptiX optix;
|
|
|
|
|
2021-09-28 16:51:14 +02:00
|
|
|
/* Requested HIP flags. */
|
|
|
|
HIP hip;
|
|
|
|
|
2016-01-12 16:00:48 +05:00
|
|
|
private:
|
|
|
|
DebugFlags();
|
|
|
|
|
|
|
|
#if (__cplusplus > 199711L)
|
|
|
|
public:
|
2016-05-11 16:50:10 +02:00
|
|
|
explicit DebugFlags(DebugFlags const & /*other*/) = delete;
|
2016-01-12 16:00:48 +05:00
|
|
|
void operator=(DebugFlags const & /*other*/) = delete;
|
|
|
|
#else
|
|
|
|
private:
|
2016-05-11 16:50:10 +02:00
|
|
|
explicit DebugFlags(DebugFlags const & /*other*/);
|
2016-01-12 16:00:48 +05:00
|
|
|
void operator=(DebugFlags const & /*other*/);
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef DebugFlags &DebugFlagsRef;
|
2016-01-24 01:33:53 +05:00
|
|
|
typedef const DebugFlags &DebugFlagsConstRef;
|
2016-01-12 16:00:48 +05:00
|
|
|
|
|
|
|
inline DebugFlags &DebugFlags()
|
|
|
|
{
|
|
|
|
return DebugFlags::get();
|
|
|
|
}
|
|
|
|
|
|
|
|
std::ostream &operator<<(std::ostream &os, DebugFlagsConstRef debug_flags);
|
|
|
|
|
|
|
|
CCL_NAMESPACE_END
|
|
|
|
|
|
|
|
#endif /* __UTIL_DEBUG_H__ */
|