Skip to content

Cannot use memory auto-export + import at the same time #508

@maxime-modulopi

Description

@maxime-modulopi

VMA version: 3442720

What i'm trying to do is to have all VMA-allocated GPU images/buffers be exportable by default while also supporting memory import (auto-export and import are mutually exclusive here).

For the auto-export part, I set the supported handle types in VmaAllocatorCreateInfo::pTypeExternalMemoryHandleTypes for all DEVICE_LOCAL memory types.

For the import part, I use vmaCreateDedicatedImage/vmaCreateDedicatedBuffer + VkImportMemoryWin32HandleInfoKHR + custom pool, since the doc says that VmaAllocatorCreateInfo::pTypeExternalMemoryHandleTypes only affects default pools.

The problem I'm facing is that when I import memory, VkExportMemoryAllocateInfoKHR from the auto-export part still gets pushed to the VkMemoryAllocateInfo pNext chain, which means I end up with both VkExportMemoryAllocateInfoKHR with export handle type + VkImportMemoryWin32HandleInfoKHR with import handle type.

As the handle types I use for auto-export and import are not compatible with each other (D3D11_TEXTURE for import and OPAQUE_WIN32 for export), this doesn't work.

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