early-access version 2171

This commit is contained in:
pineappleEA 2021-10-30 19:48:09 +02:00
parent e34822682f
commit f074a64a76
3 changed files with 13 additions and 12 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 2170. This is the source code for early-access 2171.
## Legal Notice ## Legal Notice

View File

@ -92,7 +92,7 @@ NvResult nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector
if (syncpoint_manager.IsSyncpointExpired(params.syncpt_id, params.threshold)) { if (syncpoint_manager.IsSyncpointExpired(params.syncpt_id, params.threshold)) {
params.value = syncpoint_manager.GetSyncpointMin(params.syncpt_id); params.value = syncpoint_manager.GetSyncpointMin(params.syncpt_id);
std::memcpy(output.data(), &params, sizeof(params)); std::memcpy(output.data(), &params, sizeof(params));
events_interface.failed[event_id] = false; events_interface.fails[event_id] = 0;
return NvResult::Success; return NvResult::Success;
} }
@ -100,25 +100,26 @@ NvResult nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector
syncpoint_manager.IsSyncpointExpired(params.syncpt_id, params.threshold)) { syncpoint_manager.IsSyncpointExpired(params.syncpt_id, params.threshold)) {
params.value = new_value; params.value = new_value;
std::memcpy(output.data(), &params, sizeof(params)); std::memcpy(output.data(), &params, sizeof(params));
events_interface.failed[event_id] = false; events_interface.fails[event_id] = 0;
return NvResult::Success; return NvResult::Success;
} }
auto& event = events_interface.events[event_id];
auto& gpu = system.GPU(); auto& gpu = system.GPU();
const u32 current_syncpoint_value = event.fence.value; const u32 target_value = syncpoint_manager.GetSyncpointMax(params.syncpt_id);
const s32 diff = current_syncpoint_value - params.threshold;
const u32 target_value = params.value;
if (!is_async) { if (!is_async) {
params.value = 0; params.value = 0;
} }
const auto check_failing = [&]() { const auto check_failing = [&]() {
if (events_interface.failed[event_id]) { if (events_interface.fails[event_id] > 1) {
gpu.WaitFence(params.syncpt_id, target_value); {
auto lk = system.StallCPU();
gpu.WaitFence(params.syncpt_id, target_value);
system.UnstallCPU();
}
std::memcpy(output.data(), &params, sizeof(params)); std::memcpy(output.data(), &params, sizeof(params));
events_interface.failed[event_id] = false; events_interface.fails[event_id] = 0;
return true; return true;
} }
return false; return false;
@ -204,7 +205,7 @@ NvResult nvhost_ctrl::IocCtrlClearEventWait(const std::vector<u8>& input, std::v
if (events_interface.status[event_id] == EventState::Waiting) { if (events_interface.status[event_id] == EventState::Waiting) {
events_interface.LiberateEvent(event_id); events_interface.LiberateEvent(event_id);
} }
events_interface.failed[event_id] = true; events_interface.fails[event_id]++;
syncpoint_manager.RefreshSyncpoint(events_interface.events[event_id].fence.id); syncpoint_manager.RefreshSyncpoint(events_interface.events[event_id].fence.id);

View File

@ -50,7 +50,7 @@ struct EventInterface {
// Tells if an NVEvent is registered or not // Tells if an NVEvent is registered or not
std::array<bool, MaxNvEvents> registered{}; std::array<bool, MaxNvEvents> registered{};
// Tells the NVEvent that it has failed. // Tells the NVEvent that it has failed.
std::array<bool, MaxNvEvents> failed{}; std::array<u32, MaxNvEvents> fails{};
// When an NVEvent is waiting on GPU interrupt, this is the sync_point // When an NVEvent is waiting on GPU interrupt, this is the sync_point
// associated with it. // associated with it.
std::array<u32, MaxNvEvents> assigned_syncpt{}; std::array<u32, MaxNvEvents> assigned_syncpt{};