C Specification

To query micromap size parameters on the host, call:

// Provided by VK_EXT_opacity_micromap
VkResult vkWriteMicromapsPropertiesEXT(
    VkDevice                                    device,
    uint32_t                                    micromapCount,
    const VkMicromapEXT*                        pMicromaps,
    VkQueryType                                 queryType,
    size_t                                      dataSize,
    void*                                       pData,
    size_t                                      stride);


  • device is the device which owns the micromaps in pMicromaps.

  • micromapCount is the count of micromaps for which to query the property.

  • pMicromaps is a pointer to an array of existing previously built micromaps.

  • queryType is a VkQueryType value specifying the property to be queried.

  • dataSize is the size in bytes of the buffer pointed to by pData.

  • pData is a pointer to a user-allocated buffer where the results will be written.

  • stride is the stride in bytes between results for individual queries within pData.


This command fulfills the same task as vkCmdWriteMicromapsPropertiesEXT but is executed by the host.

Valid Usage
  • VUID-vkWriteMicromapsPropertiesEXT-pMicromaps-07501
    All micromaps in pMicromaps must have been constructed prior to the execution of this command

  • VUID-vkWriteMicromapsPropertiesEXT-pMicromaps-07502
    All micromaps in pMicromaps must have been constructed with VK_BUILD_MICROMAP_ALLOW_COMPACTION_BIT_EXT if queryType is VK_QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT

  • VUID-vkWriteMicromapsPropertiesEXT-queryType-07503

  • VUID-vkWriteMicromapsPropertiesEXT-queryType-07573
    If queryType is VK_QUERY_TYPE_MICROMAP_SERIALIZATION_SIZE_EXT, then stride must be a multiple of the size of VkDeviceSize

  • VUID-vkWriteMicromapsPropertiesEXT-queryType-07574
    If queryType is VK_QUERY_TYPE_MICROMAP_SERIALIZATION_SIZE_EXT, then pData must point to a VkDeviceSize

  • VUID-vkWriteMicromapsPropertiesEXT-queryType-07575
    If queryType is

  • VUID-vkWriteMicromapsPropertiesEXT-dataSize-07576
    dataSize must be greater than or equal to micromapCount*stride

  • VUID-vkWriteMicromapsPropertiesEXT-buffer-07577
    The buffer used to create each micromap in pMicromaps must be bound to host-visible device memory

  • VUID-vkWriteMicromapsPropertiesEXT-micromapHostCommands-07578
    The VkPhysicalDeviceOpacityMicromapFeaturesEXT::micromapHostCommands feature must be enabled

  • VUID-vkWriteMicromapsPropertiesEXT-buffer-07579
    The buffer used to create each micromap in pMicromaps must be bound to memory that was not allocated with multiple instances

Valid Usage (Implicit)
  • VUID-vkWriteMicromapsPropertiesEXT-device-parameter
    device must be a valid VkDevice handle

  • VUID-vkWriteMicromapsPropertiesEXT-pMicromaps-parameter
    pMicromaps must be a valid pointer to an array of micromapCount valid VkMicromapEXT handles

  • VUID-vkWriteMicromapsPropertiesEXT-queryType-parameter
    queryType must be a valid VkQueryType value

  • VUID-vkWriteMicromapsPropertiesEXT-pData-parameter
    pData must be a valid pointer to an array of dataSize bytes

  • VUID-vkWriteMicromapsPropertiesEXT-micromapCount-arraylength
    micromapCount must be greater than 0

  • VUID-vkWriteMicromapsPropertiesEXT-dataSize-arraylength
    dataSize must be greater than 0

  • VUID-vkWriteMicromapsPropertiesEXT-pMicromaps-parent
    Each element of pMicromaps must have been created, allocated, or retrieved from device

Return Codes
On success, this command returns

On failure, this command returns


See Also

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 2014-2023 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0