完成PipelineCreateInfo.POD加载

This commit is contained in:
2019-05-17 19:22:13 +08:00
parent 9ff64dab91
commit 7ee063a49c
5 changed files with 216 additions and 111 deletions

View File

@@ -3,6 +3,7 @@
#include"VulkanAppFramework.h"
#include<hgl/math/Math.h>
#include<hgl/filesystem/FileSystem.h>
using namespace hgl;
using namespace hgl::graph;
@@ -105,22 +106,24 @@ 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(),device->GetExtent());
// pipeline_creater->SetDepthTest(false);
// pipeline_creater->SetDepthWrite(false);
// pipeline_creater->CloseCullFace();
// pipeline_creater->Set(PRIM_TRIANGLES);
SaveToFile(PIPELINE_FILENAME,pipeline_creater);
// SaveToFile(PIPELINE_FILENAME,pipeline_creater);
delete pipeline_creater;
}
// delete pipeline_creater;
//}
{
vulkan::PipelineCreater *pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetRenderPass());
void *data;
uint size=filesystem::LoadFileToMemory(PIPELINE_FILENAME,(void **)&data);
vulkan::PipelineCreater *pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetRenderPass(),device->GetExtent(),(uchar *)data,size);
LoadFromFile(PIPELINE_FILENAME,pipeline_creater);
pipeline=pipeline_creater->Create();
delete pipeline_creater;