所有PipelineCreater定义改用智能指针

This commit is contained in:
2019-07-05 17:00:49 +08:00
parent 8c1de18045
commit 1e8eb7d6bf
13 changed files with 108 additions and 130 deletions

View File

@@ -137,31 +137,35 @@ private:
bool InitPipeline()
{
vulkan::PipelineCreater *pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent());
SharedPtr<vulkan::PipelineCreater>
pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent());
pipeline_creater->SetDepthTest(true);
pipeline_creater->SetDepthWrite(true);
pipeline_creater->Set(PRIM_LINES);
pipeline_line=pipeline_creater->Create();
if(!pipeline_line)
return(false);
db->Add(pipeline_line);
pipeline_creater->Set(PRIM_TRIANGLES);
pipeline_creater->SetPolygonMode(VK_POLYGON_MODE_LINE);
pipeline_solid=pipeline_creater->Create();
db->Add(pipeline_solid);
pipeline_creater->SetCullMode(VK_CULL_MODE_NONE);
pipeline_twoside=pipeline_creater->Create();
db->Add(pipeline_twoside);
delete pipeline_creater;
if(!pipeline_line)
return(false);
if(!pipeline_solid)
return(false);
db->Add(pipeline_solid);
pipeline_creater->SetCullMode(VK_CULL_MODE_NONE);
pipeline_twoside=pipeline_creater->Create();
if(!pipeline_twoside)
return(false);
db->Add(pipeline_twoside);
return(true);
}