use Contains instead of IsMember/IsExist
This commit is contained in:
parent
d7f7a7d095
commit
9450d92784
@ -1 +1 @@
|
|||||||
Subproject commit 4b880eb50f5ef7436e72b8a0a03d528da3fd76a3
|
Subproject commit 85436b5a7b0bc9347fcd3321a6895464470f1353
|
@ -1 +1 @@
|
|||||||
Subproject commit 17e263bf440f0b8b6834b454a4952d2f2a38ce3c
|
Subproject commit 737fe5c80d013f807cbb8f4d333d5a59c82571bc
|
2
CMCore
2
CMCore
@ -1 +1 @@
|
|||||||
Subproject commit 0a0f885c75bc9342bb46d639a2174f8d8a44cf4c
|
Subproject commit 2ebd4b4ac93ad89cb5f74af0b01d06d30752b1aa
|
@ -1 +1 @@
|
|||||||
Subproject commit ae170b717e5960034a2a0e83ba4c00a05023491d
|
Subproject commit f9e2389303d54229946e88cd514d1c38b07bb28b
|
2
CMUtil
2
CMUtil
@ -1 +1 @@
|
|||||||
Subproject commit 1e121c1b3ebfbc46ce310335e2fb3b4c8ecdf8e0
|
Subproject commit f7dce0304822280d0db23ae607783b7c3cd183fa
|
@ -464,7 +464,7 @@ namespace hgl
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsMember(const char *name)const
|
bool Contains(const char *name)const
|
||||||
{
|
{
|
||||||
if(count<=0)
|
if(count<=0)
|
||||||
return(false);
|
return(false);
|
||||||
@ -478,7 +478,7 @@ namespace hgl
|
|||||||
|
|
||||||
bool Add(ShaderVariable &sv)
|
bool Add(ShaderVariable &sv)
|
||||||
{
|
{
|
||||||
if(IsMember(sv.name))
|
if(Contains(sv.name))
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
sv.location=count;
|
sv.location=count;
|
||||||
|
@ -41,7 +41,7 @@ public:
|
|||||||
|
|
||||||
bool hasStruct(const AnsiString &name) const
|
bool hasStruct(const AnsiString &name) const
|
||||||
{
|
{
|
||||||
return(struct_map.KeyExist(name));
|
return(struct_map.ContainsKey(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
const UBODescriptor *AddUBO(uint32_t shader_stage_flag_bits,DescriptorSetType set_type,UBODescriptor *sd);
|
const UBODescriptor *AddUBO(uint32_t shader_stage_flag_bits,DescriptorSetType set_type,UBODescriptor *sd);
|
||||||
|
@ -15,7 +15,7 @@ public:
|
|||||||
|
|
||||||
VkShaderStageFlagBits flag=sc->GetShaderStage();
|
VkShaderStageFlagBits flag=sc->GetShaderStage();
|
||||||
|
|
||||||
if(KeyExist(flag))
|
if(ContainsKey(flag))
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
ObjectMap<VkShaderStageFlagBits,ShaderCreateInfo>::Add(flag,sc);
|
ObjectMap<VkShaderStageFlagBits,ShaderCreateInfo>::Add(flag,sc);
|
||||||
|
@ -74,7 +74,7 @@ public:
|
|||||||
bool AddInput(I &item){return input.Add(item);}
|
bool AddInput(I &item){return input.Add(item);}
|
||||||
bool AddOutput(O &item){return output.Add(item);}
|
bool AddOutput(O &item){return output.Add(item);}
|
||||||
|
|
||||||
bool hasInput(const char *name)const{return input.IsMember(name);} ///<是否有指定输入
|
bool hasInput(const char *name)const{return input.Contains(name);} ///<是否有指定输入
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace hgl
|
|||||||
{
|
{
|
||||||
if(!f)return(false);
|
if(!f)return(false);
|
||||||
|
|
||||||
if(form_list.KeyExist(f))
|
if(form_list.ContainsKey(f))
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
Vector2f size=f->GetSize();
|
Vector2f size=f->GetSize();
|
||||||
|
@ -81,7 +81,7 @@ bool DescriptorSet::BindUBO(const int binding,const DeviceBuffer *buf,bool dynam
|
|||||||
if(binding<0||!buf)
|
if(binding<0||!buf)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
if(binded_sets.IsMember(binding))return(false);
|
if(binded_sets.Contains(binding))return(false);
|
||||||
|
|
||||||
const VkDescriptorType desc_type=dynamic?VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
|
const VkDescriptorType desc_type=dynamic?VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ bool DescriptorSet::BindUBO(const int binding,const DeviceBuffer *buf,const VkDe
|
|||||||
if(binding<0||!buf)
|
if(binding<0||!buf)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
if(binded_sets.IsMember(binding))return(false);
|
if(binded_sets.Contains(binding))return(false);
|
||||||
|
|
||||||
DescriptorBufferInfo *buf_info=new DescriptorBufferInfo(buf,offset,range);
|
DescriptorBufferInfo *buf_info=new DescriptorBufferInfo(buf,offset,range);
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ bool DescriptorSet::BindSSBO(const int binding,const DeviceBuffer *buf,bool dyna
|
|||||||
if(binding<0||!buf)
|
if(binding<0||!buf)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
if(binded_sets.IsMember(binding))return(false);
|
if(binded_sets.Contains(binding))return(false);
|
||||||
|
|
||||||
const VkDescriptorType desc_type=dynamic?VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
|
const VkDescriptorType desc_type=dynamic?VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ bool DescriptorSet::BindSSBO(const int binding,const DeviceBuffer *buf,const VkD
|
|||||||
if(binding<0||!buf)
|
if(binding<0||!buf)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
if(binded_sets.IsMember(binding))return(false);
|
if(binded_sets.Contains(binding))return(false);
|
||||||
|
|
||||||
DescriptorBufferInfo *buf_info=new DescriptorBufferInfo(buf,offset,range);
|
DescriptorBufferInfo *buf_info=new DescriptorBufferInfo(buf,offset,range);
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ bool DescriptorSet::BindImageSampler(const int binding,Texture *tex,Sampler *sam
|
|||||||
if(binding<0||!tex||!sampler)
|
if(binding<0||!tex||!sampler)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
if(binded_sets.IsMember(binding))return(false);
|
if(binded_sets.Contains(binding))return(false);
|
||||||
|
|
||||||
DescriptorImageInfo *image_info=new DescriptorImageInfo(tex,sampler);
|
DescriptorImageInfo *image_info=new DescriptorImageInfo(tex,sampler);
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ bool DescriptorSet::BindInputAttachment(const int binding,ImageView *iv)
|
|||||||
if(binding<0||!iv)
|
if(binding<0||!iv)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
if(binded_sets.IsMember(binding))return(false);
|
if(binded_sets.Contains(binding))return(false);
|
||||||
|
|
||||||
DescriptorImageInfo *image_info=new DescriptorImageInfo(iv->GetImageView());
|
DescriptorImageInfo *image_info=new DescriptorImageInfo(iv->GetImageView());
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ bool ShaderModuleMap::Add(const ShaderModule *sm)
|
|||||||
|
|
||||||
const VkShaderStageFlagBits stage=sm->GetStage();
|
const VkShaderStageFlagBits stage=sm->GetStage();
|
||||||
|
|
||||||
if(this->KeyExist(stage))return(false);
|
if(this->ContainsKey(stage))return(false);
|
||||||
|
|
||||||
return this->Map::Add(stage,sm);
|
return this->Map::Add(stage,sm);
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ bool MaterialCreateInfo::AddStruct(const AnsiString &struct_name,const AnsiStrin
|
|||||||
|
|
||||||
bool MaterialCreateInfo::AddUBO(const VkShaderStageFlagBits flag_bit,const DescriptorSetType set_type,const AnsiString &struct_name,const AnsiString &name)
|
bool MaterialCreateInfo::AddUBO(const VkShaderStageFlagBits flag_bit,const DescriptorSetType set_type,const AnsiString &struct_name,const AnsiString &name)
|
||||||
{
|
{
|
||||||
if(!shader_map.KeyExist(flag_bit))
|
if(!shader_map.ContainsKey(flag_bit))
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
if(!mdi.hasStruct(struct_name))
|
if(!mdi.hasStruct(struct_name))
|
||||||
@ -95,7 +95,7 @@ bool MaterialCreateInfo::AddUBO(const uint32_t flag_bits,const DescriptorSetType
|
|||||||
|
|
||||||
bool MaterialCreateInfo::AddSampler(const VkShaderStageFlagBits flag_bit,const DescriptorSetType set_type,const SamplerType &st,const AnsiString &name)
|
bool MaterialCreateInfo::AddSampler(const VkShaderStageFlagBits flag_bit,const DescriptorSetType set_type,const SamplerType &st,const AnsiString &name)
|
||||||
{
|
{
|
||||||
if(!shader_map.KeyExist(flag_bit))
|
if(!shader_map.ContainsKey(flag_bit))
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
RANGE_CHECK_RETURN_FALSE(st);
|
RANGE_CHECK_RETURN_FALSE(st);
|
||||||
|
@ -21,7 +21,7 @@ MaterialDescriptorInfo::MaterialDescriptorInfo()
|
|||||||
const DescriptorSetType MaterialDescriptorInfo::GetSetType(const AnsiString &name)const
|
const DescriptorSetType MaterialDescriptorInfo::GetSetType(const AnsiString &name)const
|
||||||
{
|
{
|
||||||
for(auto &sds:desc_set_array)
|
for(auto &sds:desc_set_array)
|
||||||
if(sds.descriptor_map.KeyExist(name))
|
if(sds.descriptor_map.ContainsKey(name))
|
||||||
return(sds.set_type);
|
return(sds.set_type);
|
||||||
|
|
||||||
return DescriptorSetType::Global;
|
return DescriptorSetType::Global;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user