renamed Semaphore instead of GPUSemaphore,

renamed Queue instead of GPUQueue
This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2022-10-14 19:40:16 +08:00
parent fc2c8021ba
commit f8646ca880
12 changed files with 47 additions and 47 deletions

View File

@ -59,7 +59,7 @@ private:
public:
bool Submit(GPUSemaphore *sem)
bool Submit(Semaphore *sem)
{
return rt->Submit(cmd,sem);
}

View File

@ -33,7 +33,7 @@ class VulkanInstance;
class GPUPhysicalDevice;
class GPUDevice;
struct GPUDeviceAttribute;
class GPUQueue;
class Queue;
class ImageView;
class Framebuffer;
struct Swapchain;
@ -68,7 +68,7 @@ class RenderPass;
class DeviceRenderPassManage;
class Fence;
class GPUSemaphore;
class Semaphore;
enum class DescriptorSetsType
{

View File

@ -43,7 +43,7 @@ class GPUDevice
{
GPUDeviceAttribute *attr;
GPUQueue *texture_queue;
Queue *texture_queue;
TextureCmdBuffer *texture_cmd_buf;
private:
@ -241,9 +241,9 @@ public:
RenderPass * AcquireRenderPass( const RenderbufferInfo *,const uint subpass_count=2);
Fence * CreateFence(bool);
GPUSemaphore * CreateGPUSemaphore();
Semaphore * CreateGPUSemaphore();
GPUQueue * CreateQueue(const uint32_t fence_count=1,const bool create_signaled=false);
Queue * CreateQueue(const uint32_t fence_count=1,const bool create_signaled=false);
public: //FrameBuffer相关

View File

@ -4,7 +4,7 @@
#include<hgl/graph/VK.h>
#include<hgl/graph/VKFence.h>
VK_NAMESPACE_BEGIN
class GPUQueue
class Queue
{
protected:
@ -21,11 +21,11 @@ private:
friend class GPUDevice;
GPUQueue(VkDevice dev,VkQueue q,Fence **,const uint32_t fc);
Queue(VkDevice dev,VkQueue q,Fence **,const uint32_t fc);
public:
virtual ~GPUQueue();
virtual ~Queue();
operator VkQueue(){return queue;}
@ -33,8 +33,8 @@ public:
bool WaitQueue();
bool WaitFence(const bool wait_all=true,const uint64_t time_out=HGL_NANO_SEC_PER_SEC);
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);
bool Submit(const VkCommandBuffer &cmd_buf,Semaphore *wait_sem,Semaphore *complete_sem);
bool Submit(const VkCommandBuffer *cmd_buf,const uint32_t count,Semaphore *wait_sem,Semaphore *complete_sem);
};//class SumbitQueue
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_SUBMIT_QUEUE_INCLUDE

View File

@ -15,14 +15,14 @@ class RenderTarget
{
protected:
GPUQueue *queue;
Queue *queue;
RenderPass *render_pass;
Framebuffer *fbo;
VkExtent2D extent;
GPUSemaphore *render_complete_semaphore =nullptr;
Semaphore *render_complete_semaphore =nullptr;
protected:
@ -34,14 +34,14 @@ protected:
friend class GPUDevice;
RenderTarget(GPUQueue *,GPUSemaphore *);
RenderTarget(GPUQueue *,GPUSemaphore *,RenderPass *_rp,Framebuffer *_fb,Texture2D **color_texture_list,const uint32_t color_count,Texture2D *depth_texture);
RenderTarget(Queue *,Semaphore *);
RenderTarget(Queue *,Semaphore *,RenderPass *_rp,Framebuffer *_fb,Texture2D **color_texture_list,const uint32_t color_count,Texture2D *depth_texture);
public:
virtual ~RenderTarget();
GPUQueue * GetQueue () {return queue;}
Queue * GetQueue () {return queue;}
const VkExtent2D & GetExtent ()const {return extent;}
virtual RenderPass * GetRenderPass () {return render_pass;}
virtual const VkRenderPass GetVkRenderPass ()const {return render_pass->GetVkRenderPass();}
@ -53,8 +53,8 @@ public:
public: // command buffer
GPUSemaphore * GetRenderCompleteSemaphore (){return render_complete_semaphore;}
virtual bool Submit (RenderCmdBuffer *,GPUSemaphore *present_complete_semaphore=nullptr);
Semaphore * GetRenderCompleteSemaphore (){return render_complete_semaphore;}
virtual bool Submit (RenderCmdBuffer *,Semaphore *present_complete_semaphore=nullptr);
bool WaitQueue(){return queue->WaitQueue();}
bool WaitFence(){return queue->WaitFence();}
@ -69,13 +69,13 @@ class SwapchainRenderTarget:public RenderTarget
Swapchain *swapchain;
PresentInfo present_info;
GPUSemaphore *present_complete_semaphore=nullptr;
Semaphore *present_complete_semaphore=nullptr;
uint32_t current_frame;
public:
SwapchainRenderTarget(VkDevice dev,Swapchain *sc,GPUQueue *q,GPUSemaphore *rcs,GPUSemaphore *pcs,RenderPass *rp);
SwapchainRenderTarget(VkDevice dev,Swapchain *sc,Queue *q,Semaphore *rcs,Semaphore *pcs,RenderPass *rp);
~SwapchainRenderTarget();
Framebuffer * GetFramebuffer ()override {return swapchain->render_frame[current_frame];}
@ -90,7 +90,7 @@ public:
public:
const uint32_t GetCurrentFrameIndices ()const {return current_frame;}
GPUSemaphore * GetPresentCompleteSemaphore () {return present_complete_semaphore;}
Semaphore * GetPresentCompleteSemaphore () {return present_complete_semaphore;}
public:
@ -109,7 +109,7 @@ public:
bool PresentBackbuffer();
bool Submit(VkCommandBuffer);
bool Submit(VkCommandBuffer,GPUSemaphore *);
bool Submit(VkCommandBuffer,Semaphore *);
};//class SwapchainRenderTarget:public RenderTarget
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_RENDER_TARGET_INCLUDE

View File

@ -3,7 +3,7 @@
#include<hgl/graph/VK.h>
VK_NAMESPACE_BEGIN
class GPUSemaphore
class Semaphore
{
VkDevice device;
VkSemaphore sem;
@ -12,7 +12,7 @@ private:
friend class GPUDevice;
GPUSemaphore(VkDevice d,VkSemaphore s)
Semaphore(VkDevice d,VkSemaphore s)
{
device=d;
sem=s;
@ -20,11 +20,11 @@ private:
public:
~GPUSemaphore();
~Semaphore();
operator VkSemaphore(){return sem;}
operator const VkSemaphore *()const{return &sem;}
};//class GPUSemaphore
};//class Semaphore
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_SEMAPHORE_INCLUDE

View File

@ -128,7 +128,7 @@ Fence *GPUDevice::CreateFence(bool create_signaled)
return(new Fence(attr->device,fence));
}
GPUSemaphore *GPUDevice::CreateGPUSemaphore()
Semaphore *GPUDevice::CreateGPUSemaphore()
{
SemaphoreCreateInfo SemaphoreCreateInfo;
@ -137,10 +137,10 @@ GPUSemaphore *GPUDevice::CreateGPUSemaphore()
if(vkCreateSemaphore(attr->device, &SemaphoreCreateInfo, nullptr, &sem)!=VK_SUCCESS)
return(nullptr);
return(new GPUSemaphore(attr->device,sem));
return(new Semaphore(attr->device,sem));
}
GPUQueue *GPUDevice::CreateQueue(const uint32_t fence_count,const bool create_signaled)
Queue *GPUDevice::CreateQueue(const uint32_t fence_count,const bool create_signaled)
{
if(fence_count<=0)return(nullptr);
@ -149,6 +149,6 @@ GPUQueue *GPUDevice::CreateQueue(const uint32_t fence_count,const bool create_si
for(uint32_t i=0;i<fence_count;i++)
fence_list[i]=CreateFence(create_signaled);
return(new GPUQueue(attr->device,attr->graphics_queue,fence_list,fence_count));
return(new Queue(attr->device,attr->graphics_queue,fence_list,fence_count));
}
VK_NAMESPACE_END

View File

@ -33,8 +33,8 @@ RenderTarget *GPUDevice::CreateRenderTarget(const FramebufferInfo *fbi,RenderPas
if(fb)
{
GPUQueue *q=CreateQueue(fence_count,false);
GPUSemaphore *render_complete_semaphore=CreateGPUSemaphore();
Queue *q=CreateQueue(fence_count,false);
Semaphore *render_complete_semaphore=CreateGPUSemaphore();
RenderTarget *rt=new RenderTarget(q,render_complete_semaphore,rp,fb,color_texture_list,color_count,depth_texture);
@ -64,9 +64,9 @@ SwapchainRenderTarget *GPUDevice::CreateSwapchainRenderTarget()
if(!sc)
return(false);
GPUQueue *q=CreateQueue(sc->color_count,false);
GPUSemaphore *render_complete_semaphore=CreateGPUSemaphore();
GPUSemaphore *present_complete_semaphore=CreateGPUSemaphore();
Queue *q=CreateQueue(sc->color_count,false);
Semaphore *render_complete_semaphore=CreateGPUSemaphore();
Semaphore *present_complete_semaphore=CreateGPUSemaphore();
SwapchainRenderTarget *srt=new SwapchainRenderTarget( attr->device,
sc,

View File

@ -7,7 +7,7 @@ namespace
const VkPipelineStageFlags pipe_stage_flags=VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
}//namespace
GPUQueue::GPUQueue(VkDevice dev,VkQueue q,Fence **fl,const uint32_t fc)
Queue::Queue(VkDevice dev,VkQueue q,Fence **fl,const uint32_t fc)
{
device=dev;
queue=q;
@ -19,12 +19,12 @@ GPUQueue::GPUQueue(VkDevice dev,VkQueue q,Fence **fl,const uint32_t fc)
submit_info.pWaitDstStageMask = &pipe_stage_flags;
}
GPUQueue::~GPUQueue()
Queue::~Queue()
{
SAFE_CLEAR_OBJECT_ARRAY(fence_list,fence_count)
}
bool GPUQueue::WaitQueue()
bool Queue::WaitQueue()
{
VkResult result=vkQueueWaitIdle(queue);
@ -34,7 +34,7 @@ bool GPUQueue::WaitQueue()
return(true);
}
bool GPUQueue::WaitFence(const bool wait_all,uint64_t time_out)
bool Queue::WaitFence(const bool wait_all,uint64_t time_out)
{
VkResult result;
VkFence fence=*fence_list[current_fence];
@ -48,7 +48,7 @@ bool GPUQueue::WaitFence(const bool wait_all,uint64_t time_out)
return(true);
}
bool GPUQueue::Submit(const VkCommandBuffer *cmd_buf,const uint32_t cb_count,GPUSemaphore *wait_sem,GPUSemaphore *complete_sem)
bool Queue::Submit(const VkCommandBuffer *cmd_buf,const uint32_t cb_count,Semaphore *wait_sem,Semaphore *complete_sem)
{
VkSemaphore ws;
VkSemaphore cs;
@ -91,7 +91,7 @@ bool GPUQueue::Submit(const VkCommandBuffer *cmd_buf,const uint32_t cb_count,GPU
return(result==VK_SUCCESS);
}
bool GPUQueue::Submit(const VkCommandBuffer &cmd_buf,GPUSemaphore *wait_sem,GPUSemaphore *complete_sem)
bool Queue::Submit(const VkCommandBuffer &cmd_buf,Semaphore *wait_sem,Semaphore *complete_sem)
{
return Submit(&cmd_buf,1,wait_sem,complete_sem);
}

View File

@ -6,7 +6,7 @@
#include<hgl/graph/VKFramebuffer.h>
VK_NAMESPACE_BEGIN
RenderTarget::RenderTarget(GPUQueue *q,GPUSemaphore *s)
RenderTarget::RenderTarget(Queue *q,Semaphore *s)
{
queue=q;
render_pass=nullptr;
@ -18,7 +18,7 @@ RenderTarget::RenderTarget(GPUQueue *q,GPUSemaphore *s)
render_complete_semaphore=s;
}
RenderTarget::RenderTarget(GPUQueue *q,GPUSemaphore *s,RenderPass *_rp,Framebuffer *_fb,Texture2D **ctl,const uint32_t cc,Texture2D *dt)
RenderTarget::RenderTarget(Queue *q,Semaphore *s,RenderPass *_rp,Framebuffer *_fb,Texture2D **ctl,const uint32_t cc,Texture2D *dt)
{
queue=q;
render_pass=_rp;
@ -59,7 +59,7 @@ RenderTarget::~RenderTarget()
SAFE_CLEAR(fbo);
}
bool RenderTarget::Submit(RenderCmdBuffer *command_buffer,GPUSemaphore *present_complete_semaphore)
bool RenderTarget::Submit(RenderCmdBuffer *command_buffer,Semaphore *present_complete_semaphore)
{
return queue->Submit(*command_buffer,present_complete_semaphore,render_complete_semaphore);
}

View File

@ -1,6 +1,6 @@
#include<hgl/graph/VKSemaphore.h>
VK_NAMESPACE_BEGIN
GPUSemaphore::~GPUSemaphore()
Semaphore::~Semaphore()
{
vkDestroySemaphore(device,sem,nullptr);
}

View File

@ -3,7 +3,7 @@
#include<hgl/graph/VKSemaphore.h>
VK_NAMESPACE_BEGIN
SwapchainRenderTarget::SwapchainRenderTarget(VkDevice dev,Swapchain *sc,GPUQueue *q,GPUSemaphore *rcs,GPUSemaphore *pcs,RenderPass *rp):RenderTarget(q,rcs)
SwapchainRenderTarget::SwapchainRenderTarget(VkDevice dev,Swapchain *sc,Queue *q,Semaphore *rcs,Semaphore *pcs,RenderPass *rp):RenderTarget(q,rcs)
{
device=dev;
@ -70,7 +70,7 @@ bool SwapchainRenderTarget::Submit(VkCommandBuffer cb)
return queue->Submit(cb,present_complete_semaphore,render_complete_semaphore);
}
bool SwapchainRenderTarget::Submit(VkCommandBuffer cb,GPUSemaphore *pce)
bool SwapchainRenderTarget::Submit(VkCommandBuffer cb,Semaphore *pce)
{
return queue->Submit(cb,pce,render_complete_semaphore);
}