add CreatePipeline functions at RenderTarget,remove other they at other places.
This commit is contained in:
@@ -33,8 +33,8 @@ enum class GBufferAttachment
|
||||
ENUM_CLASS_RANGE(Color,Normal)
|
||||
};//
|
||||
|
||||
constexpr VkFormat gbuffer_color_format[size_t(GBufferAttachment::RANGE_SIZE)]={UFMT_RGB565,UFMT_RG8};
|
||||
constexpr VkFormat gbuffer_depth_format=FMT_D32F;
|
||||
constexpr VkFormat gbuffer_color_format[size_t(GBufferAttachment::RANGE_SIZE)]={UFMT_RGB565,FMT_RG8UN};
|
||||
constexpr VkFormat gbuffer_depth_format=FMT_D16UN;
|
||||
|
||||
struct alignas(16) PhongPointLight
|
||||
{
|
||||
@@ -105,7 +105,7 @@ private:
|
||||
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
|
||||
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
|
||||
|
||||
return(true);
|
||||
return(gbuffer_rt);
|
||||
}
|
||||
|
||||
bool InitSubpass(SubpassParam *sp,const OSString &material_filename)
|
||||
@@ -121,18 +121,18 @@ private:
|
||||
|
||||
bool InitGBufferPipeline(SubpassParam *sp)
|
||||
{
|
||||
sp->pipeline_triangles =db->CreatePipeline(sp->material,gbuffer_rt,InlinePipeline::Solid3D,Prim::Triangles);
|
||||
sp->pipeline_triangles =gbuffer_rt->CreatePipeline(sp->material,InlinePipeline::Solid3D,Prim::Triangles);
|
||||
if(!sp->pipeline_triangles)
|
||||
return(false);
|
||||
|
||||
sp->pipeline_fan =db->CreatePipeline(sp->material,gbuffer_rt,InlinePipeline::Solid3D,Prim::Fan);
|
||||
sp->pipeline_fan =gbuffer_rt->CreatePipeline(sp->material,InlinePipeline::Solid3D,Prim::Fan);
|
||||
|
||||
return sp->pipeline_fan;
|
||||
}
|
||||
|
||||
bool InitCompositionPipeline(SubpassParam *sp)
|
||||
{
|
||||
sp->pipeline_fan=db->CreatePipeline(sp->material,sc_render_target,InlinePipeline::Solid2D,Prim::Fan);
|
||||
sp->pipeline_fan=sc_render_target->CreatePipeline(sp->material,InlinePipeline::Solid2D,Prim::Fan);
|
||||
|
||||
return sp->pipeline_fan;
|
||||
}
|
||||
|
@@ -70,7 +70,7 @@ public:
|
||||
os.material_instance=db->CreateMaterialInstance(OS_TEXT("res/material/VertexColor2D"));
|
||||
if(!os.material_instance)return(false);
|
||||
|
||||
os.pipeline=db->CreatePipeline(os.material_instance,os.render_taget,InlinePipeline::Solid2D,Prim::Fan);
|
||||
os.pipeline=os.render_taget->CreatePipeline(os.material_instance,InlinePipeline::Solid2D,Prim::Fan);
|
||||
if(!os.pipeline)return(false);
|
||||
|
||||
if(!InitUBO(&os,os.render_taget->GetExtent()))
|
||||
|
@@ -256,6 +256,9 @@ public:
|
||||
BuildCommandBuffer(sc_render_target->GetCurrentFrameIndices(),rl);
|
||||
}
|
||||
|
||||
template<typename ...ARGS>
|
||||
Pipeline *CreatePipeline(ARGS...args){return sc_render_target->CreatePipeline(args...);}
|
||||
|
||||
public:
|
||||
|
||||
int AcquireNextImage()
|
||||
@@ -291,38 +294,6 @@ public:
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
public: //pipeline
|
||||
|
||||
Pipeline *CreatePipeline(Material *mtl,const InlinePipeline &ip,const Prim &prim=Prim::Triangles,const bool prim_restart=false)
|
||||
{
|
||||
return db->CreatePipeline(mtl,sc_render_target,ip,prim,prim_restart);
|
||||
}
|
||||
|
||||
Pipeline *CreatePipeline(MaterialInstance *mi,const InlinePipeline &ip,const Prim &prim=Prim::Triangles,const bool prim_restart=false)
|
||||
{
|
||||
return db->CreatePipeline(mi,sc_render_target,ip,prim,prim_restart);
|
||||
}
|
||||
|
||||
Pipeline *CreatePipeline(Material *mtl,PipelineData *pd,const Prim &prim=Prim::Triangles,const bool prim_restart=false)
|
||||
{
|
||||
return db->CreatePipeline(mtl,sc_render_target,pd,prim,prim_restart);
|
||||
}
|
||||
|
||||
Pipeline *CreatePipeline(MaterialInstance *mi,PipelineData *pd,const Prim &prim=Prim::Triangles,const bool prim_restart=false)
|
||||
{
|
||||
return db->CreatePipeline(mi,sc_render_target,pd,prim,prim_restart);
|
||||
}
|
||||
|
||||
Pipeline *CreatePipeline(Material *mtl,const OSString &pipeline_name,const Prim &prim=Prim::Triangles,const bool prim_restart=false)
|
||||
{
|
||||
return db->CreatePipeline(mtl,sc_render_target,pipeline_name,prim,prim_restart);
|
||||
}
|
||||
|
||||
Pipeline *CreatePipeline(MaterialInstance *mi,const OSString &pipeline_name,const Prim &prim=Prim::Triangles,const bool prim_restart=false)
|
||||
{
|
||||
return db->CreatePipeline(mi,sc_render_target,pipeline_name,prim,prim_restart);
|
||||
}
|
||||
};//class VulkanApplicationFramework
|
||||
|
||||
class CameraAppFramework:public VulkanApplicationFramework
|
||||
|
Reference in New Issue
Block a user