vkGetSemaphoreCounterValueKHR(3)

# vkGetSemaphoreCounterValueKHR(3) Manual Page

## Name

vkGetSemaphoreCounterValueKHR - Query the current state of a timeline semaphore

## C Specification

To query the current counter value of a semaphore created with a VkSemaphoreTypeKHR of `VK_SEMAPHORE_TYPE_TIMELINE_KHR` from the host, call:

    VkResult vkGetSemaphoreCounterValueKHR(
        VkDevice                                    device,
        VkSemaphore                                 semaphore,
        uint64_t*                                   pValue);

## Parameters

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

- `semaphore` is the handle of the semaphore to query.

- `pValue` is a pointer to a 64-bit integer value in which the current counter value of the semaphore is returned.

## Description

| Note If a queue submission command is pending execution, then the value returned by this command may immediately be out of date.

Valid Usage

- `semaphore` must have been created with a VkSemaphoreTypeKHR of `VK_SEMAPHORE_TYPE_TIMELINE_KHR`

Valid Usage (Implicit)

- `device` must be a valid `VkDevice` handle

- `semaphore` must be a valid `VkSemaphore` handle

- `pValue` must be a valid pointer to a `uint64_t` value

- `semaphore` must have been created, allocated, or retrieved from `device`

Return Codes

On success, this command returns

  - `VK_SUCCESS`

On failure, this command returns

  - `VK_ERROR_OUT_OF_HOST_MEMORY`

  - `VK_ERROR_OUT_OF_DEVICE_MEMORY`

  - `VK_ERROR_DEVICE_LOST`

## See Also

VkDevice, VkSemaphore

## 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 (c) 2014-2019 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.