d3d12 texture cache: align to bottom texture address

This commit is contained in:
DHrpcs3 2016-01-10 23:28:30 +02:00
parent a17c41b4e1
commit 8297d963bf
1 changed files with 3 additions and 2 deletions

View File

@ -14,8 +14,9 @@ void data_cache::store_and_protect_data(u64 key, u32 start, size_t size, u8 form
void data_cache::protect_data(u64 key, u32 start, size_t size)
{
/// align start to 4096 byte
u32 protected_range_start = align(start, 4096);
u32 protected_range_size = (u32)align(size, 4096);
static const u32 memory_page_size = 4096;
u32 protected_range_start = start & ~(memory_page_size - 1);
u32 protected_range_size = (u32)align(size, memory_page_size);
m_protected_ranges.push_back(std::make_tuple(key, protected_range_start, protected_range_size));
vm::page_protect(protected_range_start, protected_range_size, 0, 0, vm::page_writable);
}