When memory is mapped in DX12, its pointer is used as the identifier for the memory.
In D3D12CaptureManager::PostProcess_ID3D12Resource_Map:
manager->AddTrackedMemory(reinterpret_cast<uint64_t>(mapped_subresource.data),
In PageGuardManager::AddTrackedMemory:
auto entry =
memory_info_.emplace(std::piecewise_construct,
std::forward_as_tuple(memory_id),
std::forward_as_tuple(mapped_memory,
mapped_range,
shadow_memory,
shadow_size,
aligned_address,
aligned_offset,
total_pages,
last_segment_size,
start_address,
static_cast<const uint8_t*>(start_address) + mapped_range,
use_write_watch,
shadow_memory_handle == kNullShadowHandle));
If two overlapping resources are created and mapped at the same resource (with CreatePlacedResource), the second call to AddTrackedMemory does not update the memory_info_ map. And if the second resource mapped is larger than the first resource, the additional memory pages it covers won't be processed in PageGuardManager::LoadActiveWriteStates because the dirty pages are retrieved based on the information stored in the memory_info_ map:
if (GetWriteWatch(WRITE_WATCH_FLAG_RESET,
memory_info->aligned_address,
memory_info->mapped_range + memory_info->aligned_offset,
modified_addresses,
&modified_count,
&granularity) == 0)
This is a potential issue identified by code inspection. I am not aware of a real world use case that encounters this problem.
When memory is mapped in DX12, its pointer is used as the identifier for the memory.
In
D3D12CaptureManager::PostProcess_ID3D12Resource_Map:manager->AddTrackedMemory(reinterpret_cast<uint64_t>(mapped_subresource.data),In
PageGuardManager::AddTrackedMemory:If two overlapping resources are created and mapped at the same resource (with
CreatePlacedResource), the second call toAddTrackedMemorydoes not update thememory_info_map. And if the second resource mapped is larger than the first resource, the additional memory pages it covers won't be processed inPageGuardManager::LoadActiveWriteStatesbecause the dirty pages are retrieved based on the information stored in thememory_info_map:This is a potential issue identified by code inspection. I am not aware of a real world use case that encounters this problem.