redefined VAB = VertexAttributeBinding

This commit is contained in:
hyzboy 2021-11-29 17:04:55 +08:00
parent af72c68ebe
commit 7d05d67cd2
8 changed files with 19 additions and 15 deletions

View File

@ -114,7 +114,9 @@ class MaterialInstance;
struct PipelineData;
enum class InlinePipeline;
class Pipeline;
class VertexAttributeBinding;
using VAB=VertexAttributeBinding;
class Renderable;
class RenderableInstance;

View File

@ -15,7 +15,7 @@ struct MaterialData
MaterialDescriptorSets *mds;
VertexShaderModule *vertex_sm;
VertexAttributeBinding *vbo;
VertexAttributeBinding *vab;
List<VkPipelineShaderStageCreateInfo> shader_stage_list;
@ -63,7 +63,7 @@ public:
const VkPipelineLayout GetPipelineLayout ()const;
const PipelineLayoutData * GetPipelineLayoutData ()const{return data->pipeline_layout_data;}
const VertexAttributeBinding * GetVBO ()const{return data->vbo;}
const VertexAttributeBinding * GetVAB ()const{return data->vab;}
public:

View File

@ -86,8 +86,8 @@ public:
public:
VertexAttributeBinding * CreateVertexAttributeBinding();
bool Release(VertexAttributeBinding *);
VAB * CreateVAB();
bool Release(VAB *);
const uint32_t GetInstanceCount()const{return vab_sets.GetCount();}
};//class VertexShaderModule:public ShaderModule
VK_NAMESPACE_END

View File

@ -33,5 +33,7 @@ public:
const VkVertexInputBindingDescription * GetVertexBindingList ()const{return binding_list;}
const VkVertexInputAttributeDescription * GetVertexAttributeList ()const{return attribute_list;}
};//class VertexAttributeBinding
using VAB=VertexAttributeBinding;
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_VERTEX_ATTRIBUTE_BINDING_INCLUDE

View File

@ -104,7 +104,7 @@ Material *GPUDevice::CreateMaterial(const UTF8String &mtl_name,ShaderModuleMap *
data->shader_maps =shader_maps;
data->mds =mds;
data->vertex_sm =(VertexShaderModule *)vsm;
data->vbo =data->vertex_sm->CreateVertexAttributeBinding();
data->vab =data->vertex_sm->CreateVAB();
CreateShaderStageList(data->shader_stage_list,shader_maps);

View File

@ -9,10 +9,10 @@ MaterialData::~MaterialData()
SAFE_CLEAR(mp.r);
SAFE_CLEAR(mp.g);
if(vbo)
if(vab)
{
vertex_sm->Release(vbo);
delete vbo;
vertex_sm->Release(vab);
delete vab;
}
delete shader_maps;

View File

@ -27,13 +27,13 @@ Pipeline *RenderPass::CreatePipeline(const Material *material,PipelineData *data
{
VkPipeline graphicsPipeline;
const VertexAttributeBinding *vbo=material->GetVBO();
const VAB *vab=material->GetVAB();
data->InitVertexInputState( material->GetStageCount(),
material->GetStages(),
vbo->GetVertexAttrCount(),
vbo->GetVertexBindingList(),
vbo->GetVertexAttributeList());
vab->GetVertexAttrCount(),
vab->GetVertexBindingList(),
vab->GetVertexAttributeList());
data->SetColorAttachments(color_formats.GetCount());

View File

@ -88,16 +88,16 @@ VertexShaderModule::~VertexShaderModule()
SAFE_CLEAR_ARRAY(attribute_list);
}
VertexAttributeBinding *VertexShaderModule::CreateVertexAttributeBinding()
VAB *VertexShaderModule::CreateVAB()
{
VertexAttributeBinding *vab=new VertexAttributeBinding(attr_count,binding_list,attribute_list);
VAB *vab=new VAB(attr_count,binding_list,attribute_list);
vab_sets.Add(vab);
return(vab);
}
bool VertexShaderModule::Release(VertexAttributeBinding *vab)
bool VertexShaderModule::Release(VAB *vab)
{
return vab_sets.Delete(vab);
}