added comp operator in MaterialConfig
This commit is contained in:
parent
2f560a28a7
commit
6b13c159d8
@ -31,6 +31,25 @@ public:
|
|||||||
else
|
else
|
||||||
position_format=VAT_VEC2;
|
position_format=VAT_VEC2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Comp(const Material2DCreateConfig &cfg)const
|
||||||
|
{
|
||||||
|
int off=MaterialCreateConfig::Comp(cfg);
|
||||||
|
|
||||||
|
if(off)return off;
|
||||||
|
|
||||||
|
off=(int)coordinate_system-(int)cfg.coordinate_system;
|
||||||
|
if(off)return off;
|
||||||
|
|
||||||
|
off=local_to_world-cfg.local_to_world;
|
||||||
|
if(off)return off;
|
||||||
|
|
||||||
|
off=position_format.Comp(cfg.position_format);
|
||||||
|
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
|
||||||
|
CompOperator(const Material2DCreateConfig &,Comp)
|
||||||
};//struct Material2DCreateConfig:public MaterialCreateConfig
|
};//struct Material2DCreateConfig:public MaterialCreateConfig
|
||||||
|
|
||||||
MaterialCreateInfo *CreateVertexColor2D(const Material2DCreateConfig *);
|
MaterialCreateInfo *CreateVertexColor2D(const Material2DCreateConfig *);
|
||||||
|
@ -30,6 +30,25 @@ public:
|
|||||||
|
|
||||||
// reverse_depth=false;
|
// reverse_depth=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Comp(const Material3DCreateConfig &cfg)const
|
||||||
|
{
|
||||||
|
int off=MaterialCreateConfig::Comp(cfg);
|
||||||
|
|
||||||
|
if(off)return off;
|
||||||
|
|
||||||
|
off=camera-cfg.camera;
|
||||||
|
if(off)return off;
|
||||||
|
|
||||||
|
off=local_to_world-cfg.local_to_world;
|
||||||
|
if(off)return off;
|
||||||
|
|
||||||
|
off=position_format.Comp(cfg.position_format);
|
||||||
|
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
|
||||||
|
CompOperator(const Material3DCreateConfig &,Comp)
|
||||||
};//struct Material3DCreateConfig:public MaterialCreateConfig
|
};//struct Material3DCreateConfig:public MaterialCreateConfig
|
||||||
|
|
||||||
MaterialCreateInfo *CreateVertexColor3D(const Material3DCreateConfig *);
|
MaterialCreateInfo *CreateVertexColor3D(const Material3DCreateConfig *);
|
||||||
|
@ -37,6 +37,23 @@ public:
|
|||||||
|
|
||||||
prim=p;
|
prim=p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Comp(const MaterialCreateConfig &cfg)const
|
||||||
|
{
|
||||||
|
int off;
|
||||||
|
|
||||||
|
off=hgl_cmp(rt_output,cfg.rt_output);
|
||||||
|
|
||||||
|
if(off)return(off);
|
||||||
|
|
||||||
|
off=(int)prim-(int)cfg.prim;
|
||||||
|
|
||||||
|
if(off)return(off);
|
||||||
|
|
||||||
|
return shader_stage_flag_bit-cfg.shader_stage_flag_bit;
|
||||||
|
}
|
||||||
|
|
||||||
|
CompOperator(const MaterialCreateConfig &,Comp)
|
||||||
};//struct MaterialCreateConfig
|
};//struct MaterialCreateConfig
|
||||||
STD_MTL_NAMESPACE_END
|
STD_MTL_NAMESPACE_END
|
||||||
#endif//HGL_GRAPH_MTL_CONFIG_INCLUDE
|
#endif//HGL_GRAPH_MTL_CONFIG_INCLUDE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user