diff --git a/rpcs3/Emu/RSX/Common/ShaderParam.h b/rpcs3/Emu/RSX/Common/ShaderParam.h index f8f9d5bc55..19f4794fcd 100644 --- a/rpcs3/Emu/RSX/Common/ShaderParam.h +++ b/rpcs3/Emu/RSX/Common/ShaderParam.h @@ -206,7 +206,7 @@ public: if (var_blocks.size() == 1) { - swizzles.push_back("xyzw"); + swizzles.emplace_back("xyzw"); } else { diff --git a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp index 3ac82a7e36..caacebf587 100644 --- a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp @@ -80,12 +80,12 @@ void GLFragmentDecompilerThread::insertInputs(std::stringstream & OS) { if (m_prog.front_color_diffuse_output && m_prog.back_color_diffuse_output) { - inputs_to_declare.push_back("front_diff_color"); + inputs_to_declare.emplace_back("front_diff_color"); } if (m_prog.front_color_specular_output && m_prog.back_color_specular_output) { - inputs_to_declare.push_back("front_spec_color"); + inputs_to_declare.emplace_back("front_spec_color"); } } diff --git a/rpcs3/Emu/RSX/GL/GLTextureCache.h b/rpcs3/Emu/RSX/GL/GLTextureCache.h index 100eb5a296..0d75ca0187 100644 --- a/rpcs3/Emu/RSX/GL/GLTextureCache.h +++ b/rpcs3/Emu/RSX/GL/GLTextureCache.h @@ -579,7 +579,7 @@ namespace gl auto view = std::make_unique(dst.get(), dst_type, sized_internal_fmt, swizzle.data()); auto result = view.get(); - m_temporary_surfaces.push_back({ dst, view }); + m_temporary_surfaces.emplace_back(dst, view); return result; } @@ -748,7 +748,7 @@ namespace gl } auto result = view.get(); - m_temporary_surfaces.push_back({ dst_image, view }); + m_temporary_surfaces.emplace_back(dst_image, view); return result; } @@ -770,7 +770,7 @@ namespace gl } auto result = view.get(); - m_temporary_surfaces.push_back({ dst_image, view }); + m_temporary_surfaces.emplace_back(dst_image, view); return result; } diff --git a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp index a61436cf0f..8510672b23 100644 --- a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp @@ -142,10 +142,10 @@ void GLVertexDecompilerThread::insertOutputs(std::stringstream & OS, const std:: } if (insert_back_diffuse && insert_front_diffuse) - outputs_to_declare.push_back("front_diff_color"); + outputs_to_declare.emplace_back("front_diff_color"); if (insert_back_specular && insert_front_specular) - outputs_to_declare.push_back("front_spec_color"); + outputs_to_declare.emplace_back("front_spec_color"); for (auto &name: outputs_to_declare) { diff --git a/rpcs3/Emu/RSX/Overlays/overlay_controls.h b/rpcs3/Emu/RSX/Overlays/overlay_controls.h index f8242da2fe..6becda8e1a 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_controls.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_controls.h @@ -242,20 +242,20 @@ namespace rsx resource_config() { - texture_resource_files.push_back("fade_top.png"); - texture_resource_files.push_back("fade_bottom.png"); - texture_resource_files.push_back("select.png"); - texture_resource_files.push_back("start.png"); - texture_resource_files.push_back("cross.png"); - texture_resource_files.push_back("circle.png"); - texture_resource_files.push_back("triangle.png"); - texture_resource_files.push_back("square.png"); - texture_resource_files.push_back("L1.png"); - texture_resource_files.push_back("R1.png"); - texture_resource_files.push_back("L2.png"); - texture_resource_files.push_back("R2.png"); - texture_resource_files.push_back("save.png"); - texture_resource_files.push_back("new.png"); + texture_resource_files.emplace_back("fade_top.png"); + texture_resource_files.emplace_back("fade_bottom.png"); + texture_resource_files.emplace_back("select.png"); + texture_resource_files.emplace_back("start.png"); + texture_resource_files.emplace_back("cross.png"); + texture_resource_files.emplace_back("circle.png"); + texture_resource_files.emplace_back("triangle.png"); + texture_resource_files.emplace_back("square.png"); + texture_resource_files.emplace_back("L1.png"); + texture_resource_files.emplace_back("R1.png"); + texture_resource_files.emplace_back("L2.png"); + texture_resource_files.emplace_back("R2.png"); + texture_resource_files.emplace_back("save.png"); + texture_resource_files.emplace_back("new.png"); } void load_files() @@ -633,7 +633,7 @@ namespace rsx case '\r': continue; case '\n': - lines.push_back({ line_begin, ctr }); + lines.emplace_back(line_begin, ctr); line_begin = ctr; continue; default: @@ -641,7 +641,7 @@ namespace rsx } } - lines.push_back({ line_begin, ctr }); + lines.emplace_back(line_begin, ctr); const auto max_region_w = std::max(text_extents_w, w); for (auto p : lines) diff --git a/rpcs3/Emu/RSX/Overlays/overlay_font.cpp b/rpcs3/Emu/RSX/Overlays/overlay_font.cpp index c9b8d082a8..b4474b0830 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_font.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_font.cpp @@ -19,14 +19,14 @@ namespace rsx if (home == nullptr) home = getpwuid(getuid())->pw_dir; - font_dirs.push_back(home); + font_dirs.emplace_back(home); if (home[font_dirs[0].length() - 1] == '/') font_dirs[0] += ".fonts/"; else font_dirs[0] += "/.fonts/"; - fallback_fonts.push_back("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"); // ubuntu - fallback_fonts.push_back("/usr/share/fonts/TTF/DejaVuSans.ttf"); // arch + fallback_fonts.emplace_back("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"); // ubuntu + fallback_fonts.emplace_back("/usr/share/fonts/TTF/DejaVuSans.ttf"); // arch #endif // Search dev_flash for the font too font_dirs.push_back(g_cfg.vfs.get_dev_flash() + "data/font/"); @@ -256,10 +256,10 @@ namespace rsx } } - result.push_back({quad.x0, quad.y0, quad.s0, quad.t0}); - result.push_back({quad.x1, quad.y0, quad.s1, quad.t0}); - result.push_back({quad.x0, quad.y1, quad.s0, quad.t1}); - result.push_back({quad.x1, quad.y1, quad.s1, quad.t1}); + result.emplace_back(quad.x0, quad.y0, quad.s0, quad.t0); + result.emplace_back(quad.x1, quad.y0, quad.s1, quad.t0); + result.emplace_back(quad.x0, quad.y1, quad.s0, quad.t1); + result.emplace_back(quad.x1, quad.y1, quad.s1, quad.t1); break; } } // switch diff --git a/rpcs3/Emu/RSX/RSXFIFO.cpp b/rpcs3/Emu/RSX/RSXFIFO.cpp index a357432ca6..94db3c369c 100644 --- a/rpcs3/Emu/RSX/RSXFIFO.cpp +++ b/rpcs3/Emu/RSX/RSXFIFO.cpp @@ -488,7 +488,7 @@ namespace rsx const u32 reg = (command.reg & 0xfffc) >> 2; const u32 value = command.value; - frame_debug.command_queue.push_back(std::make_pair(reg, value)); + frame_debug.command_queue.emplace_back(reg, value); if (!(reg == NV406E_SET_REFERENCE || reg == NV406E_SEMAPHORE_RELEASE || reg == NV406E_SEMAPHORE_ACQUIRE)) { diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 540f204ec4..1dd5acd6e1 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -823,7 +823,7 @@ namespace rsx if (state.vertex_arrays_info[index].size() > 0) { const rsx::data_array_format_info& info = state.vertex_arrays_info[index]; - result.push_back(vertex_array_buffer{info.type(), info.size(), info.stride(), + result.emplace_back(vertex_array_buffer{info.type(), info.size(), info.stride(), get_raw_vertex_buffer(info, state.vertex_data_base_offset(), state.current_draw_clause), index, true}); continue; } @@ -834,18 +834,18 @@ namespace rsx const u8 element_size = info.size * sizeof(u32); gsl::span vertex_src = { (const gsl::byte*)vertex_push_buffers[index].data.data(), vertex_push_buffers[index].vertex_count * element_size }; - result.push_back(vertex_array_buffer{ info.type, info.size, element_size, vertex_src, index, false }); + result.emplace_back(vertex_array_buffer{ info.type, info.size, element_size, vertex_src, index, false }); continue; } if (state.register_vertex_info[index].size > 0) { const rsx::register_vertex_data_info& info = state.register_vertex_info[index]; - result.push_back(vertex_array_register{info.type, info.size, info.data, index}); + result.emplace_back(vertex_array_register{info.type, info.size, info.data, index}); continue; } - result.push_back(empty_vertex_array{index}); + result.emplace_back(empty_vertex_array{index}); } return result; diff --git a/rpcs3/Emu/RSX/VK/VKTextureCache.h b/rpcs3/Emu/RSX/VK/VKTextureCache.h index 2a397eab11..3e1c70750a 100644 --- a/rpcs3/Emu/RSX/VK/VKTextureCache.h +++ b/rpcs3/Emu/RSX/VK/VKTextureCache.h @@ -432,7 +432,7 @@ namespace vk if (tex.is_managed()) { m_discarded_memory_size += tex.get_section_size(); - m_discardable_storage.push_back(tex); + m_discardable_storage.emplace_back(tex); } } @@ -735,7 +735,7 @@ namespace vk } const u32 resource_memory = w * h * 4; //Rough approximate - m_discardable_storage.push_back({ image, view }); + m_discardable_storage.emplace_back(image, view); m_discardable_storage.back().block_size = resource_memory; m_discarded_memory_size += resource_memory; @@ -792,7 +792,7 @@ namespace vk vk::change_image_layout(cmd, image.get(), VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, dst_range); const u32 resource_memory = size * size * 6 * 4; //Rough approximate - m_discardable_storage.push_back({ image, view }); + m_discardable_storage.emplace_back(image, view); m_discardable_storage.back().block_size = resource_memory; m_discarded_memory_size += resource_memory; @@ -836,7 +836,7 @@ namespace vk vk::change_image_layout(cmd, image.get(), VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, dst_range); const u32 resource_memory = width * height * depth * 4; //Rough approximate - m_discardable_storage.push_back({ image, view }); + m_discardable_storage.emplace_back(image, view); m_discardable_storage.back().block_size = resource_memory; m_discarded_memory_size += resource_memory; @@ -1240,7 +1240,7 @@ namespace vk auto result = image.get(); const u32 resource_memory = width * height * 4; //Rough approximate - m_discardable_storage.push_back(image); + m_discardable_storage.emplace_back(image); m_discardable_storage.back().block_size = resource_memory; m_discarded_memory_size += resource_memory;