Merge pull request #2983 from lioncash/fallthrough

gl_shader_decompiler/vk_shader_decompiler: Resolve implicit fallthrough cases
master
Fernando Sahmkow 2019-10-22 13:16:46 +07:00 committed by GitHub
commit 7ecf9f7228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

@ -2314,10 +2314,13 @@ public:
switch (index) { switch (index) {
case Tegra::Shader::Pred::NeverExecute: case Tegra::Shader::Pred::NeverExecute:
target = "false"; target = "false";
break;
case Tegra::Shader::Pred::UnusedIndex: case Tegra::Shader::Pred::UnusedIndex:
target = "true"; target = "true";
break;
default: default:
target = decomp.GetPredicate(index); target = decomp.GetPredicate(index);
break;
} }
} else if (const auto flag = std::get_if<InternalFlagNode>(&*cc)) { } else if (const auto flag = std::get_if<InternalFlagNode>(&*cc)) {
target = decomp.GetInternalFlag(flag->GetFlag()); target = decomp.GetInternalFlag(flag->GetFlag());

@ -1682,10 +1682,13 @@ public:
switch (index) { switch (index) {
case Tegra::Shader::Pred::NeverExecute: case Tegra::Shader::Pred::NeverExecute:
target = decomp.v_false; target = decomp.v_false;
break;
case Tegra::Shader::Pred::UnusedIndex: case Tegra::Shader::Pred::UnusedIndex:
target = decomp.v_true; target = decomp.v_true;
break;
default: default:
target = decomp.predicates.at(index); target = decomp.predicates.at(index);
break;
} }
} else if (const auto flag = std::get_if<InternalFlagNode>(&*cc)) { } else if (const auto flag = std::get_if<InternalFlagNode>(&*cc)) {
target = decomp.internal_flags.at(static_cast<u32>(flag->GetFlag())); target = decomp.internal_flags.at(static_cast<u32>(flag->GetFlag()));