moved CreatePipeline functions to RenderPass class.

This commit is contained in:
2021-09-22 17:15:17 +08:00
parent fa47bc552c
commit 2753f95999
17 changed files with 140 additions and 154 deletions

View File

@@ -44,7 +44,7 @@ private:
bool RecreatePipeline()
{
// pipeline=db->CreatePipeline(material_instance,sc_render_target,OS_TEXT("res/pipeline/solid2d"));
pipeline=CreatePipeline(material_instance,InlinePipeline::Solid2D); //等同上一行为Framework重载默认使用swapchain的render target
pipeline=CreatePipeline(material_instance,InlinePipeline::Solid2D,Prim::Triangles); //等同上一行为Framework重载默认使用swapchain的render target
return pipeline;
}

View File

@@ -48,6 +48,7 @@ protected:
protected:
GPUDevice * device =nullptr;
RenderPass * device_render_pass =nullptr;
SwapchainRenderTarget * sc_render_target =nullptr;
protected:
@@ -118,6 +119,8 @@ public:
if(!device)
return(false);
device_render_pass=device->GetRenderPass();
db=new RenderResource(device);
InitCommandBuffer();
@@ -258,7 +261,7 @@ public:
}
template<typename ...ARGS>
Pipeline *CreatePipeline(ARGS...args){return sc_render_target->CreatePipeline(args...);}
Pipeline *CreatePipeline(ARGS...args){return device_render_pass->CreatePipeline(args...);}
public: