BsCommandBufferManager.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "BsModule.h"
  6. namespace BansheeEngine
  7. {
  8. /** @addtogroup RenderAPI-Internal
  9. * @{
  10. */
  11. /**
  12. * Handles creation of command buffers. See CommandBuffer.
  13. *
  14. * @note Core thread only.
  15. */
  16. class BS_CORE_EXPORT CommandBufferManager : public Module<CommandBufferManager>
  17. {
  18. public:
  19. virtual ~CommandBufferManager() {}
  20. /** @copydoc CommandBuffer::create */
  21. SPtr<CommandBuffer> create(CommandBufferType type, UINT32 deviceIdx = 0, UINT32 queueIdx = 0,
  22. bool secondary = false);
  23. protected:
  24. friend CommandBuffer;
  25. /** Creates a command buffer with the specified ID. See create(). */
  26. virtual SPtr<CommandBuffer> createInternal(UINT32 id, CommandBufferType type, UINT32 deviceIdx = 0,
  27. UINT32 queueIdx = 0, bool secondary = false) = 0;
  28. /** Called by a command buffer just before it is destroyed. */
  29. void notifyCommandBufferDestroyed(UINT32 deviceIdx, UINT32 id);
  30. CommandBuffer* mActiveCommandBuffers[BS_MAX_DEVICES][BS_MAX_COMMAND_BUFFERS];
  31. };
  32. /** @} */
  33. }