mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-11 07:27:57 -05:00
Implement IsBlockContinous
This detects when a GPU Memory Block is not continous within host cpu memory.
This commit is contained in:
committed by
FernandoS27
parent
13d626fc21
commit
d0082de82a
@ -199,6 +199,14 @@ const u8* MemoryManager::GetPointer(GPUVAddr addr) const {
|
||||
return {};
|
||||
}
|
||||
|
||||
bool MemoryManager::IsBlockContinous(const GPUVAddr start, const std::size_t size) {
|
||||
const GPUVAddr end = start + size;
|
||||
const auto host_ptr_start = reinterpret_cast<std::uintptr_t>(GetPointer(start));
|
||||
const auto host_ptr_end = reinterpret_cast<std::uintptr_t>(GetPointer(end));
|
||||
const std::size_t range = static_cast<std::size_t>(host_ptr_end - host_ptr_start);
|
||||
return range == size;
|
||||
}
|
||||
|
||||
void MemoryManager::ReadBlock(GPUVAddr src_addr, void* dest_buffer, const std::size_t size) const {
|
||||
std::size_t remaining_size{size};
|
||||
std::size_t page_index{src_addr >> page_bits};
|
||||
|
Reference in New Issue
Block a user