From 697114c4b64fe053178898478e0afe2d90f77955 Mon Sep 17 00:00:00 2001 From: Patrick Mours Date: Fri, 17 Nov 2023 17:20:57 +0100 Subject: [PATCH] Fix #113325: Zero-sized curve leads to OptiX error Empty hair geometry in Cycles may still report having one curve, even when there are no actual segments in that curve. This caused an attempt to build an acceleration structure with zero primitives, which due to other setup OptiX rejected with an error. Fix that by checking the number of segments rather than the number of curves in the hair geometry, since the former will always be zero for empty geometry. Pull Request: https://projects.blender.org/blender/blender/pulls/115044 --- intern/cycles/device/optix/device_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intern/cycles/device/optix/device_impl.cpp b/intern/cycles/device/optix/device_impl.cpp index 9869c1b1bc8..be3f1c0ad3d 100644 --- a/intern/cycles/device/optix/device_impl.cpp +++ b/intern/cycles/device/optix/device_impl.cpp @@ -1160,7 +1160,7 @@ void OptiXDevice::build_bvh(BVH *bvh, Progress &progress, bool refit) if (geom->geometry_type == Geometry::HAIR) { /* Build BLAS for curve primitives. */ Hair *const hair = static_cast(geom); - if (hair->num_curves() == 0) { + if (hair->num_segments() == 0) { return; }