summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp28
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h2
2 files changed, 30 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 988eaeaa5..93bb33e8c 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -676,6 +676,34 @@ void RasterizerOpenGL::SyncGuestHost() {
buffer_cache.SyncGuestHost();
}
+void RasterizerOpenGL::SignalFence(GPUVAddr addr, u32 value) {
+ if (!fences.empty()) {
+ const std::pair<GPUVAddr, u32>& current_fence = fences.front();
+ const auto [address, payload] = current_fence;
+ texture_cache.PopAsyncFlushes();
+ auto& gpu{system.GPU()};
+ auto& memory_manager{gpu.MemoryManager()};
+ memory_manager.Write<u32>(address, payload);
+ fences.pop_front();
+ }
+ fences.emplace_back(addr, value);
+ texture_cache.CommitAsyncFlushes();
+ FlushCommands();
+ SyncGuestHost();
+}
+
+void RasterizerOpenGL::ReleaseFences() {
+ while (!fences.empty()) {
+ const std::pair<GPUVAddr, u32>& current_fence = fences.front();
+ const auto [address, payload] = current_fence;
+ texture_cache.PopAsyncFlushes();
+ auto& gpu{system.GPU()};
+ auto& memory_manager{gpu.MemoryManager()};
+ memory_manager.Write<u32>(address, payload);
+ fences.pop_front();
+ }
+}
+
void RasterizerOpenGL::FlushAndInvalidateRegion(VAddr addr, u64 size) {
if (Settings::IsGPULevelExtreme()) {
FlushRegion(addr, size);
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index a870024c6..486a154ad 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -69,6 +69,8 @@ public:
void InvalidateRegion(VAddr addr, u64 size) override;
void OnCPUWrite(VAddr addr, u64 size) override;
void SyncGuestHost() override;
+ void SignalFence(GPUVAddr addr, u32 value) override;
+ void ReleaseFences() override;
void FlushAndInvalidateRegion(VAddr addr, u64 size) override;
void FlushCommands() override;
void TickFrame() override;