diff --git a/inc/hgl/graph/VK.h b/inc/hgl/graph/VK.h index c5497279..01b39212 100644 --- a/inc/hgl/graph/VK.h +++ b/inc/hgl/graph/VK.h @@ -114,7 +114,9 @@ class MaterialInstance; struct PipelineData; enum class InlinePipeline; class Pipeline; + class VertexAttributeBinding; +using VAB=VertexAttributeBinding; class Renderable; class RenderableInstance; diff --git a/inc/hgl/graph/VKMaterial.h b/inc/hgl/graph/VKMaterial.h index 59d9e523..990135c0 100644 --- a/inc/hgl/graph/VKMaterial.h +++ b/inc/hgl/graph/VKMaterial.h @@ -15,7 +15,7 @@ struct MaterialData MaterialDescriptorSets *mds; VertexShaderModule *vertex_sm; - VertexAttributeBinding *vbo; + VertexAttributeBinding *vab; List 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: diff --git a/inc/hgl/graph/VKShaderModule.h b/inc/hgl/graph/VKShaderModule.h index d7843de3..9b8a688b 100644 --- a/inc/hgl/graph/VKShaderModule.h +++ b/inc/hgl/graph/VKShaderModule.h @@ -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 diff --git a/inc/hgl/graph/VKVertexAttributeBinding.h b/inc/hgl/graph/VKVertexAttributeBinding.h index 8dcda51c..e7dd6b47 100644 --- a/inc/hgl/graph/VKVertexAttributeBinding.h +++ b/inc/hgl/graph/VKVertexAttributeBinding.h @@ -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 diff --git a/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp b/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp index 018e457b..dc9bf730 100644 --- a/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp +++ b/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp @@ -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); diff --git a/src/SceneGraph/Vulkan/VKMaterial.cpp b/src/SceneGraph/Vulkan/VKMaterial.cpp index 32e97431..db6ba3d3 100644 --- a/src/SceneGraph/Vulkan/VKMaterial.cpp +++ b/src/SceneGraph/Vulkan/VKMaterial.cpp @@ -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; diff --git a/src/SceneGraph/Vulkan/VKRenderPass.cpp b/src/SceneGraph/Vulkan/VKRenderPass.cpp index 34dd50d8..725ded90 100644 --- a/src/SceneGraph/Vulkan/VKRenderPass.cpp +++ b/src/SceneGraph/Vulkan/VKRenderPass.cpp @@ -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()); diff --git a/src/SceneGraph/Vulkan/VKShaderModule.cpp b/src/SceneGraph/Vulkan/VKShaderModule.cpp index bdeb5530..49d189c8 100644 --- a/src/SceneGraph/Vulkan/VKShaderModule.cpp +++ b/src/SceneGraph/Vulkan/VKShaderModule.cpp @@ -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); }