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

Function RenderListSubmit

engine/render/src/render/render.cpp:285–313  ·  view source on GitHub ↗

Submit a range of entries (pointers must be from a range allocated by RenderListAlloc, and not between two alloc calls).

Source from the content-addressed store, hash-verified

283
284 // Submit a range of entries (pointers must be from a range allocated by RenderListAlloc, and not between two alloc calls).
285 void RenderListSubmit(HRenderContext render_context, RenderListEntry *begin, RenderListEntry *end)
286 {
287 // Insert the used up indices into the sort buffer.
288 assert(end - begin <= (intptr_t)render_context->m_RenderListSortIndices.Remaining());
289 assert(end <= render_context->m_RenderList.End());
290
291 // If we didn't use all entries, let's put them back into the list
292 if (end < render_context->m_RenderList.End())
293 {
294 uint32_t list_size = end - render_context->m_RenderList.Begin();
295 render_context->m_RenderList.SetSize(list_size);
296 }
297
298 if (end == begin) {
299 return;
300 }
301
302 // Transform pointers back to indices.
303 RenderListEntry *base = render_context->m_RenderList.Begin();
304 uint32_t *insert = render_context->m_RenderListSortIndices.End();
305
306 for (RenderListEntry* i=begin;i!=end;i++)
307 *insert++ = i - base;
308
309 render_context->m_RenderListSortIndices.SetSize(render_context->m_RenderListSortIndices.Size() + (end - begin));
310
311 // invalidate the ranges if this is a call to the debug rendering (happening in the middle of the frame)
312 render_context->m_RenderListRanges.SetSize(0);
313 }
314
315 struct RenderListSorter
316 {

Callers 9

TEST_FFunction · 0.85
FlushDebugFunction · 0.85
FlushTextsFunction · 0.85
CompMeshRenderFunction · 0.85
CompGuiRenderFunction · 0.85
CompSpriteRenderFunction · 0.85
CompModelRenderFunction · 0.85
CompTileGridRenderFunction · 0.85
CompParticleFXRenderFunction · 0.85

Calls 6

assertFunction · 0.50
RemainingMethod · 0.45
EndMethod · 0.45
BeginMethod · 0.45
SetSizeMethod · 0.45
SizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.68