optimized name of values.

This commit is contained in:
2023-02-23 13:25:05 +08:00
parent e31a6cca13
commit a6b71a449e
18 changed files with 39 additions and 39 deletions

View File

@@ -148,7 +148,7 @@ bool DescriptorSet::BindSSBO(const int binding,const DeviceBuffer *buf,const VkD
return(true);
}
bool DescriptorSet::BindSampler(const int binding,Texture *tex,Sampler *sampler)
bool DescriptorSet::BindImageSampler(const int binding,Texture *tex,Sampler *sampler)
{
if(binding<0||!tex||!sampler)
return(false);

View File

@@ -34,14 +34,14 @@ MaterialDescriptorSets::MaterialDescriptorSets(const UTF8String &name,ShaderDesc
{
if(sp->desc_type>=VK_DESCRIPTOR_TYPE_BEGIN_RANGE
&&sp->desc_type<=VK_DESCRIPTOR_TYPE_END_RANGE)
descriptor_list[(size_t)sp->desc_type].Add(sp);
sd_list_by_desc_type[(size_t)sp->desc_type].Add(sp);
sd_by_name.Add(sp->name,sp);
// sd_by_name.Add(sp->name,sp);
binding_map[size_t(sp->desc_type)].Add(sp->name,sp->binding);
++dsl_ci[size_t(sp->set_type)].bindingCount;
descriptor_list_by_set_type[size_t(sp->set_type)].Add(sp);
sd_list_by_set_type[size_t(sp->set_type)].Add(sp);
++sp;
}
@@ -59,7 +59,7 @@ MaterialDescriptorSets::MaterialDescriptorSets(const UTF8String &name,ShaderDesc
}
{
ShaderDescriptorList *sdl=descriptor_list;
ShaderDescriptorList *sdl=sd_list_by_desc_type;
ShaderDescriptor **sdp;
for(uint i=VK_DESCRIPTOR_TYPE_BEGIN_RANGE;

View File

@@ -52,14 +52,14 @@ bool MaterialInstance::BindSSBO(const DescriptorSetType &type,const AnsiString &
return(true);
}
bool MaterialInstance::BindSampler(const DescriptorSetType &type,const AnsiString &name,Texture *tex,Sampler *sampler)
bool MaterialInstance::BindImageSampler(const DescriptorSetType &type,const AnsiString &name,Texture *tex,Sampler *sampler)
{
MaterialParameters *mp=GetMP(type);
if(!mp)
return(false);
if(!mp->BindSampler(name,tex,sampler))return(false);
if(!mp->BindImageSampler(name,tex,sampler))return(false);
mp->Update();
return(true);

View File

@@ -48,17 +48,17 @@ bool MaterialParameters::BindSSBO(const AnsiString &name,DeviceBuffer *ssbo,bool
return(true);
}
bool MaterialParameters::BindSampler(const AnsiString &name,Texture *tex,Sampler *sampler)
bool MaterialParameters::BindImageSampler(const AnsiString &name,Texture *tex,Sampler *sampler)
{
if(name.IsEmpty()||!tex||!sampler)
return(false);
const int index=mds->GetSampler(name);
const int index=mds->GetImageSampler(name);
if(index<0)
return(false);
if(!descriptor_set->BindSampler(index,tex,sampler))
if(!descriptor_set->BindImageSampler(index,tex,sampler))
return(false);
return(true);
@@ -69,7 +69,7 @@ bool MaterialParameters::BindInputAttachment(const AnsiString &name,ImageView *i
if(name.IsEmpty()||!iv)
return(false);
const int index=mds->GetAttachment(name);
const int index=mds->GetInputAttachment(name);
if(index<0)
return(false);

View File

@@ -167,7 +167,7 @@ Material *RenderResource::CreateMaterial(const OSString &filename)
if(count>0)
{
ShaderDescriptor *sd_list=hgl_zero_new<ShaderDescriptor>(count);
ShaderDescriptor *sd_list=new ShaderDescriptor[count];
LoadShaderDescriptor(sp,sd_list,count,ver);