From ef8f28f33c0cbe0a31518cc99175f0676e32ba27 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Sat, 20 Jul 2024 23:47:11 +0200 Subject: [PATCH] Fix embree4 bitrot. --- include/light/trace_embree.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/light/trace_embree.hh b/include/light/trace_embree.hh index e5c3c65e..bfe761dc 100644 --- a/include/light/trace_embree.hh +++ b/include/light/trace_embree.hh @@ -243,8 +243,8 @@ public: #ifdef HAVE_EMBREE4 RTCIntersectArguments embree4_args = ctx2.setup_intersection_arguments(); - for (int i = 0; i < _numrays; ++i) - rtcIntersect1(scene, &_rays[i], &embree4_args); + for (auto &ray : _rays) + rtcIntersect1(scene, &ray.ray, &embree4_args); #else rtcIntersect1M(scene, &ctx2, &_rays.data()->ray, _rays.size(), sizeof(_rays[0])); #endif @@ -310,8 +310,8 @@ public: ray_source_info ctx2(this, self, shadowmask); #ifdef HAVE_EMBREE4 RTCOccludedArguments embree4_args = ctx2.setup_occluded_arguments(); - for (int i = 0; i < _numrays; ++i) - rtcOccluded1(scene, &_rays[i], &embree4_args); + for (auto &ray : _rays) + rtcOccluded1(scene, &ray.ray.ray, &embree4_args); #else rtcOccluded1M(scene, &ctx2, &_rays.data()->ray.ray, _rays.size(), sizeof(_rays[0])); #endif