改进PipelineCreateInfo存档,并增加部分读档操作
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
using namespace hgl;
|
||||
using namespace hgl::graph;
|
||||
|
||||
bool SaveToFile(const OSString &filename,const VkGraphicsPipelineCreateInfo *info);
|
||||
bool SaveToFile(const OSString &filename,VK_NAMESPACE::PipelineCreater *pc);
|
||||
bool LoadFromFile(const OSString &filename,VK_NAMESPACE::PipelineCreater *pc);
|
||||
|
||||
constexpr uint32_t SCREEN_WIDTH=128;
|
||||
constexpr uint32_t SCREEN_HEIGHT=128;
|
||||
@@ -104,22 +105,26 @@ private:
|
||||
{
|
||||
constexpr os_char PIPELINE_FILENAME[]=OS_TEXT("2DSolid.pipeline");
|
||||
|
||||
//vulkan::PipelineCreater *pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetRenderPass());
|
||||
//pipeline_creater->SetDepthTest(false);
|
||||
//pipeline_creater->SetDepthWrite(false);
|
||||
//pipeline_creater->CloseCullFace();
|
||||
//pipeline_creater->Set(PRIM_TRIANGLES);
|
||||
{
|
||||
vulkan::PipelineCreater *pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetRenderPass());
|
||||
pipeline_creater->SetDepthTest(false);
|
||||
pipeline_creater->SetDepthWrite(false);
|
||||
pipeline_creater->CloseCullFace();
|
||||
pipeline_creater->Set(PRIM_TRIANGLES);
|
||||
|
||||
vulkan::PipelineCreater *pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetRenderPass());
|
||||
SaveToFile(PIPELINE_FILENAME,pipeline_creater);
|
||||
|
||||
pipeline=pipeline_creater->Create();
|
||||
delete pipeline_creater;
|
||||
}
|
||||
|
||||
SaveToFile(PIPELINE_FILENAME,pipeline_creater->GetInfo());
|
||||
{
|
||||
vulkan::PipelineCreater *pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetRenderPass());
|
||||
|
||||
delete pipeline_creater;
|
||||
delete pipeline;
|
||||
LoadFromFile(PIPELINE_FILENAME,pipeline_creater);
|
||||
pipeline=pipeline_creater->Create();
|
||||
|
||||
|
||||
delete pipeline_creater;
|
||||
}
|
||||
|
||||
return pipeline;
|
||||
}
|
||||
|
Reference in New Issue
Block a user