rsx: fix warnings and add missing default cases

This commit is contained in:
Megamouse 2024-06-10 23:04:52 +02:00
parent f4622fac41
commit 1c7850de17
2 changed files with 6 additions and 0 deletions

View File

@ -109,6 +109,8 @@ std::string CgBinaryDisasm::GetDSTDisasm(bool is_sca)
std::string CgBinaryDisasm::GetSRCDisasm(const u32 n)
{
ensure(n < 3);
std::string ret;
static constexpr std::array<std::string_view, 16> reg_table =
@ -171,6 +173,7 @@ std::string CgBinaryDisasm::GetSRCDisasm(const u32 n)
switch (n)
{
default:
case 0: abs = d0.src0_abs; break;
case 1: abs = d0.src1_abs; break;
case 2: abs = d0.src2_abs; break;

View File

@ -96,6 +96,8 @@ std::string VertexProgramDecompiler::GetDST(bool is_sca)
std::string VertexProgramDecompiler::GetSRC(const u32 n)
{
ensure(n < 3);
static const std::string reg_table[] =
{
"in_pos", "in_weight", "in_normal",
@ -152,6 +154,7 @@ std::string VertexProgramDecompiler::GetSRC(const u32 n)
switch (n)
{
default:
case 0: abs = d0.src0_abs; break;
case 1: abs = d0.src1_abs; break;
case 2: abs = d0.src2_abs; break;