used newly BindCameraUBO

This commit is contained in:
hyzboy 2022-01-10 20:31:04 +08:00
parent 074cb9cc19
commit 1207cb442a
2 changed files with 16 additions and 20 deletions

View File

@ -237,16 +237,7 @@ private:
texture.color_sampler=CreateSampler(texture.color);
texture.normal_sampler=CreateSampler(texture.normal);
{
MaterialParameters *mp_global=sp_gbuffer.material_instance->GetMP(DescriptorSetsType::Global);
if(!mp_global)
return(false);
if(!mp_global->BindUBO("g_camera",GetCameraInfoBuffer()))return(false);
mp_global->Update();
}
BindCameraUBO(sp_gbuffer.material_instance);
{
MaterialParameters *mp=sp_gbuffer.material_instance->GetMP(DescriptorSetsType::Value);
@ -259,16 +250,7 @@ private:
mp->Update();
}
{
MaterialParameters *mp_global=sp_composition.material_instance->GetMP(DescriptorSetsType::Global);
if(!mp_global)
return(false);
if(!mp_global->BindUBO("g_camera",GetCameraInfoBuffer()))return(false);
mp_global->Update();
}
BindCameraUBO(sp_composition.material_instance);
{
MaterialParameters *mp=sp_composition.material_instance->GetMP(DescriptorSetsType::Value);

View File

@ -367,6 +367,20 @@ public:
return ubo_camera_info;
}
bool BindCameraUBO(MaterialInstance *mi)
{
MaterialParameters *mp_global=mi->GetMP(DescriptorSetsType::Global);
if(!mp_global)
return(false);
if(!mp_global->BindUBO("g_camera",ubo_camera_info))return(false);
mp_global->Update();
return(true);
}
virtual void BuildCommandBuffer(uint32_t index)=0;
inline bool isPush(enum class KeyboardButton kb)const{return key_status[size_t(kb)];}