Compare commits

...
Sign in to create a new pull request.

5 commits

Author SHA1 Message Date
Gamer64
b6f7011c80 Simplify should_wait 2025-08-02 17:22:16 +02:00
Gamer64
e85288aebc fix weird conflicts that were caused from master 2025-08-02 17:20:50 +02:00
Gamer64
06dbbf8033 [fence_manager]: Try to simplify and improve early fence release 2025-08-02 16:03:40 +02:00
90cf049de9 revert a26ebf403b
Again, I believe this was intended to be a rebase but it ended up being a rebase and merge.
revert Merge branch 'master' of https://git.eden-emu.dev/eden-emu/eden
2025-08-02 16:03:40 +02:00
ff0fe6bf94 revert 25b023a3e3
Reverting this change as it was likely to rebase and was done incorrectly.

revert Merge branch 'master' of https://git.eden-emu.dev/eden-emu/eden
2025-08-02 16:03:40 +02:00

View file

@ -76,27 +76,16 @@ public:
void SignalFence(std::function<void()>&& func) { void SignalFence(std::function<void()>&& func) {
bool delay_fence = Settings::IsGPULevelHigh(); bool delay_fence = Settings::IsGPULevelHigh();
#ifdef __ANDROID__
if (!delay_fence && Settings::values.early_release_fences.GetValue()) {
TryReleasePendingFences<false>();
}
#else
if constexpr (!can_async_check) { if constexpr (!can_async_check) {
TryReleasePendingFences<false>(); TryReleasePendingFences<false>();
} }
#endif
const bool should_flush = ShouldFlush(); const bool should_flush = ShouldFlush();
CommitAsyncFlushes(); CommitAsyncFlushes();
TFence new_fence = CreateFence(!should_flush); TFence new_fence = CreateFence(!should_flush);
#ifdef __ANDROID__
if (delay_fence && Settings::values.early_release_fences.GetValue()) {
guard.lock();
}
#else
if constexpr (can_async_check) { if constexpr (can_async_check) {
guard.lock(); guard.lock();
} }
#endif
if (delay_fence) { if (delay_fence) {
uncommitted_operations.emplace_back(std::move(func)); uncommitted_operations.emplace_back(std::move(func));
} }
@ -109,17 +98,10 @@ public:
if (should_flush) { if (should_flush) {
rasterizer.FlushCommands(); rasterizer.FlushCommands();
} }
#ifdef __ANDROID__
if (delay_fence && Settings::values.early_release_fences.GetValue()) {
guard.unlock();
cv.notify_all();
}
#else
if constexpr (can_async_check) { if constexpr (can_async_check) {
guard.unlock(); guard.unlock();
cv.notify_all(); cv.notify_all();
} }
#endif
rasterizer.InvalidateGPUCache(); rasterizer.InvalidateGPUCache();
} }
@ -193,10 +175,17 @@ private:
void TryReleasePendingFences() { void TryReleasePendingFences() {
while (!fences.empty()) { while (!fences.empty()) {
TFence& current_fence = fences.front(); TFence& current_fence = fences.front();
#ifdef __ANDROID__
const bool allow_early_release = Settings::values.early_release_fences.GetValue();
#else
const bool allow_early_release = false;
#endif
if (ShouldWait() && !IsFenceSignaled(current_fence)) { if (ShouldWait() && !IsFenceSignaled(current_fence)) {
if constexpr (force_wait) { if constexpr (force_wait) {
WaitFence(current_fence); WaitFence(current_fence);
} else { } else if (!allow_early_release) {
return; return;
} }
} }