ULRE/inc/hgl/graph/VKQueue.h

49 lines
1.3 KiB
C
Raw Normal View History

#ifndef HGL_GRAPH_VULKAN_SUBMIT_QUEUE_INCLUDE
2020-10-17 14:16:52 +08:00
#define HGL_GRAPH_VULKAN_SUBMIT_QUEUE_INCLUDE
#include<hgl/graph/VK.h>
#include<hgl/graph/VKFence.h>
2020-10-17 14:16:52 +08:00
VK_NAMESPACE_BEGIN
class DeviceQueue
2020-10-17 14:16:52 +08:00
{
protected:
VkDevice device;
2020-10-17 14:16:52 +08:00
VkQueue queue;
uint32_t current_fence;
2022-10-14 19:27:29 +08:00
Fence **fence_list;
uint32_t fence_count;
2020-10-17 14:16:52 +08:00
SubmitInfo submit_info;
private:
friend class VulkanDevice;
DeviceQueue(VkDevice dev,VkQueue q,Fence **,const uint32_t fc);
2020-10-17 14:16:52 +08:00
public:
virtual ~DeviceQueue();
2022-09-27 19:41:28 +08:00
operator VkQueue(){return queue;}
2020-10-17 14:16:52 +08:00
VkResult Present(const VkPresentInfoKHR *pi){return vkQueuePresentKHR(queue,pi);}
/**
* Submit的队列完成操作线Submit后请不要立即使用它
*/
bool WaitQueue();
/**
* Queue命令执行完成的fence信号
*/
bool WaitFence(const bool wait_all=true,const uint64_t time_out=HGL_NANO_SEC_PER_SEC);
bool Submit(const VkCommandBuffer *cmd_buf,const uint32_t count,Semaphore *wait_sem,Semaphore *complete_sem);
bool Submit(VulkanCmdBuffer *cmd_buf,Semaphore *wait_sem,Semaphore *complete_sem);
};//class DeviceQueue
2020-10-17 14:16:52 +08:00
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_SUBMIT_QUEUE_INCLUDE