[video_core] readback for nce invalidations (#4490) optimization

This commit is contained in:
xbzk
2026-10-14 20:48:45 -03:00
parent e0d47f2790
commit 8d10c788c4
4 changed files with 25 additions and 3 deletions
+3 -3
View File
@@ -227,17 +227,17 @@ struct GPU::Impl {
/// Notify rasterizer that any caches of the specified region should be invalidated
void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) {
if (Settings::values.nce_invalidation_gpu_readback.GetValue()) {
if (preserve_gpu_writes) {
VideoCore::RasterizerInterface* rasterizer = renderer->ReadRasterizer();
if (preserve_gpu_writes && rasterizer->MustFlushRegion(addr, size, VideoCommon::CacheType::BufferCache)) {
if (!rasterizer->TryCacheInvalidation(addr, size)) {
const u64 fence = RequestSyncOperation([rasterizer, addr, size] {
rasterizer->FlushRegion(addr, size, VideoCommon::CacheType::BufferCache);
rasterizer->OnCacheInvalidation(addr, size);
});
gpu_thread.TickGPU(is_async);
WaitForSyncOperation(fence);
return;
}
return;
}
gpu_thread.InvalidateRegion(addr, size);
}