mirror of
https://github.com/ARMSX2/ARMSX3.git
synced 2026-08-24 16:58:52 -07:00
Use more std::move
This commit is contained in:
@@ -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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user