File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
backends/vulkan/runtime/vk_api Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,7 @@ DescriptorSet& DescriptorSet::bind(
154154
155155VkDescriptorSet DescriptorSet::get_bind_handle () const {
156156 std::vector<VkWriteDescriptorSet> write_descriptor_sets;
157+ write_descriptor_sets.reserve (bindings_.size ());
157158
158159 for (const ResourceBinding& binding : bindings_) {
159160 VkWriteDescriptorSet write{
@@ -185,9 +186,7 @@ VkDescriptorSet DescriptorSet::get_bind_handle() const {
185186 0u ,
186187 nullptr );
187188
188- VkDescriptorSet ret = handle_;
189-
190- return ret;
189+ return handle_;
191190}
192191
193192void DescriptorSet::add_binding (const ResourceBinding& binding) {
Original file line number Diff line number Diff line change @@ -59,10 +59,11 @@ ShaderLayout::ShaderLayout(
5959 const ShaderLayout::Signature& signature)
6060 : device_(device), handle_{VK_NULL_HANDLE} {
6161 std::vector<VkDescriptorSetLayoutBinding> bindings;
62+ bindings.reserve (signature.size ());
6263
6364 uint32_t binding_num = 0u ;
6465 for (const VkDescriptorType type : signature) {
65- bindings.push_back ( {
66+ bindings.emplace_back (VkDescriptorSetLayoutBinding {
6667 binding_num++, // binding
6768 type, // descriptorType
6869 1u , // descriptorCount
You can’t perform that action at this time.
0 commit comments