From 2f79d1c0584f4d72984e56db1f5878be3360e044 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 19 Jan 2018 10:59:58 +0100 Subject: 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 --- intern/cycles/kernel/kernel_types.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'intern/cycles/kernel/kernel_types.h') diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 4f655784044..1e1a4f34650 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -1344,13 +1344,23 @@ typedef struct KernelIntegrator { } KernelIntegrator; static_assert_align(KernelIntegrator, 16); +typedef enum KernelBVHLayout { + BVH_LAYOUT_NONE = 0, + + BVH_LAYOUT_BVH2 = (1 << 0), + BVH_LAYOUT_BVH4 = (1 << 1), + + BVH_LAYOUT_DEFAULT = BVH_LAYOUT_BVH4, + BVH_LAYOUT_ALL = (unsigned int)(-1), +} KernelBVHLayout; + typedef struct KernelBVH { /* root node */ int root; int have_motion; int have_curves; int have_instancing; - int use_qbvh; + int bvh_layout; int use_bvh_steps; int pad1, pad2; } KernelBVH; -- cgit v1.2.3