-
Notifications
You must be signed in to change notification settings - Fork 168
Description
Support memory management for aliasing (overlap) multiple resources(buffers or images) in the same region of memory for Vulkan and D3D12.
Describe the replay bug:
gfxrecon-replay currently does not support replaying aliased resources (buffers or images that overlap the same region of device memory) when replaying in rebind mode. This results in incorrect replay behavior or failures when capturing applications that use memory aliasing techniques in Vulkan or Direct3D 12.
Background:
Memory aliasing is a deliberate GPU memory management technique where multiple resources (buffers and/or images) are bound to the same region of a device memory allocation simultaneously. Applications use this to:
- Reduce peak memory usage by reusing memory regions across resources with non-overlapping lifetimes.
- Implement transient resources (e.g., render targets, UAVs) that do not need to coexist at the same time.
Both Vulkan and Direct3D 12 expose explicit memory management APIs that permit this pattern:
- Vulkan: via
VkDeviceMemory+vkBindBufferMemory/vkBindImageMemorywith overlapping offsets. - D3D12: via
ID3D12Heap+CreatePlacedResourcewith overlapping heap regions.
Problem:
In rebind mode, gfxrecon-replay re-allocates and rebinds resources to new memory regions during replay. The current implementation does not account for aliasing relationships between resources. As a result:
- Aliased resources are allocated independently, breaking the intentional memory overlap.
- Resource lifetimes and memory hazards tied to aliasing semantics are not correctly reproduced.
- Replay may produce visual corruption, validation errors, or crashes when the captured application relies on aliasing behavior.
Expected:
gfxrecon-replay should correctly handle aliased resources in rebind mode for both Vulkan and Direct3D 12.