remove about swapchain from GPUDevice class.
This commit is contained in:
parent
014d783e73
commit
96c3718b2a
@ -32,23 +32,10 @@ class GPUDevice
|
||||
{
|
||||
GPUDeviceAttribute *attr;
|
||||
|
||||
DeviceQueue *texture_queue;
|
||||
TextureCmdBuffer *texture_cmd_buf;
|
||||
|
||||
private:
|
||||
|
||||
RTSwapchain *sc_rt;
|
||||
|
||||
RTSwapchain *CreateSwapchainRenderTarget();
|
||||
|
||||
private:
|
||||
|
||||
VkCommandBuffer CreateCommandBuffer(const AnsiString &);
|
||||
|
||||
bool CreateSwapchainFBO(Swapchain *);
|
||||
|
||||
Swapchain *CreateSwapchain(const VkExtent2D &acquire_extent);
|
||||
|
||||
private:
|
||||
|
||||
friend class VulkanDeviceCreater;
|
||||
@ -73,10 +60,6 @@ public:
|
||||
const VkColorSpaceKHR GetColorSpace ()const {return attr->surface_format.colorSpace;}
|
||||
VkQueue GetGraphicsQueue () {return attr->graphics_queue;}
|
||||
|
||||
RTSwapchain * GetSwapchainRT () {return sc_rt;}
|
||||
|
||||
const VkExtent2D & GetSwapchainSize ()const {return sc_rt->GetExtent();}
|
||||
|
||||
void WaitIdle ()const {vkDeviceWaitIdle(attr->device);}
|
||||
|
||||
DebugUtils * GetDebugUtils (){return attr->debug_utils;}
|
||||
|
@ -1,50 +1,18 @@
|
||||
#include<hgl/graph/VKDevice.h>
|
||||
#include<hgl/type/Pair.h>
|
||||
#include<hgl/graph/VKSemaphore.h>
|
||||
#include<hgl/graph/VKTexture.h>
|
||||
#include<hgl/graph/VKImageView.h>
|
||||
#include<hgl/graph/VKPipeline.h>
|
||||
#include<hgl/graph/VKCommandBuffer.h>
|
||||
#include<hgl/graph/VKRenderPass.h>
|
||||
#include<hgl/graph/VKFramebuffer.h>
|
||||
#include<hgl/graph/VKDescriptorSet.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
GPUDevice::GPUDevice(GPUDeviceAttribute *da)
|
||||
{
|
||||
attr=da;
|
||||
|
||||
texture_queue=nullptr;
|
||||
texture_cmd_buf=nullptr;
|
||||
|
||||
sc_rt=nullptr;
|
||||
Resize(attr->surface_caps.currentExtent);
|
||||
|
||||
texture_cmd_buf=CreateTextureCommandBuffer(attr->physical_device->GetDeviceName()+AnsiString(":TexCmdBuffer"));
|
||||
texture_queue=CreateQueue();
|
||||
}
|
||||
|
||||
GPUDevice::~GPUDevice()
|
||||
{
|
||||
SAFE_CLEAR(sc_rt);
|
||||
|
||||
SAFE_CLEAR(texture_queue);
|
||||
SAFE_CLEAR(texture_cmd_buf);
|
||||
|
||||
delete attr;
|
||||
}
|
||||
|
||||
bool GPUDevice::Resize(const VkExtent2D &extent)
|
||||
{
|
||||
SAFE_CLEAR(sc_rt);
|
||||
|
||||
attr->RefreshSurfaceCaps();
|
||||
|
||||
sc_rt=CreateSwapchainRenderTarget();
|
||||
|
||||
return(sc_rt);
|
||||
}
|
||||
|
||||
VkCommandBuffer GPUDevice::CreateCommandBuffer(const AnsiString &name)
|
||||
{
|
||||
if(!attr->cmd_pool)
|
||||
|
Loading…
x
Reference in New Issue
Block a user