early-access version 1863

main
pineappleEA 2021-07-09 02:33:25 +02:00
parent 4967de61a1
commit e0163eb4d0
8 changed files with 22 additions and 47 deletions

View File

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

View File

@ -9,6 +9,9 @@
namespace Common {
/// General purpose function wrapper similar to std::function.
/// Unlike std::function, the captured values don't have to be copyable.
/// This class can be moved but not copied.
template <typename ResultType, typename... Args>
class UniqueFunction {
class CallableBase {

View File

@ -103,23 +103,6 @@ public:
}
}
void TryReleasePendingFences() {
while (!fences.empty()) {
TFence& current_fence = fences.front();
if (ShouldWait() && !IsFenceSignaled(current_fence)) {
return;
}
PopAsyncFlushes();
if (current_fence->IsSemaphore()) {
gpu_memory.template Write<u32>(current_fence->GetAddress(),
current_fence->GetPayload());
} else {
gpu.IncrementSyncPoint(current_fence->GetPayload());
}
PopFence();
}
}
protected:
explicit FenceManager(VideoCore::RasterizerInterface& rasterizer_, Tegra::GPU& gpu_,
TTextureCache& texture_cache_, TTBufferCache& buffer_cache_,
@ -149,6 +132,23 @@ protected:
TQueryCache& query_cache;
private:
void TryReleasePendingFences() {
while (!fences.empty()) {
TFence& current_fence = fences.front();
if (ShouldWait() && !IsFenceSignaled(current_fence)) {
return;
}
PopAsyncFlushes();
if (current_fence->IsSemaphore()) {
gpu_memory.template Write<u32>(current_fence->GetAddress(),
current_fence->GetPayload());
} else {
gpu.IncrementSyncPoint(current_fence->GetPayload());
}
PopFence();
}
}
bool ShouldWait() const {
std::scoped_lock lock{buffer_cache.mutex, texture_cache.mutex};
return texture_cache.ShouldWaitAsyncFlushes() || buffer_cache.ShouldWaitAsyncFlushes() ||

View File

@ -8,7 +8,6 @@
#include "common/settings.h"
#include "common/thread.h"
#include "core/core.h"
#include "core/core_timing.h"
#include "core/frontend/emu_window.h"
#include "video_core/dma_pusher.h"
#include "video_core/gpu.h"
@ -84,17 +83,6 @@ void ThreadManager::StartThread(VideoCore::RendererBase& renderer,
rasterizer = renderer.ReadRasterizer();
thread = std::thread(RunThread, std::ref(system), std::ref(renderer), std::ref(context),
std::ref(dma_pusher), std::ref(state));
gpu_sync_event = Core::Timing::CreateEvent(
"GPUHostSyncCallback", [this](std::uintptr_t, std::chrono::nanoseconds) {
if (!state.is_running) {
return;
}
OnCommandListEnd();
const auto time_interval = std::chrono::nanoseconds{500 * 1000};
system.CoreTiming().ScheduleEvent(time_interval, gpu_sync_event);
});
system.CoreTiming().ScheduleEvent(std::chrono::nanoseconds{500 * 1000}, gpu_sync_event);
}
void ThreadManager::SubmitList(Tegra::CommandList&& entries) {
@ -140,9 +128,6 @@ void ThreadManager::ShutDown() {
state.cv.notify_all();
}
system.CoreTiming().UnscheduleEvent(gpu_sync_event, 0);
system.CoreTiming().RemoveEvent(gpu_sync_event);
if (!thread.joinable()) {
return;
}

View File

@ -20,10 +20,6 @@ class DmaPusher;
} // namespace Tegra
namespace Core {
namespace Timing {
class CoreTiming;
struct EventType;
} // namespace Timing
namespace Frontend {
class GraphicsContext;
}
@ -154,7 +150,6 @@ private:
SynchState state;
std::thread thread;
std::shared_ptr<Core::Timing::EventType> gpu_sync_event;
};
} // namespace VideoCommon::GPUThread

View File

@ -34,10 +34,6 @@ bool InnerFence::IsSignaled() const {
if (is_stubbed) {
return true;
}
if (scheduler.IsFree(wait_tick)) {
return true;
}
scheduler.Refresh();
return scheduler.IsFree(wait_tick);
}

View File

@ -611,7 +611,7 @@ void RasterizerVulkan::ReleaseFences() {
if (!gpu.IsAsync()) {
return;
}
fence_manager.TryReleasePendingFences();
fence_manager.WaitPendingFences();
}
void RasterizerVulkan::FlushAndInvalidateRegion(VAddr addr, u64 size) {

View File

@ -83,10 +83,6 @@ public:
return master_semaphore->IsFree(tick);
}
void Refresh() const noexcept {
return master_semaphore->Refresh();
}
/// Waits for the given tick to trigger on the GPU.
void Wait(u64 tick) {
master_semaphore->Wait(tick);