AccelerationStructureBuilder.h 1008 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #pragma once
  6. #include <AnKi/Renderer/RendererObject.h>
  7. namespace anki {
  8. /// @addtogroup renderer
  9. /// @{
  10. /// Build acceleration structures.
  11. class AccelerationStructureBuilder : public RendererObject
  12. {
  13. public:
  14. Error init()
  15. {
  16. return Error::kNone;
  17. }
  18. void populateRenderGraph(RenderingContext& ctx);
  19. AccelerationStructureHandle getAccelerationStructureHandle() const
  20. {
  21. return m_runCtx.m_tlasHandle;
  22. }
  23. void getVisibilityInfo(BufferHandle& handle, BufferOffsetRange& buffer) const
  24. {
  25. handle = m_runCtx.m_visibilityHandle;
  26. buffer = m_runCtx.m_visibleRenderableIndicesBuff;
  27. }
  28. public:
  29. class
  30. {
  31. public:
  32. AccelerationStructurePtr m_tlas;
  33. AccelerationStructureHandle m_tlasHandle;
  34. BufferHandle m_visibilityHandle;
  35. BufferOffsetRange m_visibleRenderableIndicesBuff;
  36. } m_runCtx;
  37. };
  38. /// @}
  39. } // namespace anki