mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 00:12:40 +00:00
graphics: upload streamed texture mips from sparse reservations
This commit is contained in:
1 parent
59a1760427
commit
650dc1e0af
5 files changed
+54
-48
No files matched your search
@@ -212,14 +212,21 @@ public:
|
||||
}
|
||||
|
||||
auto* destination = static_cast<uint8_t*>(data);
|
||||
std::memset(destination, 0, size);
|
||||
auto cursor = vaddr;
|
||||
for (auto mapping = first; mapping != m_maps.end() && mapping->second.vaddr < end;
|
||||
++mapping) {
|
||||
const auto& entry = mapping->second;
|
||||
const auto start = std::max(vaddr, entry.vaddr);
|
||||
const auto bytes = std::min(end, entry.vaddr + entry.size) - start;
|
||||
const auto offset = entry.backing_offset + start - entry.vaddr;
|
||||
if (cursor < start) {
|
||||
std::memset(destination + cursor - vaddr, 0, start - cursor);
|
||||
}
|
||||
std::memcpy(destination + start - vaddr, m_backing_base + offset, bytes);
|
||||
cursor = start + bytes;
|
||||
}
|
||||
if (cursor < end) {
|
||||
std::memset(destination + cursor - vaddr, 0, end - cursor);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user