mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-29 10:46:21 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ec16a6142e |
+1
-1
@@ -757,7 +757,7 @@ struct Memory::Impl {
|
|||||||
};
|
};
|
||||||
auto& gpu = system.GPU();
|
auto& gpu = system.GPU();
|
||||||
gpu_device_memory->ApplyOpOnPointer(
|
gpu_device_memory->ApplyOpOnPointer(
|
||||||
p, scratch_buffers[core], [&](DAddr address) { gpu.InvalidateRegion(address, size, true); });
|
p, scratch_buffers[core], [&](DAddr address) { gpu.InvalidateRegion(address, size); });
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::System& system;
|
Core::System& system;
|
||||||
|
|||||||
+3
-15
@@ -226,19 +226,7 @@ struct GPU::Impl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Notify rasterizer that any caches of the specified region should be invalidated
|
/// Notify rasterizer that any caches of the specified region should be invalidated
|
||||||
void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) {
|
void InvalidateRegion(DAddr addr, u64 size) {
|
||||||
if (preserve_gpu_writes) {
|
|
||||||
VideoCore::RasterizerInterface* rasterizer = renderer->ReadRasterizer();
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
gpu_thread.InvalidateRegion(addr, size);
|
gpu_thread.InvalidateRegion(addr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -530,8 +518,8 @@ void GPU::FlushRegion(DAddr addr, u64 size) {
|
|||||||
impl->FlushRegion(addr, size);
|
impl->FlushRegion(addr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU::InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) {
|
void GPU::InvalidateRegion(DAddr addr, u64 size) {
|
||||||
impl->InvalidateRegion(addr, size, preserve_gpu_writes);
|
impl->InvalidateRegion(addr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GPU::OnCPUWrite(DAddr addr, u64 size) {
|
bool GPU::OnCPUWrite(DAddr addr, u64 size) {
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ public:
|
|||||||
void FlushRegion(DAddr addr, u64 size);
|
void FlushRegion(DAddr addr, u64 size);
|
||||||
|
|
||||||
/// Notify rasterizer that any caches of the specified region should be invalidated
|
/// Notify rasterizer that any caches of the specified region should be invalidated
|
||||||
void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes = false);
|
void InvalidateRegion(DAddr addr, u64 size);
|
||||||
|
|
||||||
/// Notify rasterizer that CPU is trying to write this area. It returns true if the area is
|
/// Notify rasterizer that CPU is trying to write this area. It returns true if the area is
|
||||||
/// sensible, false otherwise, addr and size must be a valid combination
|
/// sensible, false otherwise, addr and size must be a valid combination
|
||||||
|
|||||||
@@ -114,12 +114,6 @@ public:
|
|||||||
/// Notify rasterizer that any caches of the specified region are desync with guest
|
/// Notify rasterizer that any caches of the specified region are desync with guest
|
||||||
virtual void OnCacheInvalidation(PAddr addr, u64 size) = 0;
|
virtual void OnCacheInvalidation(PAddr addr, u64 size) = 0;
|
||||||
|
|
||||||
virtual bool TryCacheInvalidation(DAddr addr, u64 size) {
|
|
||||||
if (MustFlushRegion(addr, size, VideoCommon::CacheType::BufferCache)) return false;
|
|
||||||
OnCacheInvalidation(addr, size);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool OnCPUWrite(PAddr addr, u64 size) = 0;
|
virtual bool OnCPUWrite(PAddr addr, u64 size) = 0;
|
||||||
|
|
||||||
/// Sync memory between guest and host.
|
/// Sync memory between guest and host.
|
||||||
|
|||||||
@@ -798,18 +798,6 @@ void RasterizerVulkan::OnCacheInvalidation(DAddr addr, u64 size) {
|
|||||||
pipeline_cache.InvalidateRegion(addr, size);
|
pipeline_cache.InvalidateRegion(addr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RasterizerVulkan::TryCacheInvalidation(DAddr addr, u64 size) {
|
|
||||||
if (addr == 0 || size == 0) return true;
|
|
||||||
{
|
|
||||||
std::scoped_lock lock{buffer_cache.mutex, texture_cache.mutex};
|
|
||||||
if (buffer_cache.IsRegionGpuModified(addr, size)) return false;
|
|
||||||
texture_cache.WriteMemory(addr, size);
|
|
||||||
buffer_cache.WriteMemory(addr, size);
|
|
||||||
}
|
|
||||||
pipeline_cache.InvalidateRegion(addr, size);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RasterizerVulkan::InvalidateGPUCache() {
|
void RasterizerVulkan::InvalidateGPUCache() {
|
||||||
gpu.InvalidateGPUCache();
|
gpu.InvalidateGPUCache();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ public:
|
|||||||
VideoCommon::CacheType which = VideoCommon::CacheType::All) override;
|
VideoCommon::CacheType which = VideoCommon::CacheType::All) override;
|
||||||
void InnerInvalidation(std::span<const std::pair<DAddr, std::size_t>> sequences) override;
|
void InnerInvalidation(std::span<const std::pair<DAddr, std::size_t>> sequences) override;
|
||||||
void OnCacheInvalidation(DAddr addr, u64 size) override;
|
void OnCacheInvalidation(DAddr addr, u64 size) override;
|
||||||
bool TryCacheInvalidation(DAddr addr, u64 size) override;
|
|
||||||
bool OnCPUWrite(DAddr addr, u64 size) override;
|
bool OnCPUWrite(DAddr addr, u64 size) override;
|
||||||
void InvalidateGPUCache() override;
|
void InvalidateGPUCache() override;
|
||||||
void UnmapMemory(DAddr addr, u64 size) override;
|
void UnmapMemory(DAddr addr, u64 size) override;
|
||||||
|
|||||||
Reference in New Issue
Block a user