ULRE/src/SceneGraph/Vulkan/VKDeviceRenderPass.cpp

31 lines
924 B
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);
2021-09-22 15:32:20 +08:00
{
SwapchainRenderbufferInfo rbi(attr->format,attr->physical_device->GetDepthFormat());
2021-09-16 20:34:12 +08:00
device_render_pass=render_pass_manage->AcquireRenderPass(&rbi);
2021-09-22 15:32:20 +08:00
}
}
RenderPass *GPUDevice::AcquireRenderPass(const RenderbufferInfo *rbi)
{
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);
}
VK_NAMESPACE_END