Skip to content

[Replay] Support memory aliasing (overlapping resources) in rebind mode for Vulkan and D3D12 #2756

@zongdu-arm

Description

@zongdu-arm

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 / vkBindImageMemory with overlapping offsets.
  • D3D12: via ID3D12Heap + CreatePlacedResource with 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions