port DeviceRenderPassManage
This commit is contained in:
parent
6b466f63cf
commit
5d3f2cfdfd
@ -1,16 +1,14 @@
|
||||
#ifndef HGL_VULKAN_DEVICE_RENDERPASS_MANAGE_INCLUDE
|
||||
#define HGL_VULKAN_DEVICE_RENDERPASS_MANAGE_INCLUDE
|
||||
#pragma once
|
||||
|
||||
#include<hgl/graph/VK.h>
|
||||
#include<hgl/graph/module/GraphModule.h>
|
||||
#include<hgl/type/Map.h>
|
||||
#include<hgl/util/hash/Hash.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
using RenderPassHASHCode=util::HashCodeSHA1LE;
|
||||
|
||||
class DeviceRenderPassManage
|
||||
class DeviceRenderPassManage:public GraphModule
|
||||
{
|
||||
VkDevice device;
|
||||
VkPipelineCache pipeline_cache;
|
||||
|
||||
util::Hash *hash;
|
||||
@ -21,9 +19,12 @@ private:
|
||||
|
||||
friend class GPUDevice;
|
||||
|
||||
DeviceRenderPassManage(VkDevice,VkPipelineCache);
|
||||
//DeviceRenderPassManage(VkDevice,VkPipelineCache);
|
||||
GRAPH_MODULE_CONSTRUCT(DeviceRenderPassManage)
|
||||
~DeviceRenderPassManage();
|
||||
|
||||
bool Init() override;
|
||||
|
||||
private:
|
||||
|
||||
RenderPass * CreateRenderPass( const List<VkAttachmentDescription> &desc_list,
|
||||
@ -34,4 +35,3 @@ private:
|
||||
RenderPass * AcquireRenderPass( const RenderbufferInfo *,const uint subpass_count=2);
|
||||
};//class DeviceRenderPassManage
|
||||
VK_NAMESPACE_END
|
||||
#endif//HGL_VULKAN_DEVICE_RENDERPASS_MANAGE_INCLUDE
|
||||
|
@ -184,12 +184,13 @@ bool CreateDepthAttachment( List<VkAttachmentReference> &ref_list,List<VkAttachm
|
||||
return(true);
|
||||
}
|
||||
|
||||
DeviceRenderPassManage::DeviceRenderPassManage(VkDevice dev,VkPipelineCache pc)
|
||||
bool DeviceRenderPassManage::Init()
|
||||
{
|
||||
device=dev;
|
||||
pipeline_cache=pc;
|
||||
pipeline_cache=GetDeviceAttribute()->pipeline_cache;
|
||||
|
||||
hash=util::CreateSHA1LEHash();
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
DeviceRenderPassManage::~DeviceRenderPassManage()
|
||||
@ -285,10 +286,10 @@ RenderPass *DeviceRenderPassManage::CreateRenderPass( const List<VkAttachmentD
|
||||
|
||||
VkRenderPass render_pass;
|
||||
|
||||
if(vkCreateRenderPass(device,&rp_info,nullptr,&render_pass)!=VK_SUCCESS)
|
||||
if(vkCreateRenderPass(GetVkDevice(),&rp_info,nullptr,&render_pass)!=VK_SUCCESS)
|
||||
return(nullptr);
|
||||
|
||||
return(new RenderPass(device,pipeline_cache,render_pass,rbi->GetColorFormatList(),depth_format));
|
||||
return(new RenderPass(GetVkDevice(),pipeline_cache,render_pass,rbi->GetColorFormatList(),depth_format));
|
||||
}
|
||||
|
||||
RenderPass *DeviceRenderPassManage::AcquireRenderPass(const RenderbufferInfo *rbi,const uint subpass_count)
|
||||
|
Loading…
x
Reference in New Issue
Block a user