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>2021-11-24 17:19:02 +0300
committerPatrick Mours <pmours@nvidia.com>2021-11-24 18:33:04 +0300
commit7a97e925fde585ffafd7bdfe310d161cb6d51bc1 (patch)
tree15846ce40108943e217c024e164e645b6bc5cdcf /intern/cycles/kernel
parent72acce43bc34e5e9569606e08ee536b02cab088b (diff)
Cycles: Add support for building with OptiX 7.4 SDK and use built-in catmull-rom curve type
Some enum names were changed/removed in OptiX 7.4, so some changes are necessary to make things compile still. In addition, OptiX 7.4 also adds built-in support for catmull-rom curves, so it is no longer necessary to convert the catmull-rom data to cubic bsplines first, and has endcaps disabled by default now, so can remove the special handling via any-hit programs that filtered them out before. Differential Revision: https://developer.blender.org/D13351
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/device/optix/kernel.cu8
1 files changed, 7 insertions, 1 deletions
diff --git a/intern/cycles/kernel/device/optix/kernel.cu b/intern/cycles/kernel/device/optix/kernel.cu
index 4feed59d018..70b977b3d84 100644
--- a/intern/cycles/kernel/device/optix/kernel.cu
+++ b/intern/cycles/kernel/device/optix/kernel.cu
@@ -31,9 +31,11 @@
#include "kernel/integrator/intersect_shadow.h"
#include "kernel/integrator/intersect_subsurface.h"
#include "kernel/integrator/intersect_volume_stack.h"
-
// clang-format on
+#define OPTIX_DEFINE_ABI_VERSION_ONLY
+#include <optix_function_table.h>
+
template<typename T> ccl_device_forceinline T *get_payload_ptr_0()
{
return pointer_unpack_from_uint<T>(optixGetPayload_0(), optixGetPayload_1());
@@ -200,10 +202,12 @@ extern "C" __global__ void __anyhit__kernel_optix_shadow_all_hit()
type = segment.type;
prim = segment.prim;
+# if OPTIX_ABI_VERSION < 55
/* Filter out curve endcaps. */
if (u == 0.0f || u == 1.0f) {
return optixIgnoreIntersection();
}
+# endif
}
# endif
@@ -310,6 +314,7 @@ extern "C" __global__ void __anyhit__kernel_optix_volume_test()
extern "C" __global__ void __anyhit__kernel_optix_visibility_test()
{
#ifdef __HAIR__
+# if OPTIX_ABI_VERSION < 55
if (!optixIsTriangleHit()) {
/* Filter out curve endcaps. */
const float u = __uint_as_float(optixGetAttribute_0());
@@ -317,6 +322,7 @@ extern "C" __global__ void __anyhit__kernel_optix_visibility_test()
return optixIgnoreIntersection();
}
}
+# endif
#endif
#ifdef __VISIBILITY_FLAG__