RenderQueue.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright (C) 2009-2023, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #include <AnKi/Renderer/RenderQueue.h>
  6. namespace anki {
  7. U32 RenderQueue::countAllRenderables() const
  8. {
  9. U32 drawableCount = 0;
  10. drawableCount += m_renderables.getSize();
  11. drawableCount += m_forwardShadingRenderables.getSize();
  12. for(const SpotLightQueueElement& slight : m_spotLights)
  13. {
  14. if(slight.m_shadowRenderQueue)
  15. {
  16. drawableCount += slight.m_shadowRenderQueue->countAllRenderables();
  17. }
  18. }
  19. for(const PointLightQueueElement& plight : m_pointLights)
  20. {
  21. for(U i = 0; i < 6; ++i)
  22. {
  23. if(plight.m_shadowRenderQueues[i])
  24. {
  25. drawableCount += plight.m_shadowRenderQueues[i]->countAllRenderables();
  26. }
  27. }
  28. }
  29. if(m_reflectionProbeForRefresh)
  30. {
  31. for(U i = 0; i < 6; ++i)
  32. {
  33. if(m_reflectionProbeForRefresh->m_renderQueues[i])
  34. {
  35. drawableCount += m_reflectionProbeForRefresh->m_renderQueues[i]->countAllRenderables();
  36. }
  37. }
  38. }
  39. return drawableCount;
  40. }
  41. } // end namespace anki