add RenderpassCreater class

This commit is contained in:
hyzboy 2020-01-21 18:57:26 +08:00
parent 9f2f853c10
commit 6463cd41e0

View File

@ -46,5 +46,37 @@ public:
const List<VkFormat> & GetColorFormat()const{return color_formats;} const List<VkFormat> & GetColorFormat()const{return color_formats;}
const VkFormat GetDepthFormat()const{return depth_format;} const VkFormat GetDepthFormat()const{return depth_format;}
};//class RenderPass };//class RenderPass
class RenderpassCreater
{
Device *device;
List<VkAttachmentDescription> atta_desc_list;
public:
RenderpassCreater(Device *d)
{
device=d;
}
~RenderpassCreater()=default;
int AddSwapchainImage()
{
VkAttachmentDescription desc;
desc.format = device->GetSurfaceFormat();
desc.samples = VK_SAMPLE_COUNT_1_BIT;
desc.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
desc.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
desc.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
desc.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
desc.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
desc.finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
return atta_desc_list.Add(desc);
}
};//class RenderpassCreater
VK_NAMESPACE_END VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_RENDER_PASS_INCLUDE #endif//HGL_GRAPH_VULKAN_RENDER_PASS_INCLUDE