From 82faa961a2d91e6ed2e7a0bea2cf9f5c8f3929df Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 12 Oct 2010 03:06:46 +0200 Subject: [PATCH] snapshot before searching for remaining traversal/building bug --- include/mitsuba/render/gkdtree.h | 9 +++++---- src/tests/test_kd.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/mitsuba/render/gkdtree.h b/include/mitsuba/render/gkdtree.h index 5b1b3887..939f095b 100644 --- a/include/mitsuba/render/gkdtree.h +++ b/include/mitsuba/render/gkdtree.h @@ -785,7 +785,7 @@ public: Log(EDebug, "Optimizing memory layout .."); std::stack > stack; + const BuildContext *, AABB> > stack; Float expTraversalSteps = 0; Float expLeavesVisited = 0; @@ -830,6 +830,7 @@ public: Float sa = aabb.getSurfaceArea(); expTraversalSteps += sa; sahCost += sa * m_traversalCost; + const KDNode *left; if (EXPECT_TAKEN(!node->isIndirection())) left = node->getLeft(); @@ -2460,7 +2461,7 @@ protected: static const int prevAxisTable[] = { 2, 0, 1 }; static const int nextAxisTable[] = { 1, 2, 0 }; - KDStackEntry stack[MTS_KD_MAXDEPTH]; + KDStackEntry stack[MTS_KD_MAXDEPTH*2]; const KDNode * __restrict farChild, * __restrict currNode = m_nodes; @@ -2469,12 +2470,12 @@ protected: #endif /* Set up the entry point */ - int enPt = 0; + uint32_t enPt = 0; stack[enPt].t = mint; stack[enPt].p = ray(mint); /* Set up the exit point */ - int exPt = 1; + uint32_t exPt = 1; stack[exPt].t = maxt; stack[exPt].p = ray(maxt); stack[exPt].node = NULL; diff --git a/src/tests/test_kd.cpp b/src/tests/test_kd.cpp index 885efa4d..d565618f 100644 --- a/src/tests/test_kd.cpp +++ b/src/tests/test_kd.cpp @@ -161,7 +161,7 @@ public: void test02_buildSimple() { Properties bunnyProps("ply"); - bunnyProps.setString("filename", "tools/tests/happy.ply"); + bunnyProps.setString("filename", "tools/tests/bunny.ply"); ref mesh = static_cast (PluginManager::getInstance()-> createObject(TriMesh::m_theClass, bunnyProps));