From 48501610557b8fc05f5b8042f288a86ad9423e1b Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Thu, 14 May 2020 19:52:31 +0300
Subject: [PATCH] Clear packets instead for clipping

---
 components/operators/src/clipping.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/components/operators/src/clipping.cpp b/components/operators/src/clipping.cpp
index b3c5d9072..17529bed2 100644
--- a/components/operators/src/clipping.cpp
+++ b/components/operators/src/clipping.cpp
@@ -77,7 +77,8 @@ bool ClipScene::apply(ftl::rgbd::FrameSet &in, ftl::rgbd::FrameSet &out, cudaStr
 			auto sclip = clip;
 			sclip.origin = sclip.origin.getInverse() * pose;
 			if (!no_clip) {
-				f.create<cv::cuda::GpuMat>(Channel::Depth);  // Force reset.
+				//f.create<cv::cuda::GpuMat>(Channel::Depth);  // Force reset.
+				f.clearPackets(Channel::Depth);
 				ftl::cuda::clipping(f.createTexture<float>(Channel::Depth), f.getLeftCamera(), sclip, stream);
 			}
 		}
-- 
GitLab