简写变量名称
This commit is contained in:
parent
cba14ff413
commit
154ddd8c27
@ -17,7 +17,7 @@ class DescriptorSets
|
|||||||
VkPipelineLayout pipeline_layout;
|
VkPipelineLayout pipeline_layout;
|
||||||
|
|
||||||
ObjectList<VkDescriptorImageInfo> desc_image_info;
|
ObjectList<VkDescriptorImageInfo> desc_image_info;
|
||||||
List<VkWriteDescriptorSet> write_desc_sets;
|
List<VkWriteDescriptorSet> wds_list;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
void DescriptorSets::Clear()
|
void DescriptorSets::Clear()
|
||||||
{
|
{
|
||||||
write_desc_sets.ClearData();
|
wds_list.ClearData();
|
||||||
desc_image_info.ClearData();
|
desc_image_info.ClearData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16,20 +16,20 @@ bool DescriptorSets::BindUBO(const int binding,const Buffer *buf)
|
|||||||
if(binding<0||!buf)
|
if(binding<0||!buf)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
VkWriteDescriptorSet writeDescriptorSet;
|
VkWriteDescriptorSet wds;
|
||||||
|
|
||||||
writeDescriptorSet.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
wds.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
||||||
writeDescriptorSet.pNext = nullptr;
|
wds.pNext = nullptr;
|
||||||
writeDescriptorSet.dstSet = desc_set;
|
wds.dstSet = desc_set;
|
||||||
writeDescriptorSet.dstBinding = binding;
|
wds.dstBinding = binding;
|
||||||
writeDescriptorSet.dstArrayElement = 0;
|
wds.dstArrayElement = 0;
|
||||||
writeDescriptorSet.descriptorCount = 1;
|
wds.descriptorCount = 1;
|
||||||
writeDescriptorSet.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
|
wds.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
|
||||||
writeDescriptorSet.pImageInfo = nullptr;
|
wds.pImageInfo = nullptr;
|
||||||
writeDescriptorSet.pBufferInfo = buf->GetBufferInfo();
|
wds.pBufferInfo = buf->GetBufferInfo();
|
||||||
writeDescriptorSet.pTexelBufferView = nullptr;
|
wds.pTexelBufferView = nullptr;
|
||||||
|
|
||||||
write_desc_sets.Add(writeDescriptorSet);
|
wds_list.Add(wds);
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,20 +38,20 @@ bool DescriptorSets::BindUBODynamic(const int binding,const Buffer *buf)
|
|||||||
if(binding<0||!buf)
|
if(binding<0||!buf)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
VkWriteDescriptorSet writeDescriptorSet;
|
VkWriteDescriptorSet wds;
|
||||||
|
|
||||||
writeDescriptorSet.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
wds.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
||||||
writeDescriptorSet.pNext = nullptr;
|
wds.pNext = nullptr;
|
||||||
writeDescriptorSet.dstSet = desc_set;
|
wds.dstSet = desc_set;
|
||||||
writeDescriptorSet.dstBinding = binding;
|
wds.dstBinding = binding;
|
||||||
writeDescriptorSet.dstArrayElement = 0;
|
wds.dstArrayElement = 0;
|
||||||
writeDescriptorSet.descriptorCount = 1;
|
wds.descriptorCount = 1;
|
||||||
writeDescriptorSet.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC;
|
wds.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC;
|
||||||
writeDescriptorSet.pImageInfo = nullptr;
|
wds.pImageInfo = nullptr;
|
||||||
writeDescriptorSet.pBufferInfo = buf->GetBufferInfo();
|
wds.pBufferInfo = buf->GetBufferInfo();
|
||||||
writeDescriptorSet.pTexelBufferView = nullptr;
|
wds.pTexelBufferView = nullptr;
|
||||||
|
|
||||||
write_desc_sets.Add(writeDescriptorSet);
|
wds_list.Add(wds);
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,25 +68,25 @@ bool DescriptorSets::BindSampler(const int binding,Texture *tex,Sampler *sampler
|
|||||||
|
|
||||||
desc_image_info.Add(image_info);
|
desc_image_info.Add(image_info);
|
||||||
|
|
||||||
VkWriteDescriptorSet writeDescriptorSet;
|
VkWriteDescriptorSet wds;
|
||||||
|
|
||||||
writeDescriptorSet.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
wds.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
||||||
writeDescriptorSet.pNext = nullptr;
|
wds.pNext = nullptr;
|
||||||
writeDescriptorSet.dstSet = desc_set;
|
wds.dstSet = desc_set;
|
||||||
writeDescriptorSet.dstBinding = binding;
|
wds.dstBinding = binding;
|
||||||
writeDescriptorSet.dstArrayElement = 0;
|
wds.dstArrayElement = 0;
|
||||||
writeDescriptorSet.descriptorCount = 1;
|
wds.descriptorCount = 1;
|
||||||
writeDescriptorSet.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
|
wds.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
|
||||||
writeDescriptorSet.pImageInfo = image_info;
|
wds.pImageInfo = image_info;
|
||||||
writeDescriptorSet.pBufferInfo = nullptr;
|
wds.pBufferInfo = nullptr;
|
||||||
writeDescriptorSet.pTexelBufferView = nullptr;
|
wds.pTexelBufferView = nullptr;
|
||||||
|
|
||||||
write_desc_sets.Add(writeDescriptorSet);
|
wds_list.Add(wds);
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DescriptorSets::Update()
|
void DescriptorSets::Update()
|
||||||
{
|
{
|
||||||
vkUpdateDescriptorSets(*device,write_desc_sets.GetCount(),write_desc_sets.GetData(),0,nullptr);
|
vkUpdateDescriptorSets(*device,wds_list.GetCount(),wds_list.GetData(),0,nullptr);
|
||||||
}
|
}
|
||||||
VK_NAMESPACE_END
|
VK_NAMESPACE_END
|
||||||
|
Loading…
x
Reference in New Issue
Block a user