KhronosGroup / KhronosGroup/Vulkan-Docs

Vulkan.h contains variable definitions

Open
#1,607 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I was attempting to export vulkan.h as a c++20 module, and encountered an issue as vulkan_core.h defines static const variables of type VkPipelineStageFlagBits2KHR (a typedef of VkFlags64).

I don't think vulkan.h should be defining any variables, even those that are static const. Would it be possible to change these to preprocessor definitions or enums in the same way other values are defined?

If that's impossible, could they instead be defined as constexpr instead of static const when using c++11 or higher?

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 by inspecting the static const VkPipelineStageFlagBits2KHR definitions in vulkan_core.h and how the corresponding values are represented elsewhere in vulkan.h. Compare the available preprocessor, enum, and C++11-or-later forms, then verify that the resulting headers no longer define variables while preserving the Vulkan values and C++20 module use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.