added half codes.
This commit is contained in:
parent
49f37447d0
commit
e488b4c3d3
@ -12,7 +12,7 @@ namespace hgl
|
||||
{
|
||||
using RenderableList=List<Renderable *>;
|
||||
|
||||
struct RenderableList
|
||||
struct MaterialRenderableList
|
||||
{
|
||||
Material *mtl;
|
||||
|
||||
|
@ -26,7 +26,13 @@ public:
|
||||
|
||||
const VIL *GetVIL()const{return vil;}
|
||||
MaterialParameters *GetMP(){return mp_per_mi;}
|
||||
MaterialParameters *GetMP(const DescriptorSetType &type){return material->GetMP(type);}
|
||||
MaterialParameters *GetMP(const DescriptorSetType &type)
|
||||
{
|
||||
if(type==DescriptorSetType::PerMaterial)
|
||||
return mp_per_mi;
|
||||
else
|
||||
return material->GetMP(type);
|
||||
}
|
||||
|
||||
bool BindUBO(const DescriptorSetType &type,const AnsiString &name,DeviceBuffer *ubo,bool dynamic=false);
|
||||
bool BindSSBO(const DescriptorSetType &type,const AnsiString &name,DeviceBuffer *ubo,bool dynamic=false);
|
||||
|
@ -21,7 +21,10 @@ MaterialInstance::MaterialInstance(Material *mtl,VIL *v)
|
||||
|
||||
vil=v;
|
||||
|
||||
mp_per_mi=mtl->GetMP(DescriptorSetType::PerMaterial);
|
||||
mp_per_mi=
|
||||
device->CreateMP(desc_manager,pld,(DescriptorSetType)dst);
|
||||
PerMaterial的属性每个MaterialInstance不一样,所以需要在这里分配自己的MP做绑定记录
|
||||
mtl->GetMP(DescriptorSetType::PerMaterial);
|
||||
}
|
||||
|
||||
bool MaterialInstance::BindUBO(const DescriptorSetType &type,const AnsiString &name,DeviceBuffer *ubo,bool dynamic)
|
||||
|
Loading…
x
Reference in New Issue
Block a user