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(
154
154
155
155
VkDescriptorSet DescriptorSet::get_bind_handle () const {
156
156
std::vector<VkWriteDescriptorSet> write_descriptor_sets;
157
+ write_descriptor_sets.reserve (bindings_.size ());
157
158
158
159
for (const ResourceBinding& binding : bindings_) {
159
160
VkWriteDescriptorSet write{
@@ -185,9 +186,7 @@ VkDescriptorSet DescriptorSet::get_bind_handle() const {
185
186
0u ,
186
187
nullptr );
187
188
188
- VkDescriptorSet ret = handle_;
189
-
190
- return ret;
189
+ return handle_;
191
190
}
192
191
193
192
void DescriptorSet::add_binding (const ResourceBinding& binding) {
Original file line number Diff line number Diff line change @@ -59,10 +59,11 @@ ShaderLayout::ShaderLayout(
59
59
const ShaderLayout::Signature& signature)
60
60
: device_(device), handle_{VK_NULL_HANDLE} {
61
61
std::vector<VkDescriptorSetLayoutBinding> bindings;
62
+ bindings.reserve (signature.size ());
62
63
63
64
uint32_t binding_num = 0u ;
64
65
for (const VkDescriptorType type : signature) {
65
- bindings.push_back ( {
66
+ bindings.emplace_back (VkDescriptorSetLayoutBinding {
66
67
binding_num++, // binding
67
68
type, // descriptorType
68
69
1u , // descriptorCount
You can’t perform that action at this time.
0 commit comments