BsVulkanQueue.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. namespace BansheeEngine
  6. {
  7. /** @addtogroup Vulkan
  8. * @{
  9. */
  10. /** Wrapper for the Vulkan device queue. */
  11. class VulkanQueue
  12. {
  13. public:
  14. VulkanQueue(VulkanDevice& device, VkQueue queue, GpuQueueType type, UINT32 index);
  15. /** Returns the internal handle to the Vulkan queue object. */
  16. VkQueue getHandle() const { return mQueue; }
  17. /** Returns the device that owns the queue. */
  18. VulkanDevice& getDevice() const { return mDevice; }
  19. /** Returns the type of the queue. */
  20. GpuQueueType getType() const { return mType; }
  21. /** Returns the unique index of the queue, for its type. */
  22. UINT32 getIndex() const { return mIndex; }
  23. /**
  24. * Checks if anything is currently executing on this queue.
  25. *
  26. * @note This status is only updated after a VulkanCommandBufferManager::refreshStates() call.
  27. */
  28. bool isExecuting() const;
  29. /** Submits the provided command buffer on the queue. */
  30. void submit(VulkanCmdBuffer* cmdBuffer, VkSemaphore* waitSemaphores, UINT32 semaphoresCount);
  31. protected:
  32. VulkanDevice& mDevice;
  33. VkQueue mQueue;
  34. GpuQueueType mType;
  35. UINT32 mIndex;
  36. VulkanCmdBuffer* mLastCommandBuffer;
  37. };
  38. /** @} */
  39. }