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

Function SetLightBufferCount

engine/render/src/render/light.cpp:314–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312 }
313
314 void SetLightBufferCount(HRenderContext render_context, uint32_t max_lights)
315 {
316 assert(render_context);
317 assert(render_context->m_RenderLightsIndices.Size() == 0);
318
319 if (render_context->m_LightUniformBuffer)
320 {
321 dmGraphics::DeleteUniformBuffer(render_context->m_GraphicsContext, render_context->m_LightUniformBuffer);
322 render_context->m_LightUniformBuffer = 0;
323 }
324
325 render_context->m_MaxLightCount = (uint16_t) max_lights;
326 render_context->m_LightBufferDirtyStart = 0;
327 render_context->m_LightBufferDirtyEnd = 0;
328 render_context->m_LightBufferDirtyCount = 0;
329 render_context->m_LightBufferDataWriteStart = 0;
330 render_context->m_LightBufferLastWrittenCount = 0;
331
332 if (render_context->m_RenderLightsIndices.Capacity() < max_lights)
333 {
334 render_context->m_RenderLightsIndices.SetCapacity(max_lights);
335 }
336 render_context->m_LightBufferScratch.SetCapacity(max_lights);
337 render_context->m_LightBufferScratch.SetSize(0);
338 GenerateUniformBuffer(render_context, (int) max_lights);
339 }
340
341 void FinalizeLightData(HRenderContext render_context)
342 {

Callers 5

SetUpMethod · 0.85
SetUpMethod · 0.85
NewRenderContextFunction · 0.85
CompLightTypeCreateFunction · 0.85
SetUpMethod · 0.85

Calls 7

DeleteUniformBufferFunction · 0.85
GenerateUniformBufferFunction · 0.85
assertFunction · 0.50
SizeMethod · 0.45
CapacityMethod · 0.45
SetCapacityMethod · 0.45
SetSizeMethod · 0.45

Tested by 3

SetUpMethod · 0.68
SetUpMethod · 0.68
SetUpMethod · 0.68