mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-12-25 06:20:06 +00:00
gl_shader_decompiler: Declare predicates on use.
- Used by Super Mario Odyssey (when going in game).
This commit is contained in:
parent
25ba4d1b68
commit
4283019aa0
@ -657,16 +657,17 @@ private:
|
||||
* @param instr Instruction to generate the if condition for.
|
||||
* @returns string containing the predicate condition.
|
||||
*/
|
||||
std::string GetPredicateCondition(u64 index, bool negate) const {
|
||||
std::string GetPredicateCondition(u64 index, bool negate) {
|
||||
using Tegra::Shader::Pred;
|
||||
std::string variable;
|
||||
|
||||
// Index 7 is used as an 'Always True' condition.
|
||||
if (index == static_cast<u64>(Pred::UnusedIndex))
|
||||
if (index == static_cast<u64>(Pred::UnusedIndex)) {
|
||||
variable = "true";
|
||||
else
|
||||
} else {
|
||||
variable = 'p' + std::to_string(index) + '_' + suffix;
|
||||
|
||||
declr_predicates.insert(variable);
|
||||
}
|
||||
if (negate) {
|
||||
return "!(" + variable + ')';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user