optimized DescriptorSets::Update
This commit is contained in:
parent
ae85d3fc66
commit
255c7859f1
@ -23,9 +23,10 @@ Output
|
|||||||
|
|
||||||
Code
|
Code
|
||||||
{
|
{
|
||||||
|
void main()
|
||||||
|
{
|
||||||
gl_Position=GetPosition3D();
|
gl_Position=GetPosition3D();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#Fragment
|
#Fragment
|
||||||
|
@ -92,7 +92,7 @@ private:
|
|||||||
camera_control->SetTarget(Vector3f(0,0,0));
|
camera_control->SetTarget(Vector3f(0,0,0));
|
||||||
camera_control->Refresh();
|
camera_control->Refresh();
|
||||||
|
|
||||||
cmc->SetReserveDirection(true,true); //反转x,y
|
camera_control->SetReserveDirection(true,true); //反转x,y
|
||||||
|
|
||||||
render_root.RefreshMatrix();
|
render_root.RefreshMatrix();
|
||||||
render_list->Expend(&render_root);
|
render_list->Expend(&render_root);
|
||||||
|
@ -81,6 +81,8 @@ public:
|
|||||||
bool BindSSBO(const DescriptorSetType &type,const AnsiString &name,DeviceBuffer *ubo,bool dynamic=false);
|
bool BindSSBO(const DescriptorSetType &type,const AnsiString &name,DeviceBuffer *ubo,bool dynamic=false);
|
||||||
bool BindImageSampler(const DescriptorSetType &type,const AnsiString &name,Texture *tex,Sampler *sampler);
|
bool BindImageSampler(const DescriptorSetType &type,const AnsiString &name,Texture *tex,Sampler *sampler);
|
||||||
|
|
||||||
|
void Update();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
const bool HasMI ()const{return mi_data_bytes>0;}
|
const bool HasMI ()const{return mi_data_bytes>0;}
|
||||||
|
@ -117,6 +117,8 @@ bool RenderCmdBuffer::BindDescriptorSets(Material *mtl)
|
|||||||
|
|
||||||
if(mp)
|
if(mp)
|
||||||
{
|
{
|
||||||
|
mp->Update();
|
||||||
|
|
||||||
ds[count]=mp->GetVkDescriptorSet();
|
ds[count]=mp->GetVkDescriptorSet();
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ Material::~Material()
|
|||||||
SAFE_CLEAR(desc_manager);
|
SAFE_CLEAR(desc_manager);
|
||||||
SAFE_CLEAR(pipeline_layout_data);
|
SAFE_CLEAR(pipeline_layout_data);
|
||||||
|
|
||||||
for(int i=0;i<DESCRIPTOR_SET_TYPE_COUNT;i++)
|
for(auto &mp:mp_array)
|
||||||
SAFE_CLEAR(mp_array[i]);
|
SAFE_CLEAR(mp);
|
||||||
}
|
}
|
||||||
|
|
||||||
const VkPipelineLayout Material::GetPipelineLayout()const
|
const VkPipelineLayout Material::GetPipelineLayout()const
|
||||||
@ -74,10 +74,7 @@ bool Material::BindUBO(const DescriptorSetType &type,const AnsiString &name,Devi
|
|||||||
if(!mp)
|
if(!mp)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
if(!mp->BindUBO(name,ubo,dynamic))return(false);
|
return mp->BindUBO(name,ubo,dynamic);
|
||||||
|
|
||||||
mp->Update();
|
|
||||||
return(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Material::BindSSBO(const DescriptorSetType &type,const AnsiString &name,DeviceBuffer *ubo,bool dynamic)
|
bool Material::BindSSBO(const DescriptorSetType &type,const AnsiString &name,DeviceBuffer *ubo,bool dynamic)
|
||||||
@ -87,10 +84,7 @@ bool Material::BindSSBO(const DescriptorSetType &type,const AnsiString &name,Dev
|
|||||||
if(!mp)
|
if(!mp)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
if(!mp->BindSSBO(name,ubo,dynamic))return(false);
|
return mp->BindSSBO(name,ubo,dynamic);
|
||||||
|
|
||||||
mp->Update();
|
|
||||||
return(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Material::BindImageSampler(const DescriptorSetType &type,const AnsiString &name,Texture *tex,Sampler *sampler)
|
bool Material::BindImageSampler(const DescriptorSetType &type,const AnsiString &name,Texture *tex,Sampler *sampler)
|
||||||
@ -100,9 +94,15 @@ bool Material::BindImageSampler(const DescriptorSetType &type,const AnsiString &
|
|||||||
if(!mp)
|
if(!mp)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
if(!mp->BindImageSampler(name,tex,sampler))return(false);
|
return mp->BindImageSampler(name,tex,sampler);
|
||||||
|
}
|
||||||
|
|
||||||
mp->Update();
|
void Material::Update()
|
||||||
return(true);
|
{
|
||||||
|
for(auto &mp:mp_array)
|
||||||
|
{
|
||||||
|
if(mp)
|
||||||
|
mp->Update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
VK_NAMESPACE_END
|
VK_NAMESPACE_END
|
||||||
|
Loading…
x
Reference in New Issue
Block a user