redefined VAB = VertexAttributeBinding
This commit is contained in:
parent
af72c68ebe
commit
7d05d67cd2
@ -114,7 +114,9 @@ class MaterialInstance;
|
||||
struct PipelineData;
|
||||
enum class InlinePipeline;
|
||||
class Pipeline;
|
||||
|
||||
class VertexAttributeBinding;
|
||||
using VAB=VertexAttributeBinding;
|
||||
|
||||
class Renderable;
|
||||
class RenderableInstance;
|
||||
|
@ -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:
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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());
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user