GPU: Add Reactive flushing
This commit is contained in:
parent
36a670a4c9
commit
6bc60f78d9
24 changed files with 240 additions and 30 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue