video_core/memory_manager: Make ReadBlock() a const qualifier member function
Now, since we have a const qualified variant of GetPointer(), we can put it to use in ReadBlock() to retrieve the source pointer that is passed into memcpy. Now block reading may be done from a const context.
This commit is contained in:
parent
34510bcda8
commit
76ef6e5c2b
@ -203,7 +203,7 @@ const u8* MemoryManager::GetPointer(GPUVAddr addr) const {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryManager::ReadBlock(GPUVAddr src_addr, void* dest_buffer, std::size_t size) {
|
void MemoryManager::ReadBlock(GPUVAddr src_addr, void* dest_buffer, std::size_t size) const {
|
||||||
std::memcpy(dest_buffer, GetPointer(src_addr), size);
|
std::memcpy(dest_buffer, GetPointer(src_addr), size);
|
||||||
}
|
}
|
||||||
void MemoryManager::WriteBlock(GPUVAddr dest_addr, const void* src_buffer, std::size_t size) {
|
void MemoryManager::WriteBlock(GPUVAddr dest_addr, const void* src_buffer, std::size_t size) {
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
u8* GetPointer(GPUVAddr addr);
|
u8* GetPointer(GPUVAddr addr);
|
||||||
const u8* GetPointer(GPUVAddr addr) const;
|
const u8* GetPointer(GPUVAddr addr) const;
|
||||||
|
|
||||||
void ReadBlock(GPUVAddr src_addr, void* dest_buffer, std::size_t size);
|
void ReadBlock(GPUVAddr src_addr, void* dest_buffer, std::size_t size) const;
|
||||||
void WriteBlock(GPUVAddr dest_addr, const void* src_buffer, std::size_t size);
|
void WriteBlock(GPUVAddr dest_addr, const void* src_buffer, std::size_t size);
|
||||||
void CopyBlock(GPUVAddr dest_addr, GPUVAddr src_addr, std::size_t size);
|
void CopyBlock(GPUVAddr dest_addr, GPUVAddr src_addr, std::size_t size);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user