diff --git a/intern/cycles/kernel/device/metal/bvh.h b/intern/cycles/kernel/device/metal/bvh.h index 4852b813a28..72c37303b13 100644 --- a/intern/cycles/kernel/device/metal/bvh.h +++ b/intern/cycles/kernel/device/metal/bvh.h @@ -231,7 +231,7 @@ ccl_device_intersect bool scene_intersect(KernelGlobals kg, isect->type = segment.type; isect->u = intersection.curve_parameter; - if (segment.type & PRIMITIVE_CURVE_RIBBON) { + if ((segment.type & PRIMITIVE_CURVE) == PRIMITIVE_CURVE_RIBBON) { isect->v = curve_ribbon_v(kg, intersection.curve_parameter, intersection.distance, diff --git a/intern/cycles/kernel/device/metal/kernel.metal b/intern/cycles/kernel/device/metal/kernel.metal index 642c9bfd208..58b790400eb 100644 --- a/intern/cycles/kernel/device/metal/kernel.metal +++ b/intern/cycles/kernel/device/metal/kernel.metal @@ -215,7 +215,7 @@ bool metalrt_shadow_all_hit( return true; } - if (type & PRIMITIVE_CURVE_RIBBON) { + if ((type & PRIMITIVE_CURVE) == PRIMITIVE_CURVE_RIBBON) { MetalKernelContext context(launch_params_metal); if (!context.curve_ribbon_accept(nullptr, u, t, ray, object, prim, type)) { /* continue search */ @@ -421,7 +421,7 @@ inline TReturnType metalrt_visibility_test( return result; } - if (type & PRIMITIVE_CURVE_RIBBON) { + if ((type & PRIMITIVE_CURVE) == PRIMITIVE_CURVE_RIBBON) { MetalKernelContext context(launch_params_metal); if (!context.curve_ribbon_accept(nullptr, u, t, ray, object, prim, type)) { result.accept = false; @@ -472,7 +472,7 @@ inline TReturnType metalrt_visibility_test_shadow( return result; } - if (type & PRIMITIVE_CURVE_RIBBON) { + if ((type & PRIMITIVE_CURVE) == PRIMITIVE_CURVE_RIBBON) { MetalKernelContext context(launch_params_metal); if (!context.curve_ribbon_accept(nullptr, u, t, ray, object, prim, type)) { result.accept = false; diff --git a/intern/cycles/kernel/device/optix/bvh.h b/intern/cycles/kernel/device/optix/bvh.h index 6075819703c..a769848de04 100644 --- a/intern/cycles/kernel/device/optix/bvh.h +++ b/intern/cycles/kernel/device/optix/bvh.h @@ -421,7 +421,7 @@ extern "C" __global__ void __intersection__curve_ribbon() const KernelCurveSegment segment = kernel_data_fetch(curve_segments, optixGetPrimitiveIndex()); const int prim = segment.prim; const int type = segment.type; - if (type & PRIMITIVE_CURVE_RIBBON) { + if ((type & PRIMITIVE_CURVE) == PRIMITIVE_CURVE_RIBBON) { optix_intersection_curve(prim, type); } }