gpu: Rewrite virtual memory manager using PageTable.

This commit is contained in:
bunnei 2019-03-03 23:54:16 -05:00
parent 241563d15c
commit 22d3dfbcd4
13 changed files with 497 additions and 228 deletions

View file

@ -76,8 +76,8 @@ GlobalRegion GlobalRegionCacheOpenGL::GetGlobalRegion(
const auto cbufs{gpu.Maxwell3D().state.shader_stages[static_cast<u64>(stage)]};
const auto addr{cbufs.const_buffers[global_region.GetCbufIndex()].address +
global_region.GetCbufOffset()};
const auto actual_addr{memory_manager.Read64(addr)};
const auto size{memory_manager.Read32(addr + 8)};
const auto actual_addr{memory_manager.Read<u64>(addr)};
const auto size{memory_manager.Read<u32>(addr + 8)};
// Look up global region in the cache based on address
const auto& host_ptr{memory_manager.GetPointer(actual_addr)};

View file

@ -610,11 +610,11 @@ CachedSurface::CachedSurface(const SurfaceParams& params)
// check is necessary to prevent flushing from overwriting unmapped memory.
auto& memory_manager{Core::System::GetInstance().GPU().MemoryManager()};
const u64 max_size{memory_manager.GetRegionEnd(params.gpu_addr) - params.gpu_addr};
if (cached_size_in_bytes > max_size) {
LOG_ERROR(HW_GPU, "Surface size {} exceeds region size {}", params.size_in_bytes, max_size);
cached_size_in_bytes = max_size;
}
// const u64 max_size{memory_manager.GetRegionEnd(params.gpu_addr) - params.gpu_addr};
// if (cached_size_in_bytes > max_size) {
// LOG_ERROR(HW_GPU, "Surface size {} exceeds region size {}", params.size_in_bytes,
// max_size); cached_size_in_bytes = max_size;
//}
cpu_addr = *memory_manager.GpuToCpuAddress(params.gpu_addr);
}