ULRE/src/SceneGraph/Vulkan/VKDeviceRenderPass.cpp

34 lines
1.0 KiB
C++
Raw Normal View History

#include<hgl/graph/VKDevice.h>
#include<hgl/graph/VKDeviceAttribute.h>
#include<hgl/graph/VKPhysicalDevice.h>
#include<hgl/graph/VKDeviceRenderPassManage.h>
VK_NAMESPACE_BEGIN
void GPUDevice::InitRenderPassManage()
2021-09-16 20:34:12 +08:00
{
render_pass_manage=new DeviceRenderPassManage(attr->device,attr->pipeline_cache);
2021-09-22 15:32:20 +08:00
SwapchainRenderbufferInfo rbi(attr->surface_format.format,attr->physical_device->GetDepthFormat());
2021-09-16 20:34:12 +08:00
device_render_pass=render_pass_manage->AcquireRenderPass(&rbi);
}
void GPUDevice::ClearRenderPassManage()
{
SAFE_CLEAR(render_pass_manage);
}
RenderPass *GPUDevice::AcquireRenderPass(const RenderbufferInfo *rbi,const uint subpass_count)
{
for(const VkFormat &fmt:rbi->GetColorFormatList())
if(!attr->physical_device->IsColorAttachmentOptimal(fmt))
return(nullptr);
if(rbi->HasDepthOrStencil())
if(!attr->physical_device->IsDepthAttachmentOptimal(rbi->GetDepthFormat()))
2020-10-16 19:44:00 +08:00
return(nullptr);
2021-09-22 15:32:20 +08:00
return render_pass_manage->AcquireRenderPass(rbi,subpass_count);
}
VK_NAMESPACE_END