GenericCompute.h 925 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright (C) 2009-2020, 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. {
  9. /// @addtogroup renderer
  10. /// @{
  11. /// Executes various compute jobs required by the render queue. It's guaranteed to run before light shading and nothing
  12. /// more. It can access the previous frame's depth buffer.
  13. class GenericCompute : public RendererObject
  14. {
  15. public:
  16. GenericCompute(Renderer* r)
  17. : RendererObject(r)
  18. {
  19. }
  20. ~GenericCompute();
  21. ANKI_USE_RESULT Error init(const ConfigSet& cfg)
  22. {
  23. return Error::NONE;
  24. }
  25. /// Populate the rendergraph.
  26. void populateRenderGraph(RenderingContext& ctx);
  27. private:
  28. class
  29. {
  30. public:
  31. const RenderingContext* m_ctx = nullptr;
  32. } m_runCtx;
  33. void run(RenderPassWorkContext& rgraphCtx);
  34. };
  35. /// @}
  36. } // end namespace anki