2020-10-21 11:43:18 +08:00
|
|
|
|
#include<hgl/graph/VKMaterial.h>
|
2021-06-16 11:43:19 +08:00
|
|
|
|
#include<hgl/graph/VKMaterialParameters.h>
|
2023-03-20 13:55:47 +08:00
|
|
|
|
#include<hgl/graph/VKMaterialDescriptorManager.h>
|
2023-03-19 19:41:21 +08:00
|
|
|
|
#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()
|
2019-04-28 21:25:52 +08:00
|
|
|
|
{
|
2023-03-22 19:39:03 +08:00
|
|
|
|
for(int i=0;i<DESCRIPTOR_SET_TYPE_COUNT;i++)
|
2023-02-22 21:50:18 +08:00
|
|
|
|
if(mp_array[i])
|
|
|
|
|
delete mp_array[i];
|
2019-05-24 23:51:45 +08:00
|
|
|
|
|
2019-04-28 16:06:53 +08:00
|
|
|
|
delete shader_maps;
|
2023-03-21 21:46:16 +08:00
|
|
|
|
SAFE_CLEAR(desc_manager);
|
2023-03-19 19:41:21 +08:00
|
|
|
|
|
|
|
|
|
delete vertex_input;
|
2019-04-25 10:09:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
2021-09-14 20:31:15 +08:00
|
|
|
|
Material::~Material()
|
2019-05-05 18:00:26 +08:00
|
|
|
|
{
|
2021-09-14 20:31:15 +08:00
|
|
|
|
delete data->pipeline_layout_data;
|
|
|
|
|
delete data;
|
2019-04-28 16:06:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
|
2023-02-22 21:53:51 +08:00
|
|
|
|
const bool Material::hasSet(const DescriptorSetType &dst)const
|
2023-02-22 21:50:18 +08:00
|
|
|
|
{
|
2023-03-21 21:46:16 +08:00
|
|
|
|
return data->desc_manager->hasSet(dst);
|
2023-02-22 21:50:18 +08:00
|
|
|
|
}
|
2023-03-19 19:41:21 +08:00
|
|
|
|
|
|
|
|
|
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
|