Moved Pipeline to MaterialRenderMap from MaterialRenderList
This commit is contained in:
@@ -8,6 +8,41 @@ class RenderAssignBuffer;
|
||||
class SceneNode;
|
||||
struct CameraInfo;
|
||||
|
||||
struct RenderPipelineIndex
|
||||
{
|
||||
Material *material;
|
||||
Pipeline *pipeline;
|
||||
|
||||
public:
|
||||
|
||||
const int Comp(const RenderPipelineIndex &rli)const
|
||||
{
|
||||
if(material<rli.material)return(-1);
|
||||
if(material>rli.material)return(1);
|
||||
|
||||
if(pipeline<rli.pipeline)return(-1);
|
||||
if(pipeline>rli.pipeline)return(1);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
CompOperator(const RenderPipelineIndex &,Comp)
|
||||
|
||||
public:
|
||||
|
||||
RenderPipelineIndex()
|
||||
{
|
||||
material=nullptr;
|
||||
pipeline=nullptr;
|
||||
}
|
||||
|
||||
RenderPipelineIndex(Material *m,Pipeline *p)
|
||||
{
|
||||
material=m;
|
||||
pipeline=p;
|
||||
}
|
||||
};//struct RenderPipelineIndex
|
||||
|
||||
/**
|
||||
* 同一材质的对象渲染列表
|
||||
*/
|
||||
@@ -16,7 +51,7 @@ class MaterialRenderList
|
||||
GPUDevice *device;
|
||||
RenderCmdBuffer *cmd_buf;
|
||||
|
||||
Material *material;
|
||||
RenderPipelineIndex rp_index;
|
||||
|
||||
CameraInfo *camera_info;
|
||||
|
||||
@@ -33,7 +68,6 @@ private:
|
||||
uint32_t first_instance; ///<第一个绘制实例(和instance渲染无关,对应InstanceRate的VAB)
|
||||
uint32_t instance_count;
|
||||
|
||||
Pipeline * pipeline;
|
||||
MaterialInstance * mi;
|
||||
|
||||
const PrimitiveDataBuffer * pdb;
|
||||
@@ -60,7 +94,6 @@ protected:
|
||||
|
||||
VABList * vab_list;
|
||||
|
||||
Pipeline * last_pipeline;
|
||||
const PrimitiveDataBuffer * last_data_buffer;
|
||||
const VDM * last_vdm;
|
||||
const PrimitiveRenderData * last_render_data;
|
||||
@@ -75,7 +108,7 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
MaterialRenderList(GPUDevice *d,bool l2w,Material *m);
|
||||
MaterialRenderList(GPUDevice *d,bool l2w,const RenderPipelineIndex &rpi);
|
||||
~MaterialRenderList();
|
||||
|
||||
void Add(SceneNode *);
|
||||
|
Reference in New Issue
Block a user