early-access version 2174

This commit is contained in:
pineappleEA
2021-11-01 05:47:44 +01:00
parent b37854dccc
commit 03951516e2
23 changed files with 11363 additions and 5251 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
yuzu emulator early access
=============
This is the source code for early-access 2173.
This is the source code for early-access 2174.
## Legal Notice
+218 -208
View File
File diff suppressed because it is too large Load Diff
+257 -247
View File
File diff suppressed because it is too large Load Diff
Vendored Executable
+5821
View File
File diff suppressed because it is too large Load Diff
+218 -208
View File
File diff suppressed because it is too large Load Diff
+401 -375
View File
File diff suppressed because it is too large Load Diff
+367 -348
View File
File diff suppressed because it is too large Load Diff
+223 -213
View File
File diff suppressed because it is too large Load Diff
+514 -494
View File
File diff suppressed because it is too large Load Diff
+380 -358
View File
File diff suppressed because it is too large Load Diff
+218 -208
View File
File diff suppressed because it is too large Load Diff
+221 -211
View File
File diff suppressed because it is too large Load Diff
+231 -221
View File
File diff suppressed because it is too large Load Diff
+325 -306
View File
File diff suppressed because it is too large Load Diff
+218 -208
View File
File diff suppressed because it is too large Load Diff
+424 -393
View File
File diff suppressed because it is too large Load Diff
+218 -208
View File
File diff suppressed because it is too large Load Diff
+514 -481
View File
File diff suppressed because it is too large Load Diff
+229 -219
View File
File diff suppressed because it is too large Load Diff
+332 -320
View File
File diff suppressed because it is too large Load Diff
@@ -98,7 +98,7 @@ NvResult nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector
if (syncpoint_manager.IsSyncpointExpired(params.syncpt_id, params.threshold)) {
params.value = syncpoint_manager.GetSyncpointMin(params.syncpt_id);
std::memcpy(output.data(), &params, sizeof(params));
events_interface.fails[event_id] = 0;
events_interface.failed[event_id] = false;
return NvResult::Success;
}
@@ -106,35 +106,36 @@ NvResult nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector
syncpoint_manager.IsSyncpointExpired(params.syncpt_id, params.threshold)) {
params.value = new_value;
std::memcpy(output.data(), &params, sizeof(params));
events_interface.fails[event_id] = 0;
events_interface.failed[event_id] = false;
return NvResult::Success;
}
auto& event = events_interface.events[event_id];
auto& gpu = system.GPU();
const u32 target_value = syncpoint_manager.GetSyncpointMax(params.syncpt_id);
// This is mostly to take into account unimplemented features. As synced
// gpu is always synced.
if (!gpu.IsAsync()) {
event.event->GetWritableEvent().Signal();
return NvResult::Success;
}
const u32 current_syncpoint_value = event.fence.value;
const s32 diff = current_syncpoint_value - params.threshold;
if (diff >= 0) {
event.event->GetWritableEvent().Signal();
params.value = current_syncpoint_value;
std::memcpy(output.data(), &params, sizeof(params));
events_interface.failed[event_id] = false;
return NvResult::Success;
}
const u32 target_value = current_syncpoint_value - diff;
if (!is_async) {
params.value = 0;
}
const auto check_failing = [&]() {
if (events_interface.fails[event_id] > 1) {
{
auto lk = system.StallCPU();
gpu.WaitFence(params.syncpt_id, target_value);
system.UnstallCPU();
}
std::memcpy(output.data(), &params, sizeof(params));
events_interface.fails[event_id] = 0;
return true;
}
return false;
};
if (params.timeout == 0) {
if (check_failing()) {
return NvResult::Success;
}
std::memcpy(output.data(), &params, sizeof(params));
return NvResult::Timeout;
}
@@ -153,7 +154,15 @@ NvResult nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector
params.value = ((params.syncpt_id & 0xfff) << 16) | 0x10000000;
}
params.value |= event_id;
if (check_failing()) {
event.event->GetWritableEvent().Clear();
if (events_interface.failed[event_id]) {
{
auto lk = system.StallCPU();
gpu.WaitFence(params.syncpt_id, target_value);
system.UnstallCPU();
}
std::memcpy(output.data(), &params, sizeof(params));
events_interface.failed[event_id] = false;
return NvResult::Success;
}
gpu.RegisterSyncptInterrupt(params.syncpt_id, target_value);
@@ -211,7 +220,7 @@ NvResult nvhost_ctrl::IocCtrlClearEventWait(const std::vector<u8>& input, std::v
if (events_interface.status[event_id] == EventState::Waiting) {
events_interface.LiberateEvent(event_id);
}
events_interface.fails[event_id]++;
events_interface.failed[event_id] = true;
syncpoint_manager.RefreshSyncpoint(events_interface.events[event_id].fence.id);
+1 -1
View File
@@ -50,7 +50,7 @@ struct EventInterface {
// Tells if an NVEvent is registered or not
std::array<bool, MaxNvEvents> registered{};
// Tells the NVEvent that it has failed.
std::array<u32, MaxNvEvents> fails{};
std::array<bool, MaxNvEvents> failed{};
// When an NVEvent is waiting on GPU interrupt, this is the sync_point
// associated with it.
std::array<u32, MaxNvEvents> assigned_syncpt{};
+1 -1
View File
@@ -182,7 +182,7 @@ public:
/// Add phi operand to a phi instruction.
void AddPhiOperand(Block* predecessor, const Value& value);
/// Orders the Phi arguments.
/// Orders the Phi arguments from farthest away to nearest.
void OrderPhiArgs();
void Invalidate();