summaryrefslogtreecommitdiffstats
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 2e7f9c5ed..295a416a8 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -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);
}