From 4bfee1936c8ab9b83d07b848051f5151c31f49ce Mon Sep 17 00:00:00 2001 From: salipourto Date: Thu, 12 Sep 2024 15:05:08 +0200 Subject: [PATCH] Fix #126749: HIP-RT Memory leak in Cycles viewport hiprtScene object wasn't being freed between frames. Pull Request: https://projects.blender.org/blender/blender/pulls/127473 --- intern/cycles/device/hiprt/device_impl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/intern/cycles/device/hiprt/device_impl.cpp b/intern/cycles/device/hiprt/device_impl.cpp index 597e6117237..b57457ffe9a 100644 --- a/intern/cycles/device/hiprt/device_impl.cpp +++ b/intern/cycles/device/hiprt/device_impl.cpp @@ -1089,6 +1089,9 @@ void HIPRTDevice::build_bvh(BVH *bvh, Progress &progress, bool refit) else { const vector objects = bvh_rt->objects; + if (scene) { + hiprtDestroyScene(hiprt_context, scene); + } scene = build_tlas(bvh_rt, objects, options, refit); } }