2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #3978 from ReinUsesLisp/write-rz

shader_decompiler: Visit source nodes even when they assign to RZ
This commit is contained in:
bunnei 2020-05-25 21:31:33 -04:00 committed by GitHub
commit 86345c126a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -1538,7 +1538,9 @@ private:
Expression target; Expression target;
if (const auto gpr = std::get_if<GprNode>(&*dest)) { if (const auto gpr = std::get_if<GprNode>(&*dest)) {
if (gpr->GetIndex() == Register::ZeroIndex) { if (gpr->GetIndex() == Register::ZeroIndex) {
// Writing to Register::ZeroIndex is a no op // Writing to Register::ZeroIndex is a no op but we still have to visit the source
// as it might have side effects.
code.AddLine("{};", Visit(src).GetCode());
return {}; return {};
} }
target = {GetRegister(gpr->GetIndex()), Type::Float}; target = {GetRegister(gpr->GetIndex()), Type::Float};

View file

@ -1081,8 +1081,7 @@ private:
void VisitBasicBlock(const NodeBlock& bb) { void VisitBasicBlock(const NodeBlock& bb) {
for (const auto& node : bb) { for (const auto& node : bb) {
[[maybe_unused]] const Type type = Visit(node).type; Visit(node);
ASSERT(type == Type::Void);
} }
} }
@ -1372,7 +1371,9 @@ private:
Expression target{}; Expression target{};
if (const auto gpr = std::get_if<GprNode>(&*dest)) { if (const auto gpr = std::get_if<GprNode>(&*dest)) {
if (gpr->GetIndex() == Register::ZeroIndex) { if (gpr->GetIndex() == Register::ZeroIndex) {
// Writing to Register::ZeroIndex is a no op // Writing to Register::ZeroIndex is a no op but we still have to visit its source
// because it might have side effects.
Visit(src);
return {}; return {};
} }
target = {registers.at(gpr->GetIndex()), Type::Float}; target = {registers.at(gpr->GetIndex()), Type::Float};