Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Mours <pmours@nvidia.com>2019-09-12 15:46:47 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-09-13 12:46:22 +0300
commit53932f1f068501bfb095c407a7777a964dc5ec1c (patch)
tree82dfda8cd109d61ab0bf3601e5caf140001146c8 /intern/cycles/kernel/kernel_types.h
parent7eb293a37b868ffab53be056b85d6e1f5444f62f (diff)
Cycles: add Optix support in the kernel
This adds all the kernel side changes for the Optix backend. Ref D5363
Diffstat (limited to 'intern/cycles/kernel/kernel_types.h')
-rw-r--r--intern/cycles/kernel/kernel_types.h37
1 files changed, 30 insertions, 7 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index f0054691b54..7aef34b00a2 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -143,6 +143,13 @@ CCL_NAMESPACE_BEGIN
# endif
#endif /* __KERNEL_CUDA__ */
+#ifdef __KERNEL_OPTIX__
+# undef __BAKING__
+# undef __BRANCHED_PATH__
+/* TODO(pmours): Cannot use optixTrace in non-inlined functions */
+# undef __SHADER_RAYTRACE__
+#endif /* __KERNEL_OPTIX__ */
+
#ifdef __KERNEL_OPENCL__
#endif /* __KERNEL_OPENCL__ */
@@ -1056,6 +1063,15 @@ typedef struct PathState {
#endif
} PathState;
+#ifdef __VOLUME__
+typedef struct VolumeState {
+# ifdef __SPLIT_KERNEL__
+# else
+ PathState ps;
+# endif
+} VolumeState;
+#endif
+
/* Struct to gather multiple nearby intersections. */
typedef struct LocalIntersection {
Ray ray;
@@ -1343,9 +1359,12 @@ typedef enum KernelBVHLayout {
BVH_LAYOUT_BVH2 = (1 << 0),
BVH_LAYOUT_BVH4 = (1 << 1),
BVH_LAYOUT_BVH8 = (1 << 2),
+
BVH_LAYOUT_EMBREE = (1 << 3),
+ BVH_LAYOUT_OPTIX = (1 << 4),
+
BVH_LAYOUT_DEFAULT = BVH_LAYOUT_BVH8,
- BVH_LAYOUT_ALL = (unsigned int)(-1),
+ BVH_LAYOUT_ALL = (unsigned int)(~0u),
} KernelBVHLayout;
typedef struct KernelBVH {
@@ -1357,14 +1376,18 @@ typedef struct KernelBVH {
int bvh_layout;
int use_bvh_steps;
- /* Embree */
-#ifdef __EMBREE__
+ /* Custom BVH */
+#ifdef __KERNEL_OPTIX__
+ OptixTraversableHandle scene;
+#else
+# ifdef __EMBREE__
RTCScene scene;
-# ifndef __KERNEL_64_BIT__
- int pad1;
+# ifndef __KERNEL_64_BIT__
+ int pad2;
+# endif
+# else
+ int scene, pad2;
# endif
-#else
- int pad1, pad2;
#endif
} KernelBVH;
static_assert_align(KernelBVH, 16);