2
0

BsVulkanCommandBufferManager.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsVulkanPrerequisites.h"
  5. #include "BsCommandBufferManager.h"
  6. namespace BansheeEngine
  7. {
  8. /** @addtogroup Vulkan
  9. * @{
  10. */
  11. /**
  12. * Handles creation of Vulkan command buffers. See CommandBuffer.
  13. *
  14. * @note Core thread only.
  15. */
  16. class VulkanCommandBufferManager : public CommandBufferManager
  17. {
  18. public:
  19. VulkanCommandBufferManager(const VulkanRenderAPI& rapi);
  20. ~VulkanCommandBufferManager();
  21. /** @copydoc CommandBufferManager::createInternal() */
  22. SPtr<CommandBuffer> createInternal(UINT32 id, CommandBufferType type, UINT32 deviceIdx = 0, UINT32 queueIdx = 0,
  23. bool secondary = false) override;
  24. /**
  25. * Returns a set of command buffer semaphores depending on the provided sync mask.
  26. *
  27. * @param[in] deviceIdx Index of the device to get the semaphores for.
  28. * @param[in] syncMask Mask that has a bit enabled for each command buffer to retrieve the semaphore for.
  29. * If the command buffer is not currently executing, semaphore won't be returned.
  30. * @param[out] semaphores List containing all the required semaphores. Semaphores are tightly packed at the
  31. * beginning of the array.
  32. * @param[out] count Number of semaphores provided in the @p semaphores array.
  33. */
  34. void getSyncSemaphores(UINT32 deviceIdx, UINT32 syncMask, VkSemaphore(&semaphores)[BS_MAX_COMMAND_BUFFERS],
  35. UINT32& count);
  36. /**
  37. * Checks if any of the active command buffers finished executing on the device and updates their states
  38. * accordingly.
  39. */
  40. void refreshStates(UINT32 deviceIdx);
  41. private:
  42. const VulkanRenderAPI& mRapi;
  43. };
  44. /** @} */
  45. }