MCPcopy Create free account
hub / github.com/defold/defold / FindRenderListRanges

Function FindRenderListRanges

engine/render/src/render/render.cpp:696–715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

694 }
695
696 void FindRenderListRanges(uint32_t* first, size_t offset, size_t size, RenderListEntry* entries, FindRangeComparator& comp, void* ctx, RangeCallback callback )
697 {
698 if (size == 0)
699 return;
700
701 size_t half = size >> 1;
702 uint32_t* low = first + offset;
703 uint32_t* high = low + size;
704 uint32_t* middle = low + half;
705 uint32_t val = entries[*middle].m_TagListKey;
706
707 low = std::lower_bound(low, middle, *middle, comp);
708 high = std::upper_bound(middle, high, *middle, comp);
709
710 callback(ctx, val, low - first, high - low);
711
712 uint32_t* rangefirst = first + offset;
713 FindRenderListRanges(first, offset, low - rangefirst, entries, comp, ctx, callback);
714 FindRenderListRanges(first, high - first, size - (high - rangefirst), entries, comp, ctx, callback);
715 }
716
717 static void SortRenderList(HRenderContext context)
718 {

Callers 2

TEST_FFunction · 0.85
SortRenderListFunction · 0.85

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.68