ULRE/src/SceneGraph/Vulkan/VKMaterial.cpp

50 lines
1.0 KiB
C++
Raw Normal View History

#include<hgl/graph/VKMaterial.h>
#include<hgl/graph/VKMaterialParameters.h>
#include<hgl/graph/VKMaterialDescriptorManager.h>
#include<hgl/graph/VKVertexInput.h>
2021-09-14 20:31:15 +08:00
#include"VKPipelineLayoutData.h"
2019-04-25 10:09:56 +08:00
VK_NAMESPACE_BEGIN
2021-09-14 20:31:15 +08:00
MaterialData::~MaterialData()
{
for(int i=0;i<int(DescriptorSetType::RANGE_SIZE);i++)
2023-02-22 21:50:18 +08:00
if(mp_array[i])
delete mp_array[i];
delete shader_maps;
2021-09-13 20:39:25 +08:00
SAFE_CLEAR(mds);
delete vertex_input;
2019-04-25 10:09:56 +08:00
}
2021-09-14 20:31:15 +08:00
Material::~Material()
{
2021-09-14 20:31:15 +08:00
delete data->pipeline_layout_data;
delete data;
}
2021-09-14 20:31:15 +08:00
const VkPipelineLayout Material::GetPipelineLayout()const
2019-04-27 01:36:58 +08:00
{
2021-09-14 20:31:15 +08:00
return data->pipeline_layout_data->pipeline_layout;
2019-04-25 10:09:56 +08:00
}
2023-02-22 21:50:18 +08:00
const bool Material::hasSet(const DescriptorSetType &dst)const
2023-02-22 21:50:18 +08:00
{
return data->mds->hasSet(dst);
}
VIL *Material::CreateVIL(const VILConfig *format_map)
{
return data->vertex_input->CreateVIL(format_map);
}
bool Material::Release(VIL *vil)
{
return data->vertex_input->Release(vil);
}
const uint Material::GetVILCount()
{
return data->vertex_input->GetInstanceCount();
}
2019-04-25 10:09:56 +08:00
VK_NAMESPACE_END