diff options
| author | 2019-03-22 18:41:12 -0400 | |
|---|---|---|
| committer | 2019-03-22 18:41:12 -0400 | |
| commit | e5893db3e618fd276733a24eebc0606c5fd1e7f2 (patch) | |
| tree | 5a3ae98bb04d3fb3f513a51504b63940e70c5130 /src/video_core/engines | |
| parent | Merge pull request #2277 from bunnei/fix-smo-transitions (diff) | |
| parent | memory_manager: Cleanup FindFreeRegion. (diff) | |
| download | yuzu-e5893db3e618fd276733a24eebc0606c5fd1e7f2.tar.gz yuzu-e5893db3e618fd276733a24eebc0606c5fd1e7f2.tar.xz yuzu-e5893db3e618fd276733a24eebc0606c5fd1e7f2.zip | |
Merge pull request #2256 from bunnei/gpu-vmm
gpu: Rewrite MemoryManager based on the VMManager implementation.
Diffstat (limited to 'src/video_core/engines')
| -rw-r--r-- | src/video_core/engines/kepler_memory.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_dma.cpp | 10 |
3 files changed, 15 insertions, 5 deletions
diff --git a/src/video_core/engines/kepler_memory.cpp b/src/video_core/engines/kepler_memory.cpp index 0931b9626..e259bf46b 100644 --- a/src/video_core/engines/kepler_memory.cpp +++ b/src/video_core/engines/kepler_memory.cpp | |||
| @@ -46,7 +46,7 @@ void KeplerMemory::ProcessData(u32 data) { | |||
| 46 | // contain a dirty surface that will have to be written back to memory. | 46 | // contain a dirty surface that will have to be written back to memory. |
| 47 | const GPUVAddr address{regs.dest.Address() + state.write_offset * sizeof(u32)}; | 47 | const GPUVAddr address{regs.dest.Address() + state.write_offset * sizeof(u32)}; |
| 48 | rasterizer.InvalidateRegion(ToCacheAddr(memory_manager.GetPointer(address)), sizeof(u32)); | 48 | rasterizer.InvalidateRegion(ToCacheAddr(memory_manager.GetPointer(address)), sizeof(u32)); |
| 49 | memory_manager.Write32(address, data); | 49 | memory_manager.Write<u32>(address, data); |
| 50 | 50 | ||
| 51 | system.GPU().Maxwell3D().dirty_flags.OnMemoryWrite(); | 51 | system.GPU().Maxwell3D().dirty_flags.OnMemoryWrite(); |
| 52 | 52 | ||
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index c5d5be4ef..defcfbd3f 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -307,7 +307,7 @@ void Maxwell3D::ProcessQueryGet() { | |||
| 307 | // Write the current query sequence to the sequence address. | 307 | // Write the current query sequence to the sequence address. |
| 308 | // TODO(Subv): Find out what happens if you use a long query type but mark it as a short | 308 | // TODO(Subv): Find out what happens if you use a long query type but mark it as a short |
| 309 | // query. | 309 | // query. |
| 310 | memory_manager.Write32(sequence_address, sequence); | 310 | memory_manager.Write<u32>(sequence_address, sequence); |
| 311 | } else { | 311 | } else { |
| 312 | // Write the 128-bit result structure in long mode. Note: We emulate an infinitely fast | 312 | // Write the 128-bit result structure in long mode. Note: We emulate an infinitely fast |
| 313 | // GPU, this command may actually take a while to complete in real hardware due to GPU | 313 | // GPU, this command may actually take a while to complete in real hardware due to GPU |
| @@ -395,7 +395,7 @@ void Maxwell3D::ProcessCBData(u32 value) { | |||
| 395 | 395 | ||
| 396 | u8* ptr{memory_manager.GetPointer(address)}; | 396 | u8* ptr{memory_manager.GetPointer(address)}; |
| 397 | rasterizer.InvalidateRegion(ToCacheAddr(ptr), sizeof(u32)); | 397 | rasterizer.InvalidateRegion(ToCacheAddr(ptr), sizeof(u32)); |
| 398 | memory_manager.Write32(address, value); | 398 | memory_manager.Write<u32>(address, value); |
| 399 | 399 | ||
| 400 | dirty_flags.OnMemoryWrite(); | 400 | dirty_flags.OnMemoryWrite(); |
| 401 | 401 | ||
| @@ -447,7 +447,7 @@ std::vector<Texture::FullTextureInfo> Maxwell3D::GetStageTextures(Regs::ShaderSt | |||
| 447 | for (GPUVAddr current_texture = tex_info_buffer.address + TextureInfoOffset; | 447 | for (GPUVAddr current_texture = tex_info_buffer.address + TextureInfoOffset; |
| 448 | current_texture < tex_info_buffer_end; current_texture += sizeof(Texture::TextureHandle)) { | 448 | current_texture < tex_info_buffer_end; current_texture += sizeof(Texture::TextureHandle)) { |
| 449 | 449 | ||
| 450 | const Texture::TextureHandle tex_handle{memory_manager.Read32(current_texture)}; | 450 | const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(current_texture)}; |
| 451 | 451 | ||
| 452 | Texture::FullTextureInfo tex_info{}; | 452 | Texture::FullTextureInfo tex_info{}; |
| 453 | // TODO(Subv): Use the shader to determine which textures are actually accessed. | 453 | // TODO(Subv): Use the shader to determine which textures are actually accessed. |
| @@ -482,7 +482,7 @@ Texture::FullTextureInfo Maxwell3D::GetStageTexture(Regs::ShaderStage stage, | |||
| 482 | 482 | ||
| 483 | ASSERT(tex_info_address < tex_info_buffer.address + tex_info_buffer.size); | 483 | ASSERT(tex_info_address < tex_info_buffer.address + tex_info_buffer.size); |
| 484 | 484 | ||
| 485 | const Texture::TextureHandle tex_handle{memory_manager.Read32(tex_info_address)}; | 485 | const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(tex_info_address)}; |
| 486 | 486 | ||
| 487 | Texture::FullTextureInfo tex_info{}; | 487 | Texture::FullTextureInfo tex_info{}; |
| 488 | tex_info.index = static_cast<u32>(offset); | 488 | tex_info.index = static_cast<u32>(offset); |
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index a0ded4c25..5cca5c29a 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp | |||
| @@ -88,6 +88,16 @@ void MaxwellDMA::HandleCopy() { | |||
| 88 | auto source_ptr{memory_manager.GetPointer(source)}; | 88 | auto source_ptr{memory_manager.GetPointer(source)}; |
| 89 | auto dst_ptr{memory_manager.GetPointer(dest)}; | 89 | auto dst_ptr{memory_manager.GetPointer(dest)}; |
| 90 | 90 | ||
| 91 | if (!source_ptr) { | ||
| 92 | LOG_ERROR(HW_GPU, "source_ptr is invalid"); | ||
| 93 | return; | ||
| 94 | } | ||
| 95 | |||
| 96 | if (!dst_ptr) { | ||
| 97 | LOG_ERROR(HW_GPU, "dst_ptr is invalid"); | ||
| 98 | return; | ||
| 99 | } | ||
| 100 | |||
| 91 | const auto FlushAndInvalidate = [&](u32 src_size, u64 dst_size) { | 101 | const auto FlushAndInvalidate = [&](u32 src_size, u64 dst_size) { |
| 92 | // TODO(Subv): For now, manually flush the regions until we implement GPU-accelerated | 102 | // TODO(Subv): For now, manually flush the regions until we implement GPU-accelerated |
| 93 | // copying. | 103 | // copying. |