standalone GPUDevice::CreateMP
This commit is contained in:
parent
1a8bd0a607
commit
de2926a6d5
@ -209,8 +209,6 @@ public: //
|
||||
|
||||
public: //shader & material
|
||||
|
||||
MaterialParameters *CreateMP(const MaterialDescriptorManager *,const PipelineLayoutData *,const DescriptorSetType &);
|
||||
|
||||
ShaderModule *CreateShaderModule(VkShaderStageFlagBits,const uint32_t *,const size_t);
|
||||
|
||||
Material *CreateMaterial(const UTF8String &mtl_name,ShaderModuleMap *shader_maps,MaterialDescriptorManager *,VertexInput *);
|
||||
|
@ -18,12 +18,6 @@ protected:
|
||||
|
||||
DescriptorSet *descriptor_set;
|
||||
|
||||
private:
|
||||
|
||||
friend class GPUDevice;
|
||||
|
||||
MaterialParameters(const MaterialDescriptorManager *,const DescriptorSetType &type,DescriptorSet *);
|
||||
|
||||
public:
|
||||
|
||||
const DescriptorSetType GetType (){return set_type;}
|
||||
@ -47,6 +41,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
MaterialParameters(const MaterialDescriptorManager *,const DescriptorSetType &type,DescriptorSet *);
|
||||
virtual ~MaterialParameters();
|
||||
|
||||
bool BindUBO(const int &index,DeviceBuffer *ubo,bool dynamic=false);
|
||||
|
@ -55,26 +55,26 @@ namespace
|
||||
++itp;
|
||||
}
|
||||
}
|
||||
|
||||
MaterialParameters *CreateMP(VkDevice device,VkDescriptorPool desc_pool,const MaterialDescriptorManager *desc_manager,const PipelineLayoutData *pld,const DescriptorSetType &desc_set_type)
|
||||
{
|
||||
if(!desc_manager||!pld)return(nullptr);
|
||||
RANGE_CHECK_RETURN_NULLPTR(desc_set_type)
|
||||
|
||||
DescriptorSet *ds=CreateDS(device,desc_pool,pld,desc_set_type);
|
||||
|
||||
if(!ds)return(nullptr);
|
||||
|
||||
#ifdef _DEBUG
|
||||
const UTF8String addr_string=HexToString<char,uint64_t>((uint64_t)(ds->GetDescriptorSet()));
|
||||
|
||||
LOG_INFO(U8_TEXT("Create [DescriptSets:")+addr_string+("] OK! Material Name: \"")+desc_manager->GetMaterialName()+U8_TEXT("\" Type: ")+GetDescriptorSetTypeName(desc_set_type));
|
||||
#endif//_DEBUG
|
||||
|
||||
return(new MaterialParameters(desc_manager,desc_set_type,ds));
|
||||
}
|
||||
}//namespace
|
||||
|
||||
MaterialParameters *GPUDevice::CreateMP(const MaterialDescriptorManager *desc_manager,const PipelineLayoutData *pld,const DescriptorSetType &desc_set_type)
|
||||
{
|
||||
if(!desc_manager||!pld)return(nullptr);
|
||||
RANGE_CHECK_RETURN_NULLPTR(desc_set_type)
|
||||
|
||||
DescriptorSet *ds=CreateDS(attr->device,attr->desc_pool,pld,desc_set_type);
|
||||
|
||||
if(!ds)return(nullptr);
|
||||
|
||||
#ifdef _DEBUG
|
||||
const UTF8String addr_string=HexToString<char,uint64_t>((uint64_t)(ds->GetDescriptorSet()));
|
||||
|
||||
LOG_INFO(U8_TEXT("Create [DescriptSets:")+addr_string+("] OK! Material Name: \"")+desc_manager->GetMaterialName()+U8_TEXT("\" Type: ")+GetDescriptorSetTypeName(desc_set_type));
|
||||
#endif//_DEBUG
|
||||
|
||||
return(new MaterialParameters(desc_manager,desc_set_type,ds));
|
||||
}
|
||||
|
||||
Material *GPUDevice::CreateMaterial(const UTF8String &mtl_name,ShaderModuleMap *shader_maps,MaterialDescriptorManager *desc_manager,VertexInput *vi)
|
||||
{
|
||||
const int shader_count=shader_maps->GetCount();
|
||||
@ -107,7 +107,7 @@ Material *GPUDevice::CreateMaterial(const UTF8String &mtl_name,ShaderModuleMap *
|
||||
ENUM_CLASS_FOR(DescriptorSetType,int,dst)
|
||||
{
|
||||
if(desc_manager->hasSet((DescriptorSetType)dst))
|
||||
data->mp_array[dst]=CreateMP(desc_manager,pld,(DescriptorSetType)dst);
|
||||
data->mp_array[dst]=CreateMP(attr->device,attr->desc_pool,desc_manager,pld,(DescriptorSetType)dst);
|
||||
else
|
||||
data->mp_array[dst]=nullptr;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user