mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 08:21:29 +12:00
rsx: Apply Clang-Tidy fix "modernize-use-emplace"
This commit is contained in:
parent
a555504142
commit
635695ac78
9 changed files with 41 additions and 41 deletions
|
@ -206,7 +206,7 @@ public:
|
||||||
|
|
||||||
if (var_blocks.size() == 1)
|
if (var_blocks.size() == 1)
|
||||||
{
|
{
|
||||||
swizzles.push_back("xyzw");
|
swizzles.emplace_back("xyzw");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,12 +80,12 @@ void GLFragmentDecompilerThread::insertInputs(std::stringstream & OS)
|
||||||
{
|
{
|
||||||
if (m_prog.front_color_diffuse_output && m_prog.back_color_diffuse_output)
|
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)
|
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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -579,7 +579,7 @@ namespace gl
|
||||||
auto view = std::make_unique<gl::texture_view>(dst.get(), dst_type, sized_internal_fmt, swizzle.data());
|
auto view = std::make_unique<gl::texture_view>(dst.get(), dst_type, sized_internal_fmt, swizzle.data());
|
||||||
auto result = view.get();
|
auto result = view.get();
|
||||||
|
|
||||||
m_temporary_surfaces.push_back({ dst, view });
|
m_temporary_surfaces.emplace_back(dst, view);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -748,7 +748,7 @@ namespace gl
|
||||||
}
|
}
|
||||||
|
|
||||||
auto result = view.get();
|
auto result = view.get();
|
||||||
m_temporary_surfaces.push_back({ dst_image, view });
|
m_temporary_surfaces.emplace_back(dst_image, view);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -770,7 +770,7 @@ namespace gl
|
||||||
}
|
}
|
||||||
|
|
||||||
auto result = view.get();
|
auto result = view.get();
|
||||||
m_temporary_surfaces.push_back({ dst_image, view });
|
m_temporary_surfaces.emplace_back(dst_image, view);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,10 +142,10 @@ void GLVertexDecompilerThread::insertOutputs(std::stringstream & OS, const std::
|
||||||
}
|
}
|
||||||
|
|
||||||
if (insert_back_diffuse && insert_front_diffuse)
|
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)
|
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)
|
for (auto &name: outputs_to_declare)
|
||||||
{
|
{
|
||||||
|
|
|
@ -242,20 +242,20 @@ namespace rsx
|
||||||
|
|
||||||
resource_config()
|
resource_config()
|
||||||
{
|
{
|
||||||
texture_resource_files.push_back("fade_top.png");
|
texture_resource_files.emplace_back("fade_top.png");
|
||||||
texture_resource_files.push_back("fade_bottom.png");
|
texture_resource_files.emplace_back("fade_bottom.png");
|
||||||
texture_resource_files.push_back("select.png");
|
texture_resource_files.emplace_back("select.png");
|
||||||
texture_resource_files.push_back("start.png");
|
texture_resource_files.emplace_back("start.png");
|
||||||
texture_resource_files.push_back("cross.png");
|
texture_resource_files.emplace_back("cross.png");
|
||||||
texture_resource_files.push_back("circle.png");
|
texture_resource_files.emplace_back("circle.png");
|
||||||
texture_resource_files.push_back("triangle.png");
|
texture_resource_files.emplace_back("triangle.png");
|
||||||
texture_resource_files.push_back("square.png");
|
texture_resource_files.emplace_back("square.png");
|
||||||
texture_resource_files.push_back("L1.png");
|
texture_resource_files.emplace_back("L1.png");
|
||||||
texture_resource_files.push_back("R1.png");
|
texture_resource_files.emplace_back("R1.png");
|
||||||
texture_resource_files.push_back("L2.png");
|
texture_resource_files.emplace_back("L2.png");
|
||||||
texture_resource_files.push_back("R2.png");
|
texture_resource_files.emplace_back("R2.png");
|
||||||
texture_resource_files.push_back("save.png");
|
texture_resource_files.emplace_back("save.png");
|
||||||
texture_resource_files.push_back("new.png");
|
texture_resource_files.emplace_back("new.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
void load_files()
|
void load_files()
|
||||||
|
@ -633,7 +633,7 @@ namespace rsx
|
||||||
case '\r':
|
case '\r':
|
||||||
continue;
|
continue;
|
||||||
case '\n':
|
case '\n':
|
||||||
lines.push_back({ line_begin, ctr });
|
lines.emplace_back(line_begin, ctr);
|
||||||
line_begin = ctr;
|
line_begin = ctr;
|
||||||
continue;
|
continue;
|
||||||
default:
|
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<f32>(text_extents_w, w);
|
const auto max_region_w = std::max<f32>(text_extents_w, w);
|
||||||
|
|
||||||
for (auto p : lines)
|
for (auto p : lines)
|
||||||
|
|
|
@ -19,14 +19,14 @@ namespace rsx
|
||||||
if (home == nullptr)
|
if (home == nullptr)
|
||||||
home = getpwuid(getuid())->pw_dir;
|
home = getpwuid(getuid())->pw_dir;
|
||||||
|
|
||||||
font_dirs.push_back(home);
|
font_dirs.emplace_back(home);
|
||||||
if (home[font_dirs[0].length() - 1] == '/')
|
if (home[font_dirs[0].length() - 1] == '/')
|
||||||
font_dirs[0] += ".fonts/";
|
font_dirs[0] += ".fonts/";
|
||||||
else
|
else
|
||||||
font_dirs[0] += "/.fonts/";
|
font_dirs[0] += "/.fonts/";
|
||||||
|
|
||||||
fallback_fonts.push_back("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"); // ubuntu
|
fallback_fonts.emplace_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/TTF/DejaVuSans.ttf"); // arch
|
||||||
#endif
|
#endif
|
||||||
// Search dev_flash for the font too
|
// Search dev_flash for the font too
|
||||||
font_dirs.push_back(g_cfg.vfs.get_dev_flash() + "data/font/");
|
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.emplace_back(quad.x0, quad.y0, quad.s0, quad.t0);
|
||||||
result.push_back({quad.x1, quad.y0, quad.s1, quad.t0});
|
result.emplace_back(quad.x1, quad.y0, quad.s1, quad.t0);
|
||||||
result.push_back({quad.x0, quad.y1, quad.s0, quad.t1});
|
result.emplace_back(quad.x0, quad.y1, quad.s0, quad.t1);
|
||||||
result.push_back({quad.x1, quad.y1, quad.s1, quad.t1});
|
result.emplace_back(quad.x1, quad.y1, quad.s1, quad.t1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} // switch
|
} // switch
|
||||||
|
|
|
@ -488,7 +488,7 @@ namespace rsx
|
||||||
const u32 reg = (command.reg & 0xfffc) >> 2;
|
const u32 reg = (command.reg & 0xfffc) >> 2;
|
||||||
const u32 value = command.value;
|
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))
|
if (!(reg == NV406E_SET_REFERENCE || reg == NV406E_SEMAPHORE_RELEASE || reg == NV406E_SEMAPHORE_ACQUIRE))
|
||||||
{
|
{
|
||||||
|
|
|
@ -823,7 +823,7 @@ namespace rsx
|
||||||
if (state.vertex_arrays_info[index].size() > 0)
|
if (state.vertex_arrays_info[index].size() > 0)
|
||||||
{
|
{
|
||||||
const rsx::data_array_format_info& info = state.vertex_arrays_info[index];
|
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});
|
get_raw_vertex_buffer(info, state.vertex_data_base_offset(), state.current_draw_clause), index, true});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -834,18 +834,18 @@ namespace rsx
|
||||||
const u8 element_size = info.size * sizeof(u32);
|
const u8 element_size = info.size * sizeof(u32);
|
||||||
|
|
||||||
gsl::span<const gsl::byte> vertex_src = { (const gsl::byte*)vertex_push_buffers[index].data.data(), vertex_push_buffers[index].vertex_count * element_size };
|
gsl::span<const gsl::byte> 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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.register_vertex_info[index].size > 0)
|
if (state.register_vertex_info[index].size > 0)
|
||||||
{
|
{
|
||||||
const rsx::register_vertex_data_info& info = state.register_vertex_info[index];
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
result.push_back(empty_vertex_array{index});
|
result.emplace_back(empty_vertex_array{index});
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -432,7 +432,7 @@ namespace vk
|
||||||
if (tex.is_managed())
|
if (tex.is_managed())
|
||||||
{
|
{
|
||||||
m_discarded_memory_size += tex.get_section_size();
|
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
|
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_discardable_storage.back().block_size = resource_memory;
|
||||||
m_discarded_memory_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);
|
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
|
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_discardable_storage.back().block_size = resource_memory;
|
||||||
m_discarded_memory_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);
|
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
|
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_discardable_storage.back().block_size = resource_memory;
|
||||||
m_discarded_memory_size += resource_memory;
|
m_discarded_memory_size += resource_memory;
|
||||||
|
|
||||||
|
@ -1240,7 +1240,7 @@ namespace vk
|
||||||
|
|
||||||
auto result = image.get();
|
auto result = image.get();
|
||||||
const u32 resource_memory = width * height * 4; //Rough approximate
|
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_discardable_storage.back().block_size = resource_memory;
|
||||||
m_discarded_memory_size += resource_memory;
|
m_discarded_memory_size += resource_memory;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue