ULRE/inc/hgl/graph/VKRenderTarget.h

83 lines
2.1 KiB
C
Raw Normal View History

2025-01-26 23:22:25 +08:00
#pragma once
2019-06-19 21:12:39 +08:00
#include<hgl/graph/VK.h>
#include<hgl/graph/VKRenderPass.h>
#include<hgl/graph/VKFramebuffer.h>
#include<hgl/graph/VKSwapchain.h>
2020-10-21 12:39:22 +08:00
#include<hgl/graph/VKQueue.h>
#include<hgl/graph/VKBuffer.h>
#include<hgl/graph/VKPipeline.h>
2025-01-26 23:22:25 +08:00
#include<hgl/graph/VKCommandBuffer.h>
#include<hgl/graph/VKDescriptorBindingManage.h>
//#include<iostream>
2025-01-25 15:25:29 +08:00
2025-01-26 23:22:25 +08:00
VK_NAMESPACE_BEGIN
2025-02-01 16:32:08 +08:00
class RenderFramework;
using UBOViewportInfo=UBOInstance<graph::ViewportInfo>;
2025-01-25 15:25:29 +08:00
class IRenderTarget
{
2025-02-01 16:32:08 +08:00
RenderFramework *render_framework;
2025-01-26 23:22:25 +08:00
VkExtent2D extent;
UBOViewportInfo *ubo_vp_info;
DescriptorBinding desc_binding;
2025-01-25 15:25:29 +08:00
public:
2025-02-01 16:32:08 +08:00
RenderFramework * GetRenderFramework ()const{return render_framework;}
VulkanDevice * GetDevice ()const;
VkDevice GetVkDevice ()const;
DescriptorBinding * GetDescriptorBinding(){return &desc_binding;}
2025-02-01 16:32:08 +08:00
2025-01-26 23:22:25 +08:00
const VkExtent2D &GetExtent ()const{return extent;}
virtual uint32_t GetColorCount ()=0;
virtual bool hasDepth ()=0;
public:
2025-02-01 16:32:08 +08:00
void OnResize(const VkExtent2D &ext);
public:
IRenderTarget(RenderFramework *,const VkExtent2D &);
virtual ~IRenderTarget();
2025-01-26 23:22:25 +08:00
virtual Framebuffer * GetFramebuffer ()=0;
virtual RenderPass * GetRenderPass ()=0;
2025-01-25 15:25:29 +08:00
2025-01-26 23:22:25 +08:00
virtual Texture2D * GetColorTexture (const int index=0)=0;
virtual Texture2D * GetDepthTexture ()=0;
public: // Command Buffer
virtual DeviceQueue * GetQueue ()=0;
virtual Semaphore * GetRenderCompleteSemaphore()=0;
virtual RenderCmdBuffer * GetRenderCmdBuffer ()=0;
virtual bool Submit (Semaphore *wait_sem)=0;
virtual bool Submit (){return Submit(nullptr);}
virtual bool WaitQueue ()=0;
virtual bool WaitFence ()=0;
virtual RenderCmdBuffer * BeginRender ()=0;
virtual void EndRender ()=0;
public:
virtual ViewportInfo * GetViewportInfo ()
{
return ubo_vp_info->data();
}
2025-01-25 15:25:29 +08:00
};//class IRenderTarget
2019-06-19 21:12:39 +08:00
VK_NAMESPACE_END