2020-10-17 14:16:52 +08:00
|
|
|
#ifndef HGL_GRAPH_VULKAN_SUBMIT_QUEUE_INCLUDE
|
|
|
|
#define HGL_GRAPH_VULKAN_SUBMIT_QUEUE_INCLUDE
|
|
|
|
|
2020-10-21 11:43:18 +08:00
|
|
|
#include<hgl/graph/VK.h>
|
|
|
|
#include<hgl/graph/VKFence.h>
|
2020-10-17 14:16:52 +08:00
|
|
|
VK_NAMESPACE_BEGIN
|
2020-10-21 12:39:22 +08:00
|
|
|
class GPUQueue
|
2020-10-17 14:16:52 +08:00
|
|
|
{
|
|
|
|
protected:
|
|
|
|
|
2020-10-21 12:39:22 +08:00
|
|
|
GPUDevice *device;
|
2020-10-17 14:16:52 +08:00
|
|
|
VkQueue queue;
|
|
|
|
|
|
|
|
uint32_t current_fence;
|
2020-10-21 12:09:15 +08:00
|
|
|
ObjectList<GPUFence> fence_list;
|
2020-10-17 14:16:52 +08:00
|
|
|
|
|
|
|
SubmitInfo submit_info;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2020-10-21 12:39:22 +08:00
|
|
|
GPUQueue(GPUDevice *dev,VkQueue q,const uint32_t fence_count=1);
|
|
|
|
virtual ~GPUQueue();
|
2020-10-17 14:16:52 +08:00
|
|
|
|
2020-10-18 13:53:43 +08:00
|
|
|
bool WaitQueue();
|
|
|
|
bool WaitFence(const bool wait_all=true,const uint64_t time_out=HGL_NANO_SEC_PER_SEC);
|
2020-10-21 12:47:06 +08:00
|
|
|
bool Submit(const VkCommandBuffer &cmd_buf,GPUSemaphore *wait_sem,GPUSemaphore *complete_sem);
|
|
|
|
bool Submit(const VkCommandBuffer *cmd_buf,const uint32_t count,GPUSemaphore *wait_sem,GPUSemaphore *complete_sem);
|
2020-10-17 14:16:52 +08:00
|
|
|
};//class SumbitQueue
|
|
|
|
VK_NAMESPACE_END
|
|
|
|
#endif//HGL_GRAPH_VULKAN_SUBMIT_QUEUE_INCLUDE
|