diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/warp_shuffle.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/warp_shuffle.cpp index b904821619..ef31feedce 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/warp_shuffle.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/warp_shuffle.cpp @@ -37,18 +37,18 @@ 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) { + // Static initializer ran once -- see Apple rosetta code in Dynarmic for backref + static bool is_kona = []{ + std::ifstream machineFile("/sys/devices/soc0/machine"); + if (machineFile.is_open()) { + std::string line{}; + std::getline(machineFile, line); + return line == "KONA"; + } + return false; + }(); + union { u64 insn; BitField<0, 8, IR::Reg> dest_reg; @@ -59,7 +59,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)}; v.ir.SetPred(shfl.pred, v.ir.GetInBoundsFromOp(result)); - if (IsKONA()) + if (is_kona) v.X(shfl.dest_reg, v.ir.Imm32(0xffffffff)); // This fixes the freeze for Retroid / Snapdragon SD865 else v.X(shfl.dest_reg, result); diff --git a/src/video_core/host1x/host1x.cpp b/src/video_core/host1x/host1x.cpp index 652d387031..29059aeeda 100644 --- a/src/video_core/host1x/host1x.cpp +++ b/src/video_core/host1x/host1x.cpp @@ -21,11 +21,11 @@ Host1x::~Host1x() = default; void Host1x::StartDevice(s32 fd, ChannelType type, u32 syncpt) { switch (type) { case ChannelType::NvDec: - std::call_once(nvdec_first_init, []() {std::this_thread::sleep_for(std::chrono::milliseconds{500});}); // HACK: For Astroneer + //std::call_once(nvdec_first_init, []() {std::this_thread::sleep_for(std::chrono::milliseconds{500});}); // HACK: For Astroneer devices[fd] = std::make_unique(*this, fd, syncpt, frame_queue); break; case ChannelType::VIC: - std::call_once(vic_first_init, []() {std::this_thread::sleep_for(std::chrono::milliseconds{500});}); // HACK: For Astroneer + //std::call_once(vic_first_init, []() {std::this_thread::sleep_for(std::chrono::milliseconds{500});}); // HACK: For Astroneer devices[fd] = std::make_unique(*this, fd, syncpt, frame_queue); break; default: diff --git a/src/video_core/host1x/host1x.h b/src/video_core/host1x/host1x.h index 5ecffa442c..0baec44b9c 100644 --- a/src/video_core/host1x/host1x.h +++ b/src/video_core/host1x/host1x.h @@ -197,15 +197,15 @@ public: } private: - Core::System& system; SyncpointManager syncpoint_manager; Tegra::MaxwellDeviceMemoryManager memory_manager; Tegra::MemoryManager gmmu_manager; - std::unique_ptr> allocator; FrameQueue frame_queue; - std::unordered_map> devices; - std::once_flag nvdec_first_init; - std::once_flag vic_first_init; + std::unordered_map> devices; //+12 + std::unique_ptr> allocator; //8 + Core::System& system; //8 + // std::once_flag nvdec_first_init; + // std::once_flag vic_first_init; }; } // namespace Tegra::Host1x