forked from eden-emu/eden
Revert forced warp shuffle to fix some games (#385)
Metroid Prime Remastered, Prince of Persia The Lost Crown, and maybe some others. A few testers and I couldn't find any game that this broke, but it fixed these two above and they said they got fewer artifacts from a few others. Reviewed-on: eden-emu/eden#385 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: Calchan <denis.dupeyron@gmail.com> Co-committed-by: Calchan <denis.dupeyron@gmail.com>
This commit is contained in:
parent
2d0693f86b
commit
dad58c7c56
1 changed files with 1 additions and 16 deletions
|
@ -7,7 +7,6 @@
|
||||||
#include "common/bit_field.h"
|
#include "common/bit_field.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
|
#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
|
||||||
#include <fstream>
|
|
||||||
|
|
||||||
namespace Shader::Maxwell {
|
namespace Shader::Maxwell {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -37,17 +36,6 @@ enum class ShuffleMode : u64 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsKONA() {
|
|
||||||
std::ifstream machineFile("/sys/devices/soc0/machine");
|
|
||||||
if (machineFile.is_open()) {
|
|
||||||
std::string line;
|
|
||||||
std::getline(machineFile, line);
|
|
||||||
if (line == "KONA")
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Shuffle(TranslatorVisitor& v, u64 insn, const IR::U32& index, const IR::U32& mask) {
|
void Shuffle(TranslatorVisitor& v, u64 insn, const IR::U32& index, const IR::U32& mask) {
|
||||||
union {
|
union {
|
||||||
u64 insn;
|
u64 insn;
|
||||||
|
@ -59,10 +47,7 @@ void Shuffle(TranslatorVisitor& v, u64 insn, const IR::U32& index, const IR::U32
|
||||||
|
|
||||||
const IR::U32 result{ShuffleOperation(v.ir, v.X(shfl.src_reg), index, mask, shfl.mode)};
|
const IR::U32 result{ShuffleOperation(v.ir, v.X(shfl.src_reg), index, mask, shfl.mode)};
|
||||||
v.ir.SetPred(shfl.pred, v.ir.GetInBoundsFromOp(result));
|
v.ir.SetPred(shfl.pred, v.ir.GetInBoundsFromOp(result));
|
||||||
if (IsKONA())
|
v.X(shfl.dest_reg, result);
|
||||||
v.X(shfl.dest_reg, v.ir.Imm32(0xffffffff)); // This fixes the freeze for Retroid / Snapdragon SD865
|
|
||||||
else
|
|
||||||
v.X(shfl.dest_reg, result);
|
|
||||||
}
|
}
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue