mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-08-31 08:49:07 +01:00
Merge pull request #9450 from ameerj/hle-ipc-vector-reserve
hle_ipc: Reserve vectors before populating
This commit is contained in:
commit
789da737af
1 changed files with 8 additions and 0 deletions
|
@ -167,6 +167,9 @@ void HLERequestContext::ParseCommandBuffer(const KHandleTable& handle_table, u32
|
||||||
}
|
}
|
||||||
if (incoming) {
|
if (incoming) {
|
||||||
// Populate the object lists with the data in the IPC request.
|
// Populate the object lists with the data in the IPC request.
|
||||||
|
incoming_copy_handles.reserve(handle_descriptor_header->num_handles_to_copy);
|
||||||
|
incoming_move_handles.reserve(handle_descriptor_header->num_handles_to_move);
|
||||||
|
|
||||||
for (u32 handle = 0; handle < handle_descriptor_header->num_handles_to_copy; ++handle) {
|
for (u32 handle = 0; handle < handle_descriptor_header->num_handles_to_copy; ++handle) {
|
||||||
incoming_copy_handles.push_back(rp.Pop<Handle>());
|
incoming_copy_handles.push_back(rp.Pop<Handle>());
|
||||||
}
|
}
|
||||||
|
@ -181,6 +184,11 @@ void HLERequestContext::ParseCommandBuffer(const KHandleTable& handle_table, u32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buffer_x_desciptors.reserve(command_header->num_buf_x_descriptors);
|
||||||
|
buffer_a_desciptors.reserve(command_header->num_buf_a_descriptors);
|
||||||
|
buffer_b_desciptors.reserve(command_header->num_buf_b_descriptors);
|
||||||
|
buffer_w_desciptors.reserve(command_header->num_buf_w_descriptors);
|
||||||
|
|
||||||
for (u32 i = 0; i < command_header->num_buf_x_descriptors; ++i) {
|
for (u32 i = 0; i < command_header->num_buf_x_descriptors; ++i) {
|
||||||
buffer_x_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorX>());
|
buffer_x_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorX>());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue