diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-19 12:59:58 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-22 19:19:20 +0300 |
commit | 2f79d1c0584f4d72984e56db1f5878be3360e044 (patch) | |
tree | f2385b9834d7a9e0c15be92ca5356f4bc91aa247 /intern/cycles/util | |
parent | 0f69026b1c3c07b203aeba658048f1129e41b116 (diff) |
Cycles: Replace use_qbvh boolean flag with an enum-based property
This was we can introduce other types of BVH, for example, wider ones, without
causing too much mess around boolean flags.
Thoughs:
- Ideally device info should probably return bitflag of what BVH types it
supports.
It is possible to implement based on simple logic in device/ and mesh.cpp,
rest of the changes will stay the same.
- Not happy with workarounds in util_debug and duplicated enum in kernel.
Maybe enbum should be stores in kernel, but then it's kind of weird to include
kernel types from utils. Soudns some cyclkic dependency.
Reviewers: brecht, maxim_d33
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D3011
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_debug.cpp | 20 | ||||
-rw-r--r-- | intern/cycles/util/util_debug.h | 10 |
2 files changed, 19 insertions, 11 deletions
diff --git a/intern/cycles/util/util_debug.cpp b/intern/cycles/util/util_debug.cpp index eb078d69252..9a66a372822 100644 --- a/intern/cycles/util/util_debug.cpp +++ b/intern/cycles/util/util_debug.cpp @@ -18,6 +18,8 @@ #include <stdlib.h> +#include "bvh/bvh_params.h" + #include "util/util_logging.h" #include "util/util_string.h" @@ -29,7 +31,7 @@ DebugFlags::CPU::CPU() sse41(true), sse3(true), sse2(true), - qbvh(true), + bvh_layout(BVH_LAYOUT_DEFAULT), split_kernel(false) { reset(); @@ -55,7 +57,7 @@ void DebugFlags::CPU::reset() #undef STRINGIFY #undef CHECK_CPU_FLAGS - qbvh = true; + bvh_layout = BVH_LAYOUT_DEFAULT; split_kernel = false; } @@ -139,13 +141,13 @@ std::ostream& operator <<(std::ostream &os, DebugFlagsConstRef debug_flags) { os << "CPU flags:\n" - << " AVX2 : " << string_from_bool(debug_flags.cpu.avx2) << "\n" - << " AVX : " << string_from_bool(debug_flags.cpu.avx) << "\n" - << " SSE4.1 : " << string_from_bool(debug_flags.cpu.sse41) << "\n" - << " SSE3 : " << string_from_bool(debug_flags.cpu.sse3) << "\n" - << " SSE2 : " << string_from_bool(debug_flags.cpu.sse2) << "\n" - << " QBVH : " << string_from_bool(debug_flags.cpu.qbvh) << "\n" - << " Split : " << string_from_bool(debug_flags.cpu.split_kernel) << "\n"; + << " AVX2 : " << string_from_bool(debug_flags.cpu.avx2) << "\n" + << " AVX : " << string_from_bool(debug_flags.cpu.avx) << "\n" + << " SSE4.1 : " << string_from_bool(debug_flags.cpu.sse41) << "\n" + << " SSE3 : " << string_from_bool(debug_flags.cpu.sse3) << "\n" + << " SSE2 : " << string_from_bool(debug_flags.cpu.sse2) << "\n" + << " BVH layout : " << bvh_layout_name(debug_flags.cpu.bvh_layout) << "\n" + << " Split : " << string_from_bool(debug_flags.cpu.split_kernel) << "\n"; os << "CUDA flags:\n" << " Adaptive Compile: " << string_from_bool(debug_flags.cuda.adaptive_compile) << "\n"; diff --git a/intern/cycles/util/util_debug.h b/intern/cycles/util/util_debug.h index ec38cd373ba..f17f8a560ee 100644 --- a/intern/cycles/util/util_debug.h +++ b/intern/cycles/util/util_debug.h @@ -20,6 +20,8 @@ #include <cassert> #include <iostream> +#include "bvh/bvh_params.h" + CCL_NAMESPACE_BEGIN /* Global storage for all sort of flags used to fine-tune behavior of particular @@ -54,8 +56,12 @@ public: bool has_sse3() { return has_sse2() && sse3; } bool has_sse2() { return sse2; } - /* Whether QBVH usage is allowed or not. */ - bool qbvh; + /* Requested BVH size. + * + * Rendering will use widest possible BVH which is below or equal + * this one. + */ + BVHLayout bvh_layout; /* Whether split kernel is used */ bool split_kernel; |