mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-07-09 17:25:18 -06:00
Use more std::move
This commit is contained in:
parent
27b13dff20
commit
5252f47a33
@ -119,18 +119,18 @@ namespace utils
|
||||
|
||||
if (sym->NameLen)
|
||||
{
|
||||
const auto function_name = wstr_to_utf8(sym->Name, static_cast<int>(sym->NameLen));
|
||||
std::string function_name = wstr_to_utf8(sym->Name, static_cast<int>(sym->NameLen));
|
||||
|
||||
// Attempt to get file and line information if available
|
||||
DWORD unused2;
|
||||
if (SymGetLineFromAddrW64(hProcess, reinterpret_cast<DWORD64>(pointer), &unused2, &line_info))
|
||||
{
|
||||
const auto full_path = fmt::format("%s:%u %s", wstr_to_utf8(line_info.FileName, -1), line_info.LineNumber, function_name);
|
||||
result.push_back(full_path);
|
||||
std::string full_path = fmt::format("%s:%u %s", wstr_to_utf8(line_info.FileName, -1), line_info.LineNumber, function_name);
|
||||
result.push_back(std::move(full_path));
|
||||
}
|
||||
else
|
||||
{
|
||||
result.push_back(function_name);
|
||||
result.push_back(std::move(function_name));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -33,7 +33,7 @@ public:
|
||||
std::lock_guard lock(mutex);
|
||||
if (std::shared_ptr<void> new_val = std::invoke(func); new_val)
|
||||
{
|
||||
storage.push_back(new_val);
|
||||
storage.push_back(std::move(new_val));
|
||||
}
|
||||
delete_unused();
|
||||
}
|
||||
|
||||
@ -46,26 +46,26 @@ namespace aarch64
|
||||
{
|
||||
compiled_instruction_t i{};
|
||||
i.asm_ = inst;
|
||||
m_instructions.push_back(i);
|
||||
m_instructions.push_back(std::move(i));
|
||||
}
|
||||
|
||||
void UASM::emit1(const char* inst, const Arg& arg0, const std::vector<gpr>& clobbered)
|
||||
{
|
||||
int arg_id = 0;
|
||||
fmt_replacement_list_t repl = {
|
||||
const fmt_replacement_list_t repl = {
|
||||
{ "{0}", arg0.to_string(&arg_id) }
|
||||
};
|
||||
|
||||
compiled_instruction_t i{};
|
||||
i.asm_ = fmt::replace_all(inst, repl);
|
||||
embed_args(i, { arg0 }, clobbered);
|
||||
m_instructions.push_back(i);
|
||||
m_instructions.push_back(std::move(i));
|
||||
}
|
||||
|
||||
void UASM::emit2(const char* inst, const Arg& arg0, const Arg& arg1, const std::vector<gpr>& clobbered)
|
||||
{
|
||||
int arg_id = 0;
|
||||
fmt_replacement_list_t repl = {
|
||||
const fmt_replacement_list_t repl = {
|
||||
{ "{0}", arg0.to_string(&arg_id) },
|
||||
{ "{1}", arg1.to_string(&arg_id) },
|
||||
};
|
||||
@ -73,13 +73,13 @@ namespace aarch64
|
||||
compiled_instruction_t i{};
|
||||
i.asm_ = fmt::replace_all(inst, repl);
|
||||
embed_args(i, { arg0, arg1 }, clobbered);
|
||||
m_instructions.push_back(i);
|
||||
m_instructions.push_back(std::move(i));
|
||||
}
|
||||
|
||||
void UASM::emit3(const char* inst, const Arg& arg0, const Arg& arg1, const Arg& arg2, const std::vector<gpr>& clobbered)
|
||||
{
|
||||
int arg_id = 0;
|
||||
fmt_replacement_list_t repl = {
|
||||
const fmt_replacement_list_t repl = {
|
||||
{ "{0}", arg0.to_string(&arg_id) },
|
||||
{ "{1}", arg1.to_string(&arg_id) },
|
||||
{ "{2}", arg2.to_string(&arg_id) },
|
||||
@ -88,13 +88,13 @@ namespace aarch64
|
||||
compiled_instruction_t i{};
|
||||
i.asm_ = fmt::replace_all(inst, repl);
|
||||
embed_args(i, { arg0, arg1, arg2 }, clobbered);
|
||||
m_instructions.push_back(i);
|
||||
m_instructions.push_back(std::move(i));
|
||||
}
|
||||
|
||||
void UASM::emit4(const char* inst, const Arg& arg0, const Arg& arg1, const Arg& arg2, const Arg& arg3, const std::vector<gpr>& clobbered)
|
||||
{
|
||||
int arg_id = 0;
|
||||
fmt_replacement_list_t repl = {
|
||||
const fmt_replacement_list_t repl = {
|
||||
{ "{0}", arg0.to_string(&arg_id) },
|
||||
{ "{1}", arg1.to_string(&arg_id) },
|
||||
{ "{2}", arg2.to_string(&arg_id) },
|
||||
@ -104,14 +104,14 @@ namespace aarch64
|
||||
compiled_instruction_t i{};
|
||||
i.asm_ = fmt::replace_all(inst, repl);
|
||||
embed_args(i, { arg0, arg1, arg2, arg3 }, clobbered);
|
||||
m_instructions.push_back(i);
|
||||
m_instructions.push_back(std::move(i));
|
||||
}
|
||||
|
||||
void UASM::insert(llvm::IRBuilder<>* irb, llvm::LLVMContext& ctx) const
|
||||
{
|
||||
for (const auto& inst : m_instructions)
|
||||
{
|
||||
auto constraints = fmt::merge(inst.constraints, ",");
|
||||
const auto constraints = fmt::merge(inst.constraints, ",");
|
||||
llvm_asm(irb, inst.asm_, inst.args, constraints, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,49 +35,49 @@ struct SurMixerConfig
|
||||
{
|
||||
std::mutex mutex;
|
||||
|
||||
u32 audio_port;
|
||||
s32 priority;
|
||||
u32 ch_strips_1;
|
||||
u32 ch_strips_2;
|
||||
u32 ch_strips_6;
|
||||
u32 ch_strips_8;
|
||||
u32 audio_port = 0;
|
||||
s32 priority = 0;
|
||||
u32 ch_strips_1 = 0;
|
||||
u32 ch_strips_2 = 0;
|
||||
u32 ch_strips_6 = 0;
|
||||
u32 ch_strips_8 = 0;
|
||||
|
||||
vm::ptr<CellSurMixerNotifyCallbackFunction> cb;
|
||||
vm::ptr<void> cb_arg;
|
||||
vm::ptr<CellSurMixerNotifyCallbackFunction> cb {};
|
||||
vm::ptr<void> cb_arg {};
|
||||
|
||||
f32 mixdata[8 * 256];
|
||||
u64 mixcount;
|
||||
f32 mixdata[8 * 256] {};
|
||||
u64 mixcount = 0;
|
||||
};
|
||||
|
||||
struct SSPlayer
|
||||
{
|
||||
bool m_created; // SSPlayerCreate/Remove
|
||||
bool m_connected; // AANConnect/Disconnect
|
||||
bool m_active; // SSPlayerPlay/Stop
|
||||
u32 m_channels; // 1 or 2
|
||||
u32 m_addr;
|
||||
u32 m_samples;
|
||||
u32 m_loop_start;
|
||||
u32 m_loop_mode;
|
||||
u32 m_position;
|
||||
float m_level;
|
||||
float m_speed;
|
||||
float m_x;
|
||||
float m_y;
|
||||
float m_z;
|
||||
bool m_created = false; // SSPlayerCreate/Remove
|
||||
bool m_connected = false; // AANConnect/Disconnect
|
||||
bool m_active = false; // SSPlayerPlay/Stop
|
||||
u32 m_channels = 0; // 1 or 2
|
||||
u32 m_addr = 0;
|
||||
u32 m_samples = 0;
|
||||
u32 m_loop_start = 0;
|
||||
u32 m_loop_mode = 0;
|
||||
u32 m_position = 0;
|
||||
f32 m_level = 0.0f;
|
||||
f32 m_speed = 0.0f;
|
||||
f32 m_x = 0.0f;
|
||||
f32 m_y = 0.0f;
|
||||
f32 m_z = 0.0f;
|
||||
};
|
||||
|
||||
// TODO: use fxm
|
||||
SurMixerConfig g_surmx;
|
||||
SurMixerConfig g_surmx {};
|
||||
|
||||
std::vector<SSPlayer> g_ssp;
|
||||
|
||||
s32 cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr, u32 samples)
|
||||
s32 cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<f32> addr, u32 samples)
|
||||
{
|
||||
libmixer.trace("cellAANAddData(aan_handle=0x%x, aan_port=0x%x, offset=0x%x, addr=*0x%x, samples=%d)", aan_handle, aan_port, offset, addr, samples);
|
||||
|
||||
u32 type = aan_port >> 16;
|
||||
u32 port = aan_port & 0xffff;
|
||||
const u32 port = aan_port & 0xffff;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@ -94,7 +94,8 @@ s32 cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr
|
||||
if (port >= g_surmx.ch_strips_8) type = 0;
|
||||
break;
|
||||
default:
|
||||
type = 0; break;
|
||||
type = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (aan_handle != 0x11111111 || samples != 256 || !type || offset != 0)
|
||||
@ -110,7 +111,7 @@ s32 cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr
|
||||
// mono upmixing
|
||||
for (u32 i = 0; i < samples; i++)
|
||||
{
|
||||
const float center = addr[i];
|
||||
const f32 center = addr[i];
|
||||
g_surmx.mixdata[i * 8 + 0] += center;
|
||||
g_surmx.mixdata[i * 8 + 1] += center;
|
||||
}
|
||||
@ -120,8 +121,8 @@ s32 cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr
|
||||
// stereo upmixing
|
||||
for (u32 i = 0; i < samples; i++)
|
||||
{
|
||||
const float left = addr[i * 2 + 0];
|
||||
const float right = addr[i * 2 + 1];
|
||||
const f32 left = addr[i * 2 + 0];
|
||||
const f32 right = addr[i * 2 + 1];
|
||||
g_surmx.mixdata[i * 8 + 0] += left;
|
||||
g_surmx.mixdata[i * 8 + 1] += right;
|
||||
}
|
||||
@ -131,12 +132,12 @@ s32 cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr
|
||||
// 5.1 upmixing
|
||||
for (u32 i = 0; i < samples; i++)
|
||||
{
|
||||
const float left = addr[i * 6 + 0];
|
||||
const float right = addr[i * 6 + 1];
|
||||
const float center = addr[i * 6 + 2];
|
||||
const float low_freq = addr[i * 6 + 3];
|
||||
const float rear_left = addr[i * 6 + 4];
|
||||
const float rear_right = addr[i * 6 + 5];
|
||||
const f32 left = addr[i * 6 + 0];
|
||||
const f32 right = addr[i * 6 + 1];
|
||||
const f32 center = addr[i * 6 + 2];
|
||||
const f32 low_freq = addr[i * 6 + 3];
|
||||
const f32 rear_left = addr[i * 6 + 4];
|
||||
const f32 rear_right = addr[i * 6 + 5];
|
||||
g_surmx.mixdata[i * 8 + 0] += left;
|
||||
g_surmx.mixdata[i * 8 + 1] += right;
|
||||
g_surmx.mixdata[i * 8 + 2] += center;
|
||||
@ -205,13 +206,13 @@ s32 cellSSPlayerCreate(vm::ptr<u32> handle, vm::ptr<CellSSPlayerConfig> config)
|
||||
|
||||
std::lock_guard lock(g_surmx.mutex);
|
||||
|
||||
SSPlayer p;
|
||||
SSPlayer p {};
|
||||
p.m_created = true;
|
||||
p.m_connected = false;
|
||||
p.m_active = false;
|
||||
p.m_channels = config->channels;
|
||||
|
||||
g_ssp.push_back(p);
|
||||
g_ssp.push_back(std::move(p));
|
||||
*handle = ::size32(g_ssp) - 1;
|
||||
return CELL_OK;
|
||||
}
|
||||
@ -366,7 +367,7 @@ struct surmixer_thread : ppu_thread
|
||||
{
|
||||
//u64 stamp0 = get_guest_system_time();
|
||||
|
||||
memset(g_surmx.mixdata, 0, sizeof(g_surmx.mixdata));
|
||||
std::memset(g_surmx.mixdata, 0, sizeof(g_surmx.mixdata));
|
||||
if (g_surmx.cb)
|
||||
{
|
||||
g_surmx.cb(*this, g_surmx.cb_arg, static_cast<u32>(g_surmx.mixcount), 256);
|
||||
@ -381,10 +382,10 @@ struct surmixer_thread : ppu_thread
|
||||
for (auto& p : g_ssp) if (p.m_active && p.m_created)
|
||||
{
|
||||
auto v = vm::ptrl<s16>::make(p.m_addr); // 16-bit LE audio data
|
||||
float left = 0.0f;
|
||||
float right = 0.0f;
|
||||
float speed = std::fabs(p.m_speed);
|
||||
float fpos = 0.0f;
|
||||
f32 left = 0.0f;
|
||||
f32 right = 0.0f;
|
||||
f32 speed = std::fabs(p.m_speed);
|
||||
f32 fpos = 0.0f;
|
||||
for (s32 i = 0; i < 256; i++) if (p.m_active)
|
||||
{
|
||||
u32 pos = p.m_position;
|
||||
@ -454,7 +455,7 @@ struct surmixer_thread : ppu_thread
|
||||
|
||||
//u64 stamp2 = get_guest_system_time();
|
||||
|
||||
auto buf = vm::_ptr<f32>(port.addr.addr() + (g_surmx.mixcount % port.num_blocks) * port.num_channels * AUDIO_BUFFER_SAMPLES * sizeof(float));
|
||||
auto buf = vm::_ptr<f32>(port.addr.addr() + (g_surmx.mixcount % port.num_blocks) * port.num_channels * AUDIO_BUFFER_SAMPLES * sizeof(f32));
|
||||
|
||||
for (auto& mixdata : g_surmx.mixdata)
|
||||
{
|
||||
@ -497,7 +498,7 @@ s32 cellSurMixerCreate(vm::cptr<CellSurMixerConfig> config)
|
||||
port->num_channels = 8;
|
||||
port->num_blocks = 16;
|
||||
port->attr = 0;
|
||||
port->size = port->num_channels * port->num_blocks * AUDIO_BUFFER_SAMPLES * sizeof(float);
|
||||
port->size = port->num_channels * port->num_blocks * AUDIO_BUFFER_SAMPLES * sizeof(f32);
|
||||
port->level = 1.0f;
|
||||
port->level_set.store({ 1.0f, 0.0f });
|
||||
|
||||
@ -574,7 +575,7 @@ s32 cellSurMixerStart()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellSurMixerSetParameter(u32 param, float value)
|
||||
s32 cellSurMixerSetParameter(u32 param, f32 value)
|
||||
{
|
||||
libmixer.todo("cellSurMixerSetParameter(param=0x%x, value=%f)", param, value);
|
||||
return CELL_OK;
|
||||
@ -596,7 +597,7 @@ s32 cellSurMixerFinalize()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellSurMixerSurBusAddData(u32 busNo, u32 offset, vm::ptr<float> addr, u32 samples)
|
||||
s32 cellSurMixerSurBusAddData(u32 busNo, u32 offset, vm::ptr<f32> addr, u32 samples)
|
||||
{
|
||||
if (busNo < 8 && samples == 256 && offset == 0)
|
||||
{
|
||||
|
||||
@ -41,8 +41,8 @@ enum
|
||||
CELL_SURMIXER_PARAM_REVERBLEVEL = 41, // in dB
|
||||
};
|
||||
|
||||
static const float CELL_SURMIXER_CONT_MUTEON = 1.0;
|
||||
static const float CELL_SURMIXER_CONT_MUTEOFF = 0.0;
|
||||
static constexpr f32 CELL_SURMIXER_CONT_MUTEON = 1.0f;
|
||||
static constexpr f32 CELL_SURMIXER_CONT_MUTEOFF = 0.0f;
|
||||
|
||||
enum
|
||||
{
|
||||
@ -137,15 +137,15 @@ struct CellSSPlayerCommonParam
|
||||
|
||||
struct CellSurMixerPosition
|
||||
{
|
||||
be_t<float> x;
|
||||
be_t<float> y;
|
||||
be_t<float> z;
|
||||
be_t<f32> x;
|
||||
be_t<f32> y;
|
||||
be_t<f32> z;
|
||||
};
|
||||
|
||||
struct CellSSPlayerRuntimeInfo
|
||||
{
|
||||
be_t<float> level;
|
||||
be_t<float> speed;
|
||||
be_t<f32> level;
|
||||
be_t<f32> speed;
|
||||
CellSurMixerPosition position;
|
||||
};
|
||||
|
||||
@ -163,6 +163,6 @@ struct CellSurMixerChStripParam
|
||||
be_t<u32> param;
|
||||
be_t<u32> attribute_addr;
|
||||
be_t<s32> dBSwitch;
|
||||
be_t<float> floatVal;
|
||||
be_t<f32> floatVal;
|
||||
be_t<s32> intVal;
|
||||
};
|
||||
|
||||
@ -563,8 +563,8 @@ void usb_device_rb3_midi_drums::interrupt_transfer(u32 buf_size, u8* buf, u32 /*
|
||||
}
|
||||
else
|
||||
{
|
||||
bool is_cancel = kit_state.snare >= midi::min_velocity();
|
||||
bool is_accept = kit_state.floor_tom >= midi::min_velocity();
|
||||
const bool is_cancel = kit_state.snare >= midi::min_velocity();
|
||||
const bool is_accept = kit_state.floor_tom >= midi::min_velocity();
|
||||
if (hold_kick && (is_cancel || is_accept))
|
||||
{
|
||||
// Hold kick brings up the song category selector menu, which can be dismissed using accept/cancel buttons.
|
||||
|
||||
@ -595,8 +595,7 @@ namespace
|
||||
|
||||
for (int row = 0; row < row_count; ++row)
|
||||
{
|
||||
rsx::memory_transfer_cmd cmd{ dst_, src_, width_in_bytes };
|
||||
result.push_back(cmd);
|
||||
result.push_back(rsx::memory_transfer_cmd{ dst_, src_, width_in_bytes });
|
||||
src_ += src_pitch_in_bytes;
|
||||
dst_ += dst_pitch_in_bytes;
|
||||
}
|
||||
|
||||
@ -1197,7 +1197,7 @@ namespace rsx
|
||||
info.src_area.width = width;
|
||||
}
|
||||
|
||||
result.push_back(info);
|
||||
result.push_back(std::move(info));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -3180,7 +3180,7 @@ namespace rsx
|
||||
subres.pitch_in_block = full_width;
|
||||
subres.depth = 1;
|
||||
subres.data = { vm::_ptr<const std::byte>(image_base), static_cast<std::span<const std::byte>::size_type>(src.pitch * image_height) };
|
||||
subresource_layout.push_back(subres);
|
||||
subresource_layout.push_back(std::move(subres));
|
||||
|
||||
const u32 gcm_format = helpers::get_sized_blit_format(src_is_argb8, dst_is_depth_surface, is_format_convert);
|
||||
const auto rsx_range = address_range32::start_length(image_base, src.pitch * image_height);
|
||||
@ -3321,7 +3321,7 @@ namespace rsx
|
||||
subres.pitch_in_block = pitch_in_block;
|
||||
subres.depth = 1;
|
||||
subres.data = { vm::get_super_ptr<const std::byte>(dst_base_address), static_cast<std::span<const std::byte>::size_type>(dst.pitch * dst_dimensions.height) };
|
||||
subresource_layout.push_back(subres);
|
||||
subresource_layout.push_back(std::move(subres));
|
||||
|
||||
cached_dest = upload_image_from_cpu(cmd, rsx_range, dst_dimensions.width, dst_dimensions.height, 1, 1, dst.pitch,
|
||||
preferred_dst_format, rsx::texture_upload_context::blit_engine_dst, subresource_layout,
|
||||
|
||||
@ -806,7 +806,7 @@ namespace rsx
|
||||
// Make sure min/max reflects the data being displayed, not the entire datapoints vector
|
||||
for (usz i = m_datapoints.size() - m_datapoint_count; i < m_datapoints.size(); i++)
|
||||
{
|
||||
const f32& dp = m_datapoints[i];
|
||||
const f32 dp = m_datapoints[i];
|
||||
|
||||
if (dp < 0) continue; // Skip initial negative values. They don't count.
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ namespace rsx::assembler
|
||||
rsx::simple_array<u32> get_register_file_range(const RegisterRef& reg);
|
||||
|
||||
// Compile a register file annotated blob to register references
|
||||
std::vector<RegisterRef> compile_register_file(const std::array<char, 48 * 8>& file);
|
||||
std::vector<RegisterRef> compile_register_file(const register_file_t& file);
|
||||
|
||||
// Invert execution mask on an instruction
|
||||
void invert_conditional_execution_mask(Instruction* instruction);
|
||||
|
||||
@ -105,14 +105,14 @@ namespace rsx::assembler
|
||||
FlowEdge* insert_succ(BasicBlock* b, EdgeType type = EdgeType::NONE)
|
||||
{
|
||||
FlowEdge e{ .type = type, .from = this, .to = b };
|
||||
succ.push_back(e);
|
||||
succ.push_back(std::move(e));
|
||||
return &succ.back();
|
||||
}
|
||||
|
||||
FlowEdge* insert_pred(BasicBlock* b, EdgeType type = EdgeType::NONE)
|
||||
{
|
||||
FlowEdge e{ .type = type, .from = b, .to = this };
|
||||
pred.push_back(e);
|
||||
pred.push_back(std::move(e));
|
||||
return &pred.back();
|
||||
}
|
||||
|
||||
|
||||
@ -182,7 +182,7 @@ namespace rsx::assembler::FP
|
||||
instruction.bytecode[2] = src1.HEX;
|
||||
|
||||
Register src_reg{ .id = static_cast<int>(src_reg_id), .f16 = true };
|
||||
instruction.srcs.push_back({ .reg = src_reg, .mask = 0xF });
|
||||
instruction.srcs.push_back({ .reg = std::move(src_reg), .mask = 0xF });
|
||||
instruction.dsts.push_back({ .reg{ .id = reg_id, .f16 = false }, .mask = (1u << ch) });
|
||||
result.push_back(std::move(instruction));
|
||||
}
|
||||
@ -250,7 +250,7 @@ namespace rsx::assembler::FP
|
||||
instruction.bytecode[1] = src0.HEX;
|
||||
|
||||
Register src_reg{ .id = static_cast<int>(src_reg_id), .f16 = true };
|
||||
instruction.srcs.push_back({ .reg = src_reg, .mask = 0xF });
|
||||
instruction.srcs.push_back({ .reg = std::move(src_reg), .mask = 0xF });
|
||||
instruction.dsts.push_back({ .reg{.id = reg.reg.id, .f16 = false }, .mask = dst.write_mask });
|
||||
result.push_back(std::move(instruction));
|
||||
}
|
||||
|
||||
@ -636,7 +636,7 @@ namespace glsl
|
||||
}
|
||||
}
|
||||
|
||||
varying_list.push_back({ reg_location, var_name, PT.type });
|
||||
varying_list.push_back({ reg_location, std::move(var_name), PT.type });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -326,7 +326,7 @@ public:
|
||||
new_swizzle += swizzle[p.second];
|
||||
}
|
||||
|
||||
swizzles.push_back(new_swizzle);
|
||||
swizzles.push_back(std::move(new_swizzle));
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -3222,7 +3222,7 @@ namespace rsx
|
||||
// capture first tile state with nop cmd
|
||||
rsx::frame_capture_data::replay_command replay_cmd;
|
||||
replay_cmd.rsx_command = std::make_pair(NV4097_NO_OPERATION, 0);
|
||||
frame_capture.replay_commands.push_back(replay_cmd);
|
||||
frame_capture.replay_commands.push_back(std::move(replay_cmd));
|
||||
capture::capture_display_tile_state(this, frame_capture.replay_commands.back());
|
||||
}
|
||||
else if (capture_current_frame)
|
||||
|
||||
@ -13,20 +13,19 @@ namespace vk
|
||||
std::vector<glsl::program_input> result;
|
||||
for (unsigned i = 0; i < ssbo_count; ++i)
|
||||
{
|
||||
const auto input = glsl::program_input::make
|
||||
result.push_back(glsl::program_input::make
|
||||
(
|
||||
::glsl::glsl_compute_program,
|
||||
"ssbo" + std::to_string(i),
|
||||
glsl::program_input_type::input_type_storage_buffer,
|
||||
0,
|
||||
i
|
||||
);
|
||||
result.push_back(input);
|
||||
));
|
||||
}
|
||||
|
||||
if (use_push_constants && push_constants_size > 0)
|
||||
{
|
||||
const auto input = glsl::program_input::make
|
||||
result.push_back(glsl::program_input::make
|
||||
(
|
||||
::glsl::glsl_compute_program,
|
||||
"push_constants",
|
||||
@ -34,8 +33,7 @@ namespace vk
|
||||
0,
|
||||
0,
|
||||
glsl::push_constant_ref{ .offset = 0, .size = push_constants_size }
|
||||
);
|
||||
result.push_back(input);
|
||||
));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@ -253,14 +253,13 @@ void VKFragmentDecompilerThread::insertConstants(std::stringstream & OS)
|
||||
|
||||
OS << "layout(set=" << vk::glsl::binding_set_index_fragment << ", binding=" << vk_prog->binding_table.frag_depth_input_location << ") uniform " << frag_depth_type << " frag_depth;\n";
|
||||
|
||||
auto in = vk::glsl::program_input::make(
|
||||
inputs.push_back(vk::glsl::program_input::make(
|
||||
glsl::glsl_fragment_program,
|
||||
"frag_depth",
|
||||
vk::glsl::input_type_texture,
|
||||
vk::glsl::binding_set_index_fragment,
|
||||
vk_prog->binding_table.frag_depth_input_location
|
||||
);
|
||||
inputs.push_back(in);
|
||||
));
|
||||
}
|
||||
|
||||
// Draw params are always provided by vertex program. Instead of pointer chasing, they're provided as varyings.
|
||||
|
||||
@ -67,23 +67,20 @@ namespace vk
|
||||
|
||||
for (u32 n = 0; n < m_num_uniform_buffers; ++n, ++binding)
|
||||
{
|
||||
const std::string name = std::string("static_data") + (n > 0 ? std::to_string(n) : "");
|
||||
const auto input = program_input::make(::glsl::program_domain::glsl_fragment_program, name, program_input_type::input_type_uniform_buffer, 0, 0);
|
||||
fs_inputs.push_back(input);
|
||||
std::string name = std::string("static_data") + (n > 0 ? std::to_string(n) : "");
|
||||
fs_inputs.push_back(program_input::make(::glsl::program_domain::glsl_fragment_program, std::move(name), program_input_type::input_type_uniform_buffer, 0, 0));
|
||||
}
|
||||
|
||||
for (u32 n = 0; n < m_num_usable_samplers; ++n, ++binding)
|
||||
{
|
||||
const std::string name = "fs" + std::to_string(n);
|
||||
const auto input = program_input::make(::glsl::program_domain::glsl_fragment_program, name, program_input_type::input_type_texture, 0, binding);
|
||||
fs_inputs.push_back(input);
|
||||
std::string name = "fs" + std::to_string(n);
|
||||
fs_inputs.push_back(program_input::make(::glsl::program_domain::glsl_fragment_program, std::move(name), program_input_type::input_type_texture, 0, binding));
|
||||
}
|
||||
|
||||
for (u32 n = 0; n < m_num_input_attachments; ++n, ++binding)
|
||||
{
|
||||
const std::string name = "sp" + std::to_string(n);
|
||||
const auto input = program_input::make(::glsl::program_domain::glsl_fragment_program, name, program_input_type::input_type_texture, 0, binding);
|
||||
fs_inputs.push_back(input);
|
||||
std::string name = "sp" + std::to_string(n);
|
||||
fs_inputs.push_back(program_input::make(::glsl::program_domain::glsl_fragment_program, std::move(name), program_input_type::input_type_texture, 0, binding));
|
||||
}
|
||||
|
||||
return fs_inputs;
|
||||
|
||||
@ -89,6 +89,25 @@ namespace vk
|
||||
.name = name
|
||||
};
|
||||
}
|
||||
|
||||
static program_input make(
|
||||
::glsl::program_domain domain,
|
||||
std::string&& name,
|
||||
program_input_type type,
|
||||
u32 set,
|
||||
u32 location,
|
||||
const bound_data_t& data = bound_buffer{})
|
||||
{
|
||||
return program_input
|
||||
{
|
||||
.domain = domain,
|
||||
.type = type,
|
||||
.bound_data = data,
|
||||
.set = set,
|
||||
.location = location,
|
||||
.name = std::move(name)
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
class shader
|
||||
|
||||
@ -301,7 +301,7 @@ namespace vk
|
||||
color_attachment_description.initialLayout = layout;
|
||||
color_attachment_description.finalLayout = layout;
|
||||
|
||||
attachments.push_back(color_attachment_description);
|
||||
attachments.push_back(std::move(color_attachment_description));
|
||||
attachment_references.push_back({ attachment_count++, layout });
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ namespace vk
|
||||
depth_attachment_description.stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE;
|
||||
depth_attachment_description.initialLayout = dsv_layout;
|
||||
depth_attachment_description.finalLayout = dsv_layout;
|
||||
attachments.push_back(depth_attachment_description);
|
||||
attachments.push_back(std::move(depth_attachment_description));
|
||||
|
||||
attachment_references.push_back({ attachment_count, dsv_layout });
|
||||
}
|
||||
|
||||
@ -257,13 +257,14 @@ namespace vk
|
||||
// Declare local inputs
|
||||
auto vs_inputs = comp.get_inputs();
|
||||
|
||||
vk::glsl::program_input in;
|
||||
in.set = 0;
|
||||
in.domain = ::glsl::glsl_vertex_program;
|
||||
in.location = vertex_instruction_start;
|
||||
in.type = glsl::input_type_storage_buffer;
|
||||
in.name = "VertexInstructionBlock";
|
||||
vs_inputs.push_back(in);
|
||||
vs_inputs.push_back(vk::glsl::program_input::make
|
||||
(
|
||||
::glsl::glsl_vertex_program,
|
||||
"VertexInstructionBlock",
|
||||
glsl::input_type_storage_buffer,
|
||||
0,
|
||||
vertex_instruction_start
|
||||
));
|
||||
|
||||
vk_prog->SetInputs(vs_inputs);
|
||||
|
||||
@ -426,12 +427,14 @@ namespace vk
|
||||
// Declare local inputs
|
||||
auto inputs = comp.get_inputs();
|
||||
|
||||
vk::glsl::program_input in;
|
||||
in.set = 1;
|
||||
in.domain = ::glsl::glsl_fragment_program;
|
||||
in.location = fragment_instruction_start;
|
||||
in.type = glsl::input_type_storage_buffer;
|
||||
in.name = "FragmentInstructionBlock";
|
||||
vk::glsl::program_input in = vk::glsl::program_input::make
|
||||
(
|
||||
::glsl::glsl_fragment_program,
|
||||
"FragmentInstructionBlock",
|
||||
glsl::input_type_storage_buffer,
|
||||
1,
|
||||
fragment_instruction_start
|
||||
);
|
||||
inputs.push_back(in);
|
||||
|
||||
if (compiler_options & COMPILER_OPT_ENABLE_TEXTURES)
|
||||
|
||||
@ -1265,7 +1265,7 @@ namespace vk
|
||||
upload_command_flags |= source_is_gpu_resident;
|
||||
heap_align = width * bpp;
|
||||
|
||||
tmp.push_back(subres);
|
||||
tmp.push_back(std::move(subres));
|
||||
p_subresource_layout = &tmp;
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ void VKVertexDecompilerThread::insertHeader(std::stringstream &OS)
|
||||
" vertex_context_t vertex_contexts[];\n"
|
||||
"};\n\n";
|
||||
|
||||
const vk::glsl::program_input context_input
|
||||
vk::glsl::program_input context_input
|
||||
{
|
||||
.domain = glsl::glsl_vertex_program,
|
||||
.type = vk::glsl::input_type_uniform_buffer,
|
||||
@ -103,7 +103,7 @@ void VKVertexDecompilerThread::insertHeader(std::stringstream &OS)
|
||||
.location = vk_prog->binding_table.context_buffer_location,
|
||||
.name = "VertexContextBuffer"
|
||||
};
|
||||
inputs.push_back(context_input);
|
||||
inputs.push_back(std::move(context_input));
|
||||
|
||||
if (m_device_props.emulate_conditional_rendering)
|
||||
{
|
||||
@ -113,7 +113,7 @@ void VKVertexDecompilerThread::insertHeader(std::stringstream &OS)
|
||||
" uint cr_predicate_value;\n"
|
||||
"};\n\n";
|
||||
|
||||
const vk::glsl::program_input predicate_input
|
||||
vk::glsl::program_input predicate_input
|
||||
{
|
||||
.domain = glsl::glsl_vertex_program,
|
||||
.type = vk::glsl::input_type_storage_buffer,
|
||||
@ -121,7 +121,7 @@ void VKVertexDecompilerThread::insertHeader(std::stringstream &OS)
|
||||
.location = vk_prog->binding_table.cr_pred_buffer_location,
|
||||
.name = "EXT_Conditional_Rendering"
|
||||
};
|
||||
inputs.push_back(predicate_input);
|
||||
inputs.push_back(std::move(predicate_input));
|
||||
}
|
||||
|
||||
OS <<
|
||||
@ -130,7 +130,7 @@ void VKVertexDecompilerThread::insertHeader(std::stringstream &OS)
|
||||
" draw_parameters_t draw_parameters[];\n"
|
||||
"};\n\n";
|
||||
|
||||
const vk::glsl::program_input layouts_input
|
||||
vk::glsl::program_input layouts_input
|
||||
{
|
||||
.domain = glsl::glsl_vertex_program,
|
||||
.type = vk::glsl::input_type_storage_buffer,
|
||||
@ -138,7 +138,7 @@ void VKVertexDecompilerThread::insertHeader(std::stringstream &OS)
|
||||
.location = vk_prog->binding_table.vertex_buffers_location + 2,
|
||||
.name = "DrawParametersBuffer"
|
||||
};
|
||||
inputs.push_back(layouts_input);
|
||||
inputs.push_back(std::move(layouts_input));
|
||||
|
||||
OS <<
|
||||
"layout(push_constant) uniform push_constants_block\n"
|
||||
@ -146,7 +146,7 @@ void VKVertexDecompilerThread::insertHeader(std::stringstream &OS)
|
||||
" uint draw_parameters_offset;\n"
|
||||
"};\n\n";
|
||||
|
||||
const vk::glsl::program_input push_constants
|
||||
vk::glsl::program_input push_constants
|
||||
{
|
||||
.domain = glsl::glsl_vertex_program,
|
||||
.type = vk::glsl::input_type_push_constant,
|
||||
@ -155,7 +155,7 @@ void VKVertexDecompilerThread::insertHeader(std::stringstream &OS)
|
||||
.location = umax,
|
||||
.name = "push_constants_block"
|
||||
};
|
||||
inputs.push_back(push_constants);
|
||||
inputs.push_back(std::move(push_constants));
|
||||
}
|
||||
|
||||
void VKVertexDecompilerThread::insertInputs(std::stringstream& OS, const std::vector<ParamType>& /*inputs*/)
|
||||
@ -171,15 +171,14 @@ void VKVertexDecompilerThread::insertInputs(std::stringstream& OS, const std::ve
|
||||
{
|
||||
OS << "layout(set=0, binding=" << location << ") uniform usamplerBuffer " << stream << ";\n";
|
||||
|
||||
const vk::glsl::program_input input
|
||||
this->inputs.push_back(vk::glsl::program_input
|
||||
{
|
||||
.domain = glsl::glsl_vertex_program,
|
||||
.type = vk::glsl::input_type_texel_buffer,
|
||||
.set = vk::glsl::binding_set_index_vertex,
|
||||
.location = location++,
|
||||
.name = stream
|
||||
};
|
||||
this->inputs.push_back(input);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1032,7 +1032,7 @@ namespace vk
|
||||
|
||||
for (u32 i = 0; i < memory_properties.memoryTypeCount; i++)
|
||||
{
|
||||
auto& type_info = memory_properties.memoryTypes[i];
|
||||
const auto& type_info = memory_properties.memoryTypes[i];
|
||||
memory_heap_map[type_info.heapIndex].types.push_back({ i, type_info.propertyFlags, 0 });
|
||||
}
|
||||
|
||||
@ -1040,9 +1040,9 @@ namespace vk
|
||||
{
|
||||
std::vector<memory_type> results;
|
||||
|
||||
for (auto& heap : memory_heap_map)
|
||||
for (const auto& heap : memory_heap_map)
|
||||
{
|
||||
for (auto &type : heap.types)
|
||||
for (const auto& type : heap.types)
|
||||
{
|
||||
if (((type.flags & desired_flags) == desired_flags) && !(type.flags & excluded_flags))
|
||||
{
|
||||
|
||||
@ -454,13 +454,13 @@ namespace vk
|
||||
dst_stages |= VK_PIPELINE_STAGE_TRANSFER_BIT;
|
||||
if (memory_barriers.empty())
|
||||
{
|
||||
const VkMemoryBarrier signal_barrier =
|
||||
VkMemoryBarrier signal_barrier =
|
||||
{
|
||||
.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER,
|
||||
.srcAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
|
||||
.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT
|
||||
};
|
||||
memory_barriers.push_back(signal_barrier);
|
||||
memory_barriers.push_back(std::move(signal_barrier));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -2212,11 +2212,11 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch,
|
||||
|
||||
for (auto&& entry : fs::dir{ins_dir})
|
||||
{
|
||||
const std::string pkg_file = ins_dir + entry.name;
|
||||
std::string pkg_file = ins_dir + entry.name;
|
||||
|
||||
if (!entry.is_directory && entry.name.ends_with(".PKG"))
|
||||
{
|
||||
pkgs.push_back(pkg_file);
|
||||
pkgs.push_back(std::move(pkg_file));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2229,11 +2229,11 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch,
|
||||
{
|
||||
if (entry.is_directory && entry.name.starts_with("PKG"))
|
||||
{
|
||||
const std::string pkg_file = pkg_dir + entry.name + "/INSTALL.PKG";
|
||||
std::string pkg_file = pkg_dir + entry.name + "/INSTALL.PKG";
|
||||
|
||||
if (fs::is_file(pkg_file))
|
||||
{
|
||||
pkgs.push_back(pkg_file);
|
||||
pkgs.push_back(std::move(pkg_file));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2247,11 +2247,11 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch,
|
||||
{
|
||||
if (entry.is_directory && entry.name[0] == 'D')
|
||||
{
|
||||
const std::string pkg_file = extra_dir + entry.name + "/DATA000.PKG";
|
||||
std::string pkg_file = extra_dir + entry.name + "/DATA000.PKG";
|
||||
|
||||
if (fs::is_file(pkg_file))
|
||||
{
|
||||
pkgs.push_back(pkg_file);
|
||||
pkgs.push_back(std::move(pkg_file));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,8 +207,8 @@ bool TROPUSRLoader::Generate(std::string_view filepath, std::string_view configp
|
||||
TROPUSREntry4 entry4 = { 4, u32{sizeof(TROPUSREntry4)} - 0x10, ::size32(m_table4), 0, trophy_id, trophy_grade, trophy_pid };
|
||||
TROPUSREntry6 entry6 = { 6, u32{sizeof(TROPUSREntry6)} - 0x10, ::size32(m_table6), 0, trophy_id };
|
||||
|
||||
m_table4.push_back(entry4);
|
||||
m_table6.push_back(entry6);
|
||||
m_table4.push_back(std::move(entry4));
|
||||
m_table6.push_back(std::move(entry6));
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,8 +219,8 @@ bool TROPUSRLoader::Generate(std::string_view filepath, std::string_view configp
|
||||
offset += m_table6.size() * sizeof(TROPUSREntry6);
|
||||
|
||||
m_tableHeaders.clear();
|
||||
m_tableHeaders.push_back(table4header);
|
||||
m_tableHeaders.push_back(table6header);
|
||||
m_tableHeaders.push_back(std::move(table4header));
|
||||
m_tableHeaders.push_back(std::move(table6header));
|
||||
|
||||
std::memset(&m_header, 0, sizeof(m_header));
|
||||
m_header.magic = TROPUSR_MAGIC;
|
||||
|
||||
@ -394,7 +394,7 @@ EmuCallbacks main_application::CreateCallbacks()
|
||||
{
|
||||
font_dir += '/';
|
||||
}
|
||||
font_dirs.push_back(font_dir);
|
||||
font_dirs.push_back(std::move(font_dir));
|
||||
}
|
||||
return font_dirs;
|
||||
};
|
||||
|
||||
@ -13,8 +13,6 @@ namespace rpcs3::curl
|
||||
|
||||
curl_handle::curl_handle()
|
||||
{
|
||||
reset_error_buffer();
|
||||
|
||||
m_curl = curl_easy_init();
|
||||
|
||||
CURLcode err = curl_easy_setopt(m_curl, CURLOPT_ERRORBUFFER, m_error_buffer.data());
|
||||
@ -44,7 +42,6 @@ CURL* curl_handle::get_curl() const
|
||||
|
||||
void curl_handle::reset_error_buffer()
|
||||
{
|
||||
ensure(m_error_buffer.size() == CURL_ERROR_SIZE);
|
||||
m_error_buffer[0] = 0;
|
||||
}
|
||||
|
||||
@ -52,7 +49,6 @@ std::string curl_handle::get_verbose_error(CURLcode code) const
|
||||
{
|
||||
if (m_uses_error_buffer)
|
||||
{
|
||||
ensure(m_error_buffer.size() == CURL_ERROR_SIZE);
|
||||
if (m_error_buffer[0])
|
||||
{
|
||||
return fmt::format("Curl error (%d): %s\nDetails: %s", static_cast<int>(code), curl_easy_strerror(code), m_error_buffer.data());
|
||||
|
||||
@ -27,7 +27,7 @@ public:
|
||||
private:
|
||||
CURL* m_curl = nullptr;
|
||||
bool m_uses_error_buffer = false;
|
||||
std::array<char, CURL_ERROR_SIZE> m_error_buffer;
|
||||
std::array<char, CURL_ERROR_SIZE> m_error_buffer {};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -626,7 +626,7 @@ bool figure_creator_dialog::create_blank_figure(u32 character, u8 series)
|
||||
std::array<u8, 16> uid_data = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x44, 0x00, 0xC2};
|
||||
for (u8 i = 0; i < 7; i++)
|
||||
{
|
||||
u8 random = rand() % 255;
|
||||
const u8 random = rand() % 255;
|
||||
sha1_calc.push_back(random);
|
||||
uid_data[i] = random;
|
||||
}
|
||||
@ -659,7 +659,7 @@ bool figure_creator_dialog::create_blank_figure(u32 character, u8 series)
|
||||
figure_data[6] = 0x1C;
|
||||
}
|
||||
|
||||
u32 checksum = infinity_crc32(0, figure_data.data(), 12);
|
||||
const u32 checksum = infinity_crc32(0, figure_data.data(), 12);
|
||||
for (s8 i = 0; i < 4; i++)
|
||||
{
|
||||
figure_data[12 + i] = u8((checksum >> (3 - i) * 8) & 0xFF);
|
||||
|
||||
@ -297,13 +297,13 @@ std::vector<compat::package_info> pkg_install_dialog::get_paths_to_install() con
|
||||
const QListWidgetItem* item = m_dir_list->item(i);
|
||||
if (item && (m_dir_list->count() == 1 || item->checkState() == Qt::Checked))
|
||||
{
|
||||
compat::package_info info;
|
||||
compat::package_info info {};
|
||||
info.path = item->data(Roles::FullPathRole).toString();
|
||||
info.title = item->data(Roles::TitleRole).toString();
|
||||
info.title_id = item->data(Roles::TitleIdRole).toString();
|
||||
info.changelog = item->data(Roles::ChangelogRole).toString();
|
||||
info.version = item->data(Roles::VersionRole).toString();
|
||||
result.push_back(info);
|
||||
result.push_back(std::move(info));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user