KhronosGroup / KhronosGroup/Vulkan-Docs

Spec clarification for valid pFd return values in vkGetSemaphoreFdKHR

Open
#2,452 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

System Integration
Dominant language
JavaScript
Stars
3.3k
Forks
549
Avg merge
5d 5h
Merged PRs (30d)
2

Description

In the spec of VkImportSemaphoreFdInfoKHR it is stated:

  • If handleType is VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT, the special value -1 for fd is treated like a valid sync file descriptor referring to an object that has already signaled
  • It is consistent with the option for implementations to return a -1 file descriptor when exporting a VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT from a VkSemaphore which is signaled

But vkGetSemaphoreFdKHR does not contain information about pFd's value -1 being valid option. Or really any other information about valid values beside being integer.

This has led to a bug in Chromium expecting pFd value to be always >= 0 when the result is VK_SUCCESS which has caused issues on Huawei devices whose driver returns -1 for already signaled semaphore.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the VkImportSemaphoreFdInfoKHR and vkGetSemaphoreFdKHR reference pages linked in the issue, comparing their descriptions of sync-fd values and successful exports. Clarify the vkGetSemaphoreFdKHR documentation so the valid -1 result for an already-signaled semaphore is explicit, then verify the wording is consistent across both pages.

Written by the indexing model from the issue text.

Assessment

Domain
api, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.