2023-06-14 16:52:36 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2024-12-26 17:53:56 +01:00
|
|
|
#pragma once
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2016-01-12 16:00:48 +05:00
|
|
|
#include <cassert>
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2021-10-24 14:19:19 +02:00
|
|
|
#include "bvh/params.h"
|
2018-01-19 10:59:58 +01:00
|
|
|
|
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:
|
|
|
|
|
/* 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. */
|
2022-08-11 16:59:29 +02:00
|
|
|
bool avx2 = true;
|
2024-02-09 17:25:58 +01:00
|
|
|
bool sse42 = true;
|
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()
|
|
|
|
|
{
|
2024-02-09 17:25:58 +01:00
|
|
|
return has_sse42() && avx2;
|
2018-01-19 15:47:53 +01:00
|
|
|
}
|
2024-02-09 17:25:58 +01:00
|
|
|
bool has_sse42()
|
2018-01-19 15:47:53 +01:00
|
|
|
{
|
2024-02-26 14:49:19 +01:00
|
|
|
return sse42;
|
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
|
|
|
*/
|
2022-08-11 16:59:29 +02:00
|
|
|
BVHLayout bvh_layout = BVH_LAYOUT_AUTO;
|
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. */
|
2022-08-11 16:59:29 +02:00
|
|
|
bool adaptive_compile = false;
|
2016-05-06 22:34:15 +02:00
|
|
|
};
|
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();
|
|
|
|
|
|
2022-03-31 13:00:10 +11:00
|
|
|
/* Whether adaptive feature based runtime compile is enabled or not. */
|
2022-08-11 16:59:29 +02:00
|
|
|
bool adaptive_compile = false;
|
2021-09-28 16:51:14 +02:00
|
|
|
};
|
|
|
|
|
|
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. */
|
2022-08-11 16:59:29 +02:00
|
|
|
bool use_debug = false;
|
2016-01-12 16:00:48 +05:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-11-18 14:25:05 +01:00
|
|
|
/* Descriptor of Metal feature-set to be used. */
|
|
|
|
|
struct Metal {
|
|
|
|
|
Metal();
|
|
|
|
|
|
|
|
|
|
/* Reset flags to their defaults. */
|
|
|
|
|
void reset();
|
|
|
|
|
|
2022-03-31 13:00:10 +11:00
|
|
|
/* Whether adaptive feature based runtime compile is enabled or not. */
|
2022-08-11 16:59:29 +02:00
|
|
|
bool adaptive_compile = false;
|
2023-02-06 11:16:02 +00:00
|
|
|
|
|
|
|
|
/* Whether local atomic sorting is enabled or not. */
|
|
|
|
|
bool use_local_atomic_sort = true;
|
2023-05-30 11:12:05 +02:00
|
|
|
|
|
|
|
|
/* Whether nanovdb is enabled or not. */
|
|
|
|
|
bool use_nanovdb = true;
|
|
|
|
|
|
|
|
|
|
/* Whether async PSO creation is enabled or not. */
|
|
|
|
|
bool use_async_pso_creation = true;
|
2025-04-03 16:24:04 +02:00
|
|
|
|
|
|
|
|
/* Whether to use per-component motion interpolation.
|
|
|
|
|
* TODO: Enable by default when "multi step velocity motion blur" fail is fixed.
|
|
|
|
|
*/
|
|
|
|
|
bool use_metalrt_pcmi = false;
|
2021-11-18 14:25:05 +01: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;
|
|
|
|
|
|
2021-11-18 14:25:05 +01:00
|
|
|
/* Requested Metal flags. */
|
|
|
|
|
Metal metal;
|
|
|
|
|
|
2016-01-12 16:00:48 +05:00
|
|
|
private:
|
2024-12-26 17:53:59 +01:00
|
|
|
DebugFlags() = default;
|
2016-01-12 16:00:48 +05:00
|
|
|
|
|
|
|
|
public:
|
2024-12-29 17:32:00 +01:00
|
|
|
explicit DebugFlags(const DebugFlags & /*other*/) = delete;
|
|
|
|
|
void operator=(const DebugFlags & /*other*/) = delete;
|
2016-01-12 16:00:48 +05:00
|
|
|
};
|
|
|
|
|
|
2024-12-26 17:53:59 +01:00
|
|
|
using DebugFlagsRef = DebugFlags &;
|
|
|
|
|
using DebugFlagsConstRef = const DebugFlags &;
|
2016-01-12 16:00:48 +05:00
|
|
|
|
|
|
|
|
inline DebugFlags &DebugFlags()
|
|
|
|
|
{
|
|
|
|
|
return DebugFlags::get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCL_NAMESPACE_END
|