# vkUnmapMemory2(3) Manual Page

## Name

vkUnmapMemory2 - Unmap a previously mapped memory object

Loading… please wait.

## C Specification

Alternatively, to unmap a memory object once host access to it is no longer needed by the application, call:

    // Provided by VK_VERSION_1_4
    VkResult vkUnmapMemory2(
        VkDevice                                    device,
        const VkMemoryUnmapInfo*                    pMemoryUnmapInfo);

or the equivalent command

    // Provided by VK_KHR_map_memory2
    VkResult vkUnmapMemory2KHR(
        VkDevice                                    device,
        const VkMemoryUnmapInfo*                    pMemoryUnmapInfo);

## Parameters

- `device` is the logical device that owns the memory.

- `pMemoryUnmapInfo` is a pointer to a VkMemoryUnmapInfo structure describing parameters of the unmap.

## Description

This function behaves identically to vkUnmapMemory except that it gets its parameters via an extensible structure pointer rather than directly as function arguments.

Valid Usage (Implicit)

- VUID-vkUnmapMemory2-device-parameter
  `device` must be a valid VkDevice handle

- VUID-vkUnmapMemory2-pMemoryUnmapInfo-parameter
  `pMemoryUnmapInfo` must be a valid pointer to a valid VkMemoryUnmapInfo structure

Return Codes

On success, this command returns

  - `VK_SUCCESS`

On failure, this command returns

  - `VK_ERROR_MEMORY_MAP_FAILED`

## See Also

VK_KHR_map_memory2, VK_VERSION_1_4, VkDevice, VkMemoryUnmapInfo

## Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

## Copyright

Copyright 2014-2025 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0