mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-12 08:18:58 -05:00
GPU: Add Reactive flushing
This commit is contained in:
@ -283,6 +283,21 @@ struct GPU::Impl {
|
||||
gpu_thread.FlushRegion(addr, size);
|
||||
}
|
||||
|
||||
VideoCore::RasterizerDownloadArea OnCPURead(VAddr addr, u64 size) {
|
||||
auto raster_area = rasterizer->GetFlushArea(addr, size);
|
||||
if (raster_area.preemtive) {
|
||||
return raster_area;
|
||||
}
|
||||
raster_area.preemtive = true;
|
||||
const u64 fence = RequestSyncOperation([this, &raster_area]() {
|
||||
rasterizer->FlushRegion(raster_area.start_address,
|
||||
raster_area.end_address - raster_area.start_address);
|
||||
});
|
||||
gpu_thread.TickGPU();
|
||||
WaitForSyncOperation(fence);
|
||||
return raster_area;
|
||||
}
|
||||
|
||||
/// Notify rasterizer that any caches of the specified region should be invalidated
|
||||
void InvalidateRegion(VAddr addr, u64 size) {
|
||||
gpu_thread.InvalidateRegion(addr, size);
|
||||
@ -538,6 +553,10 @@ void GPU::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
|
||||
impl->SwapBuffers(framebuffer);
|
||||
}
|
||||
|
||||
VideoCore::RasterizerDownloadArea GPU::OnCPURead(VAddr addr, u64 size) {
|
||||
return impl->OnCPURead(addr, size);
|
||||
}
|
||||
|
||||
void GPU::FlushRegion(VAddr addr, u64 size) {
|
||||
impl->FlushRegion(addr, size);
|
||||
}
|
||||
|
Reference in New Issue
Block a user