OpenGL: Implement Fencing backend.
This commit is contained in:
parent
ed7e965712
commit
487379c593
12 changed files with 94 additions and 19 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue