Rewriting memory manager.

This commit is contained in:
Ben Vanik
2015-05-16 00:23:13 -07:00
parent 3a7d1f21e8
commit 147a70b9c1
23 changed files with 1348 additions and 657 deletions

View File

@@ -490,7 +490,7 @@ TextureCache::TextureEntry* TextureCache::LookupOrInsertTexture(
// Add a write watch. If any data in the given range is touched we'll get a
// callback and evict the texture. We could reuse the storage, though the
// driver is likely in a better position to pool that kind of stuff.
entry->write_watch_handle = memory_->AddWriteWatch(
entry->write_watch_handle = memory_->AddPhysicalWriteWatch(
texture_info.guest_address, texture_info.input_length,
[](void* context_ptr, void* data_ptr, uint32_t address) {
auto self = reinterpret_cast<TextureCache*>(context_ptr);
@@ -735,7 +735,8 @@ bool TextureCache::UploadTexture2D(GLuint texture,
auto bpp = (bytes_per_block >> 2) +
((bytes_per_block >> 1) >> (bytes_per_block >> 2));
for (uint32_t y = 0, output_base_offset = 0;
y < texture_info.size_2d.block_height;
y < std::min(texture_info.size_2d.block_height,
texture_info.size_2d.logical_height);
y++, output_base_offset += texture_info.size_2d.output_pitch) {
auto input_base_offset = TextureInfo::TiledOffset2DOuter(
offset_y + y, (texture_info.size_2d.input_width /