From 9bf6e60021308d714ca1c01061fd6712a18971f0 Mon Sep 17 00:00:00 2001 From: dpjudas Date: Mon, 21 Oct 2024 01:38:23 +0200 Subject: [PATCH] Fix TLAS to BLAS links not pointing at the root node of the BLAS --- src/common/rendering/hwrenderer/data/hw_collision.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/rendering/hwrenderer/data/hw_collision.cpp b/src/common/rendering/hwrenderer/data/hw_collision.cpp index d6b676f56..1acd2738c 100644 --- a/src/common/rendering/hwrenderer/data/hw_collision.cpp +++ b/src/common/rendering/hwrenderer/data/hw_collision.cpp @@ -184,7 +184,8 @@ void CPUAccelStruct::Upload() if (node.left != -1 && TLAS.Nodes[node.left].blas_index != -1) { - info.left = blasOffsets[TLAS.Nodes[node.left].blas_index]; + int blas_index = TLAS.Nodes[node.left].blas_index; + info.left = blasOffsets[blas_index] + DynamicBLAS[blas_index]->GetRoot(); } else { @@ -193,7 +194,8 @@ void CPUAccelStruct::Upload() if (node.right != -1 && TLAS.Nodes[node.right].blas_index != -1) { - info.right = blasOffsets[TLAS.Nodes[node.right].blas_index]; + int blas_index = TLAS.Nodes[node.right].blas_index; + info.right = blasOffsets[blas_index] + DynamicBLAS[blas_index]->GetRoot(); } else {