From afae7cb87791d36888bdf7b34a016239d1dadade Mon Sep 17 00:00:00 2001 From: manuelkNVDA Date: Fri, 3 Apr 2026 14:38:34 -0700 Subject: [PATCH] Fix WideBVH ray queries - recent changes to support double precision broke wide BVH ray traversal templates - bring back `bvh_t` as a template argument to the forEachPrim functions - the alternative is to implement that function correctly and explicitly for both the binary & wide BVH types (and then remove the bvh type from the template) --- cuBQL/traversal/rayQueries.h | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/cuBQL/traversal/rayQueries.h b/cuBQL/traversal/rayQueries.h index 838c6aa..2baa33e 100644 --- a/cuBQL/traversal/rayQueries.h +++ b/cuBQL/traversal/rayQueries.h @@ -37,10 +37,10 @@ namespace cuBQL { cuBQL::ray_t ray, bool dbg=false); - template + template inline __cubql_both void forEachPrim(const Lambda &lambdaToExecuteForEachCandidate, - BinaryBVH bvh, + bvh_t bvh, cuBQL::ray_t ray, bool dbg=false); @@ -106,19 +106,10 @@ namespace cuBQL { /*! single level BVH ray traversal, provided lambda covers what happens when a ray wants to intersect a given prim within that bvh */ - template - inline __cubql_both - void forEachPrim(const Lambda &lambdaToExecuteForEachCandidate, - BinaryBVH bvh, - ray_t &ray, - bool dbg=false); - /*! single level BVH ray traversal, provided lambda covers what - happens when a ray wants to intersect a given prim within that - bvh */ - template + template inline __cubql_both void forEachPrim(const Lambda &lambdaToExecuteForEachCandidate, - WideBVH bvh, + bvh_t bvh, ray_t &ray, bool dbg=false); @@ -464,10 +455,10 @@ namespace cuBQL { /*! this query assumes lambads that return CUBQL_CONTINUE_TRAVERSAL or CUBQL_TERMINATE_TRAVERSAL */ - template + template inline __cubql_both void fixedRayQuery::forEachPrim(const Lambda &lambdaToExecuteForEachCandidate, - BinaryBVH bvh, + bvh_t bvh, cuBQL::ray_t ray, bool dbg) { @@ -672,10 +663,10 @@ namespace cuBQL { return T(CUBQL_INF); } - template + template inline __cubql_both void shrinkingRayQuery::forEachPrim(const Lambda &lambdaToExecuteForEachCandidate, - BinaryBVH bvh, + bvh_t bvh, ray_t &ray, bool dbg) { @@ -688,8 +679,6 @@ namespace cuBQL { shrinkingRayQuery::forEachLeaf(perLeaf,bvh,ray,dbg); } - - /*! two-level BVH ray traversal, where the BVH is made up of a "TLAS" (top-level acceleration structure) that itself contains objects with "BLAS"es (bottom-level acceleration