mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
rsx: make some functions const
This commit is contained in:
parent
1c7850de17
commit
461862be46
@ -134,12 +134,12 @@ struct GLProgramBuffer : public program_state_cache<GLTraits>
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void add_pipeline_entry(RSXVertexProgram &vp, RSXFragmentProgram &fp, void* &props, Args&& ...args)
|
||||
void add_pipeline_entry(const RSXVertexProgram& vp, const RSXFragmentProgram& fp, void* &props, Args&& ...args)
|
||||
{
|
||||
get_graphics_pipeline(vp, fp, props, false, false, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
void preload_programs(RSXVertexProgram &vp, RSXFragmentProgram &fp)
|
||||
void preload_programs(const RSXVertexProgram& vp, const RSXFragmentProgram& fp)
|
||||
{
|
||||
search_vertex_program(vp);
|
||||
search_fragment_program(fp);
|
||||
|
@ -15,7 +15,6 @@ void CgBinaryDisasm::AddCodeAsm(const std::string& code)
|
||||
m_dst_reg_name = fmt::format("RC%s, ", GetMask());
|
||||
op_name = rsx_fp_op_names[m_opcode] + "XC";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
m_dst_reg_name = fmt::format("%s%d%s, ", dst.fp16 ? "H" : "R", dst.dest_reg, GetMask());
|
||||
@ -189,8 +188,8 @@ template<typename T> std::string CgBinaryDisasm::GetSrcDisAsm(T src)
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: //const
|
||||
ret += AddConstDisAsm();
|
||||
|
@ -165,16 +165,16 @@ public:
|
||||
|
||||
// VP functions
|
||||
std::string GetMaskDisasm(bool is_sca) const;
|
||||
std::string GetVecMaskDisasm();
|
||||
std::string GetScaMaskDisasm();
|
||||
std::string GetDSTDisasm(bool is_sca = false);
|
||||
std::string GetSRCDisasm(u32 n);
|
||||
std::string GetVecMaskDisasm() const;
|
||||
std::string GetScaMaskDisasm() const;
|
||||
std::string GetDSTDisasm(bool is_sca = false) const;
|
||||
std::string GetSRCDisasm(u32 n) const;
|
||||
static std::string GetTexDisasm();
|
||||
std::string GetCondDisasm() const;
|
||||
std::string AddAddrMaskDisasm() const;
|
||||
std::string AddAddrRegDisasm();
|
||||
std::string AddAddrRegDisasm() const;
|
||||
u32 GetAddrDisasm() const;
|
||||
std::string FormatDisasm(const std::string& code);
|
||||
std::string FormatDisasm(const std::string& code) const;
|
||||
void AddScaCodeDisasm(const std::string& code = "");
|
||||
void AddVecCodeDisasm(const std::string& code = "");
|
||||
void AddCodeCondDisasm(const std::string& dst, const std::string& src);
|
||||
|
@ -40,17 +40,17 @@ std::string CgBinaryDisasm::GetMaskDisasm(bool is_sca) const
|
||||
return ret == "."sv || ret == ".xyzw"sv ? "" : (ret);
|
||||
}
|
||||
|
||||
std::string CgBinaryDisasm::GetVecMaskDisasm()
|
||||
std::string CgBinaryDisasm::GetVecMaskDisasm() const
|
||||
{
|
||||
return GetMaskDisasm(false);
|
||||
}
|
||||
|
||||
std::string CgBinaryDisasm::GetScaMaskDisasm()
|
||||
std::string CgBinaryDisasm::GetScaMaskDisasm() const
|
||||
{
|
||||
return GetMaskDisasm(true);
|
||||
}
|
||||
|
||||
std::string CgBinaryDisasm::GetDSTDisasm(bool is_sca)
|
||||
std::string CgBinaryDisasm::GetDSTDisasm(bool is_sca) const
|
||||
{
|
||||
std::string ret;
|
||||
std::string mask = GetMaskDisasm(is_sca);
|
||||
@ -107,7 +107,7 @@ std::string CgBinaryDisasm::GetDSTDisasm(bool is_sca)
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string CgBinaryDisasm::GetSRCDisasm(const u32 n)
|
||||
std::string CgBinaryDisasm::GetSRCDisasm(const u32 n) const
|
||||
{
|
||||
ensure(n < 3);
|
||||
|
||||
@ -224,7 +224,7 @@ std::string CgBinaryDisasm::GetTexDisasm()
|
||||
return fmt::format("TEX%d", 0);
|
||||
}
|
||||
|
||||
std::string CgBinaryDisasm::FormatDisasm(const std::string& code)
|
||||
std::string CgBinaryDisasm::FormatDisasm(const std::string& code) const
|
||||
{
|
||||
const std::pair<std::string_view, std::function<std::string()>> repl_list[] =
|
||||
{
|
||||
@ -355,7 +355,7 @@ std::string CgBinaryDisasm::AddAddrMaskDisasm() const
|
||||
return std::string(".") + f[d0.addr_swz];
|
||||
}
|
||||
|
||||
std::string CgBinaryDisasm::AddAddrRegDisasm()
|
||||
std::string CgBinaryDisasm::AddAddrRegDisasm() const
|
||||
{
|
||||
//static constexpr std::string_view f = "xyzw";
|
||||
return fmt::format("A%d", d0.addr_reg_sel_1) + AddAddrMaskDisasm();
|
||||
|
@ -328,7 +328,7 @@ struct RSXFragmentProgram
|
||||
|
||||
static RSXFragmentProgram clone(const RSXFragmentProgram& prog)
|
||||
{
|
||||
auto result = prog;
|
||||
RSXFragmentProgram result = prog;
|
||||
result.clone_data();
|
||||
return result;
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ struct ParamArray
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool HasParamTypeless(const ParamFlag flag, const std::string& name)
|
||||
bool HasParamTypeless(const ParamFlag flag, const std::string& name) const
|
||||
{
|
||||
const auto& p = params[flag];
|
||||
return std::any_of(p.cbegin(), p.cend(), [&name](const auto& param)
|
||||
|
@ -42,7 +42,7 @@ namespace rsx
|
||||
std::memcpy(static_cast<u8*>(dst) + mem_offset, reinterpret_cast<const u8*>(src) + mem_offset, mem_size);
|
||||
}
|
||||
|
||||
void fragment_program_texture_config::write_to(void* dst, u16 mask)
|
||||
void fragment_program_texture_config::write_to(void* dst, u16 mask) const
|
||||
{
|
||||
masked_transfer(dst, slots_, mask);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ namespace rsx
|
||||
|
||||
TIU_slot& operator[](u32 index) { return slots_[index]; }
|
||||
|
||||
void write_to(void* dst, u16 mask);
|
||||
void write_to(void* dst, u16 mask) const;
|
||||
void load_from(const void* src, u16 mask);
|
||||
|
||||
static void masked_transfer(void* dst, const void* src, u16 mask);
|
||||
|
Loading…
Reference in New Issue
Block a user