mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-22 12:39:52 +00:00
rsx: Use emplace when constructing in-place.
- Unexpectedly high gains for msvc builds. GCC doesn't care, clang shits itself.
This commit is contained in:
parent
1b8a69154f
commit
0bb8127372
@ -138,6 +138,17 @@ namespace rsx
|
|||||||
_data[_size++] = val;
|
_data[_size++] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename... Args>
|
||||||
|
void emplace_back(Args&&... args)
|
||||||
|
{
|
||||||
|
if (_size >= _capacity)
|
||||||
|
{
|
||||||
|
reserve(_capacity + 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::construct_at(&_data[_size++], std::forward<Args&&>(args)...);
|
||||||
|
}
|
||||||
|
|
||||||
Ty pop_back()
|
Ty pop_back()
|
||||||
{
|
{
|
||||||
return _data[--_size];
|
return _data[--_size];
|
||||||
|
@ -275,8 +275,7 @@ namespace vk
|
|||||||
{
|
{
|
||||||
m_push_type_mask |= (1ull << type);
|
m_push_type_mask |= (1ull << type);
|
||||||
m_buffer_view_pool.push_back(buffer_view);
|
m_buffer_view_pool.push_back(buffer_view);
|
||||||
m_pending_writes.push_back(
|
m_pending_writes.emplace_back(
|
||||||
{
|
|
||||||
VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, // sType
|
VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, // sType
|
||||||
nullptr, // pNext
|
nullptr, // pNext
|
||||||
m_handle, // dstSet
|
m_handle, // dstSet
|
||||||
@ -287,15 +286,14 @@ namespace vk
|
|||||||
nullptr, // pImageInfo
|
nullptr, // pImageInfo
|
||||||
nullptr, // pBufferInfo
|
nullptr, // pBufferInfo
|
||||||
&m_buffer_view_pool.back() // pTexelBufferView
|
&m_buffer_view_pool.back() // pTexelBufferView
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void descriptor_set::push(const VkDescriptorBufferInfo& buffer_info, VkDescriptorType type, u32 binding)
|
void descriptor_set::push(const VkDescriptorBufferInfo& buffer_info, VkDescriptorType type, u32 binding)
|
||||||
{
|
{
|
||||||
m_push_type_mask |= (1ull << type);
|
m_push_type_mask |= (1ull << type);
|
||||||
m_buffer_info_pool.push_back(buffer_info);
|
m_buffer_info_pool.push_back(buffer_info);
|
||||||
m_pending_writes.push_back(
|
m_pending_writes.emplace_back(
|
||||||
{
|
|
||||||
VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, // sType
|
VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, // sType
|
||||||
nullptr, // pNext
|
nullptr, // pNext
|
||||||
m_handle, // dstSet
|
m_handle, // dstSet
|
||||||
@ -306,15 +304,14 @@ namespace vk
|
|||||||
nullptr, // pImageInfo
|
nullptr, // pImageInfo
|
||||||
&m_buffer_info_pool.back(), // pBufferInfo
|
&m_buffer_info_pool.back(), // pBufferInfo
|
||||||
nullptr // pTexelBufferView
|
nullptr // pTexelBufferView
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void descriptor_set::push(const VkDescriptorImageInfo& image_info, VkDescriptorType type, u32 binding)
|
void descriptor_set::push(const VkDescriptorImageInfo& image_info, VkDescriptorType type, u32 binding)
|
||||||
{
|
{
|
||||||
m_push_type_mask |= (1ull << type);
|
m_push_type_mask |= (1ull << type);
|
||||||
m_image_info_pool.push_back(image_info);
|
m_image_info_pool.push_back(image_info);
|
||||||
m_pending_writes.push_back(
|
m_pending_writes.emplace_back(
|
||||||
{
|
|
||||||
VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, // sType
|
VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, // sType
|
||||||
nullptr, // pNext
|
nullptr, // pNext
|
||||||
m_handle, // dstSet
|
m_handle, // dstSet
|
||||||
@ -325,7 +322,7 @@ namespace vk
|
|||||||
&m_image_info_pool.back(), // pImageInfo
|
&m_image_info_pool.back(), // pImageInfo
|
||||||
nullptr, // pBufferInfo
|
nullptr, // pBufferInfo
|
||||||
nullptr // pTexelBufferView
|
nullptr // pTexelBufferView
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void descriptor_set::push(const VkDescriptorImageInfo* image_info, u32 count, VkDescriptorType type, u32 binding)
|
void descriptor_set::push(const VkDescriptorImageInfo* image_info, u32 count, VkDescriptorType type, u32 binding)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user