From a90037ef8683ff28b12da849e1166ae391909fc8 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Sat, 1 Jun 2019 09:47:57 +0300
Subject: [PATCH] Allow depth download

---
 applications/reconstruct/include/ftl/ray_cast_util.hpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/applications/reconstruct/include/ftl/ray_cast_util.hpp b/applications/reconstruct/include/ftl/ray_cast_util.hpp
index e35275279..7ec68ffa4 100644
--- a/applications/reconstruct/include/ftl/ray_cast_util.hpp
+++ b/applications/reconstruct/include/ftl/ray_cast_util.hpp
@@ -59,10 +59,10 @@ struct RayCastData {
 		updateConstantRayCastParams(params);
 	}
 
-	__host__ void download(float3 *points, uchar3 *colours, const RayCastParams& params) const {
+	__host__ void download(int *depth, uchar3 *colours, const RayCastParams& params) const {
 		//printf("Download: %d,%d\n", params.m_width, params.m_height);
-		//cudaSafeCall(cudaMemcpy(points, d_depth3, sizeof(float3) * params.m_width * params.m_height, cudaMemcpyDeviceToHost));
-		cudaSafeCall(cudaMemcpy(colours, d_colors, sizeof(uchar3) * params.m_width * params.m_height, cudaMemcpyDeviceToHost));
+		if (depth) cudaSafeCall(cudaMemcpy(depth, d_depth_i, sizeof(int) * params.m_width * params.m_height, cudaMemcpyDeviceToHost));
+		if (colours) cudaSafeCall(cudaMemcpy(colours, d_colors, sizeof(uchar3) * params.m_width * params.m_height, cudaMemcpyDeviceToHost));
 	}
 
 	__host__
-- 
GitLab