Skip to content

Commit 7b8ecd2

Browse files
committed
Removed unused functions
1 parent 2da74e2 commit 7b8ecd2

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed

RadeonRays/src/accelerator/bvh2.h

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,10 @@ namespace RadeonRays
5050
// Build function
5151
template <typename Iter>
5252
void Build(Iter begin, Iter end);
53+
5354
void Clear();
5455

55-
inline Node *GetNode(std::size_t idx) const;
5656
inline std::size_t GetSizeInBytes() const;
57-
inline std::size_t nodecount() const;
58-
inline Node &root() const;
5957

6058
protected:
6159
using RefArray = std::vector<std::uint32_t>;
@@ -160,6 +158,7 @@ namespace RadeonRays
160158
Bvh2 &operator = (const Bvh2 &);
161159

162160
friend class QBvhTranslator;
161+
friend class IntersectorLDS;
163162

164163
// Buffer of encoded nodes
165164
Node *m_nodes;
@@ -283,26 +282,11 @@ namespace RadeonRays
283282
PropagateBounds(*this);
284283
}
285284

286-
Bvh2::Node *Bvh2::GetNode(std::size_t idx) const
287-
{
288-
return m_nodes + idx;
289-
}
290-
291285
std::size_t Bvh2::GetSizeInBytes() const
292286
{
293287
return m_nodecount * sizeof(Node);
294288
}
295289

296-
std::size_t Bvh2::nodecount() const
297-
{
298-
return m_nodecount;
299-
}
300-
301-
Bvh2::Node &Bvh2::root() const
302-
{
303-
return m_nodes[0];
304-
}
305-
306290
void Bvh2::EncodeLeaf(
307291
Node &node,
308292
std::uint32_t num_refs)
@@ -377,16 +361,16 @@ namespace RadeonRays
377361
s.pop();
378362

379363
// Fetch the node
380-
auto node = bvh.GetNode(idx);
364+
auto node = &bvh.m_nodes[idx];
381365

382366
if (IsInternal(*node))
383367
{
384368
// If the node is internal we fetch child nodes
385369
auto idx0 = GetChildIndex(*node, 0);
386370
auto idx1 = GetChildIndex(*node, 1);
387371

388-
auto child0 = bvh.GetNode(idx0);
389-
auto child1 = bvh.GetNode(idx1);
372+
auto child0 = &bvh.m_nodes[idx0];
373+
auto child1 = &bvh.m_nodes[idx1];
390374

391375
// If the child is internal node itself we pull it
392376
// up the tree into its parent. If the child node is

RadeonRays/src/translator/q_bvh_translator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ namespace RadeonRays
202202

203203
while (!stack.empty())
204204
{
205-
auto node = bvh.GetNode(stack.top().bvh_node_index);
205+
auto node = &bvh.m_nodes[stack.top().bvh_node_index];
206206
auto qbvh_node_index = stack.top().qbvh_node_index;
207207
stack.pop();
208208

@@ -223,8 +223,8 @@ namespace RadeonRays
223223
auto c0idx = Bvh2::GetChildIndex(*node, 0);
224224
auto c1idx = Bvh2::GetChildIndex(*node, 1);
225225

226-
auto c0 = bvh.GetNode(c0idx);
227-
auto c1 = bvh.GetNode(c1idx);
226+
auto c0 = &bvh.m_nodes[c0idx];
227+
auto c1 = &bvh.m_nodes[c1idx];
228228

229229
if (Bvh2::IsInternal(*c0))
230230
{

0 commit comments

Comments
 (0)