Compare commits

...

127 commits

Author SHA1 Message Date
Jon Leech
409c16be50 Update for Vulkan-Docs 1.4.313
Some checks failed
ci / cmake-unix (3.22.1, macos-latest) (push) Has been cancelled
ci / cmake-unix (3.22.1, ubuntu-latest) (push) Has been cancelled
ci / cmake-unix (latest, macos-latest) (push) Has been cancelled
ci / cmake-unix (latest, ubuntu-latest) (push) Has been cancelled
ci / cmake-windows (3.22.1) (push) Has been cancelled
ci / cmake-windows (latest) (push) Has been cancelled
ci / windows_clang (clang) (push) Has been cancelled
ci / windows_clang (clang-cl) (push) Has been cancelled
ci / cmake-unix-modules (latest, clang++-18, ubuntu-latest) (push) Has been cancelled
ci / cmake-windows-modules (latest, windows-latest) (push) Has been cancelled
ci / reuse (push) Has been cancelled
2025-04-18 02:37:14 -07:00
Bruno Cabral
110b6c989c ignore Jetbrains config directories
Some checks failed
ci / cmake-unix (3.22.1, ubuntu-latest) (push) Failing after 6s
ci / cmake-unix (latest, ubuntu-latest) (push) Failing after 1s
ci / cmake-unix-modules (latest, clang++-18, ubuntu-latest) (push) Failing after 0s
ci / reuse (push) Failing after 1s
ci / cmake-unix (3.22.1, macos-latest) (push) Has been cancelled
ci / cmake-unix (latest, macos-latest) (push) Has been cancelled
ci / cmake-windows (3.22.1) (push) Has been cancelled
ci / cmake-windows (latest) (push) Has been cancelled
ci / windows_clang (clang) (push) Has been cancelled
ci / windows_clang (clang-cl) (push) Has been cancelled
ci / cmake-windows-modules (latest, windows-latest) (push) Has been cancelled
2025-04-14 11:14:05 -06:00
Jon Leech
5ceb9ed481 Update for Vulkan-Docs 1.4.312
Some checks failed
ci / cmake-unix (3.22.1, ubuntu-latest) (push) Failing after 1s
ci / cmake-unix (latest, ubuntu-latest) (push) Failing after 1s
ci / cmake-unix-modules (latest, clang++-18, ubuntu-latest) (push) Failing after 1s
ci / reuse (push) Failing after 1s
ci / cmake-unix (3.22.1, macos-latest) (push) Has been cancelled
ci / cmake-unix (latest, macos-latest) (push) Has been cancelled
ci / cmake-windows (3.22.1) (push) Has been cancelled
ci / cmake-windows (latest) (push) Has been cancelled
ci / windows_clang (clang) (push) Has been cancelled
ci / windows_clang (clang-cl) (push) Has been cancelled
ci / cmake-windows-modules (latest, windows-latest) (push) Has been cancelled
2025-04-04 04:45:22 -07:00
Jan Kuhlmann
2ac81691ba adjusted fnc name
Some checks failed
ci / windows_clang (clang-cl) (push) Has been cancelled
ci / cmake-unix (3.22.1, ubuntu-latest) (push) Failing after 2s
ci / cmake-unix (latest, ubuntu-latest) (push) Failing after 2s
ci / cmake-unix-modules (latest, clang++-18, ubuntu-latest) (push) Failing after 1s
ci / reuse (push) Failing after 1s
ci / cmake-unix (latest, macos-latest) (push) Has been cancelled
ci / cmake-windows (3.22.1) (push) Has been cancelled
ci / cmake-windows-modules (latest, windows-latest) (push) Has been cancelled
ci / cmake-windows (latest) (push) Has been cancelled
ci / cmake-unix (3.22.1, macos-latest) (push) Has been cancelled
ci / windows_clang (clang) (push) Has been cancelled
2025-03-31 09:52:53 -06:00
Jan Kuhlmann
a523083f72 simplified cpp module to not require function loading 2025-03-31 09:52:53 -06:00
Jan Kuhlmann
cb28cd1819 replaced minimal example for modules 2025-03-31 09:52:53 -06:00
Jan Kuhlmann
24ce771ec1 fixed linewrap on windows and CXX compiler on ubuntu 2025-03-31 09:52:53 -06:00
Jan Kuhlmann
cafcda9360 Added licenses and used included headers in minimal examples
Co-authored-by: jpr42 <109434725+jpr42@users.noreply.github.com>
2025-03-31 09:52:53 -06:00
Jan Kuhlmann
2b1e9e7409 added c++20 workflows for modules in ubuntu and windows 2025-03-31 09:52:53 -06:00
Jan Kuhlmann
a72b4466b3 minimal compilation setups for Vulkan::Hpp and Vulkan::HppModule 2025-03-31 09:52:53 -06:00
Jan Kuhlmann
fdc7404466 merged subdirectory tests 2025-03-31 09:52:53 -06:00
Jan Kuhlmann
9417d66dcf integration tests for cxx modules 2025-03-31 09:52:53 -06:00
Jon Leech
78c359741d Update for Vulkan-Docs 1.4.311 2025-03-20 23:33:08 -07:00
Jan Kuhlmann
d64e9e156a cmake: Rename Vulkan-Module to Vulkan-HppModule
The new name better indicates that the target is for Vulkan-Hpp.
The old Vulkan-Module and Vulkan::Module targets are now
deprecated and users should switch to Vulkan-HppModule.

Vulkan-HppModule now supports `import std` when available.

The commit disables cxx_extensions when using clang-16 due to
known issues.
2025-03-17 15:44:30 -06:00
Jon Leech
cacef3039d Update for Vulkan-Docs 1.4.310 2025-03-07 05:15:59 -08:00
Tom Anderson
0f0cfd88d7 GN build: Define VK_USE_PLATFORM_XLIB_KHR
This is required to define vkCreateXlibSurfaceKHR, which is required
by GTK4.

Depends on Dawn CL:
https://dawn-review.googlesource.com/c/dawn/+/229494

Needed to fix this Chromium issue:
https://g-issues.chromium.org/issues/345261080
2025-03-06 15:49:41 -06:00
Jon Leech
952f776f65 Update for Vulkan-Docs 1.4.309 2025-02-21 03:24:08 -08:00
Juan Ramos
234c4b7370 cmake: Update minimum version to 3.22.1
Matches Vulkan Validation Layers and SPIRV-Tools.
2025-02-04 16:44:38 -07:00
Jon Leech
39f924b810 Update for Vulkan-Docs 1.4.307 2025-01-30 01:57:39 -08:00
Jon Leech
e43027aa41 Update for Vulkan-Docs 1.4.306 2025-01-24 05:52:25 -08:00
Jon Leech
a03d2f6d57 Update for Vulkan-Docs 1.4.305 2025-01-17 03:16:54 -08:00
Jon Leech
d4a196d8c8 Update for Vulkan-Docs 1.4.304 2024-12-19 21:43:52 -08:00
Jon Leech
6a74a7d65c Add missing validusage.json and fix Makefile.release for new registry structure 2024-12-04 00:19:07 -08:00
Jon Leech
49af1bfe46 Update for Vulkan-Docs 1.4.303 2024-12-02 01:48:54 -08:00
Shahbaz Youssefi
9dff1f571c Fix GN include checks 2024-11-28 09:13:14 -07:00
Jon Leech
36872f9062 Update for Vulkan-Docs 1.3.302 2024-11-20 22:40:11 -08:00
dependabot[bot]
f864bc6dfe build(deps): bump fsfe/reuse-action from 4 to 5
Bumps [fsfe/reuse-action](https://github.com/fsfe/reuse-action) from 4 to 5.
- [Release notes](https://github.com/fsfe/reuse-action/releases)
- [Commits](https://github.com/fsfe/reuse-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: fsfe/reuse-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-19 12:56:41 -07:00
Jon Leech
cbcad3c058 Update for Vulkan-Docs 1.3.301 2024-11-01 19:52:35 -07:00
Charles Giessen
f2eb740f3f build: Disable Vulkan-Module by default
After numerous reports of builds being broken due to the addition of the
Vulkan-Module support code in CMake, the option is being set to OFF by
default. This prevents projects which do not use the module from not being
able to build due to compiler, build system, and platform issues. Projects
wishing to enable modules can set the cmake option
VULKAN_HEADERS_ENABLE_MODULE=ON to re-enable the module support.

Add a warning in case a user decides to enable the module but the platform
doesn't support modules.
2024-10-29 13:14:06 -06:00
Jon Leech
ab1ea9059d Update for Vulkan-Docs 1.3.300 2024-10-25 07:05:29 -07:00
Charles Giessen
e271cfd480 ci: Only run once if pushing to main repo branch 2024-10-22 10:42:45 -06:00
Jon Leech
b955ae0edb Update for Vulkan-Docs 1.3.299 2024-10-18 04:46:17 -07:00
Jon Leech
d91597a82f Update for Vulkan-Docs 1.3.298 2024-10-11 01:41:38 -07:00
Jon Leech
14345dab23 Update for Vulkan-Docs 1.3.297 2024-10-04 07:10:10 -07:00
Jon Leech
29f979ee5a Update for Vulkan-Docs 1.3.296 2024-09-26 00:50:55 -07:00
Mike Schuchardt
c6391a7b8c Fix MSVC identification for modules support
Can't use `MSVC` var because it is also true for clang-cl. Fixes #500.
2024-08-30 10:54:22 -06:00
Jon Leech
fbda05468e Update for Vulkan-Docs 1.3.295 2024-08-30 02:52:20 -07:00
Jon Leech
a6a5dc0d07 Update for Vulkan-Docs 1.3.294 2024-08-23 04:06:14 -07:00
Jon Leech
d205aff40b Update for Vulkan-Docs 1.3.293 2024-08-16 04:12:03 -07:00
Jon Leech
595c8d4794 Update for Vulkan-Docs 1.3.292 2024-07-27 05:26:27 -07:00
Jon Leech
fabe9e2672 Update for Vulkan-Docs 1.3.291 2024-07-19 02:38:51 -07:00
Charles Giessen
b379292b2a cmake: Disable modules if clang-scan-deps is missing
clang ships the clang-scan-deps tool separately from the compiler, making it possible
that the clang compiler supports modules but cannot be used by CMake for VulkanHppModule.

The straightforward solution is to, when using clang, check that the scan deps tools was
located. This prevents people who are using clang but not the modules from being unable
to use Vulkan-Headers when the clang-scan-deps tools is missing.
2024-07-16 01:13:21 -05:00
Charles Giessen
fc6c06ac52 Disable VulkanHppModule support in clang-cl
The current released versions of clang-cl does not work with CMakes
module implementation. Rather than break downstream users, just disable
the module support for the time being.
2024-07-12 14:13:48 -05:00
Charles Giessen
5952791798 Add windows clang & clang-cl CI jobs 2024-07-12 14:13:48 -05:00
Jon Leech
f41928bd4a Update for Vulkan-Docs 1.3.290 2024-07-12 00:13:36 -07:00
Charles Giessen
78a92e2c7c build: Require MSVC 17.11 for module support
17.10 and before has a bug that prevents the vulkan.cppm module from
compiling. The module support wont be enabled unless the MSVC version
contains the fix.
2024-07-10 11:12:48 -05:00
dependabot[bot]
6c539b2ed2 build(deps): bump fsfe/reuse-action from 3 to 4
Bumps [fsfe/reuse-action](https://github.com/fsfe/reuse-action) from 3 to 4.
- [Release notes](https://github.com/fsfe/reuse-action/releases)
- [Commits](https://github.com/fsfe/reuse-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: fsfe/reuse-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-08 13:11:15 -05:00
Jon Leech
4b9ea26d48 Change name of update to Makefile.release
Per https://github.com/KhronosGroup/Vulkan-Headers/pull/487#issuecomment-2187478137
2024-07-07 14:05:33 -05:00
Jon Leech
67dcf5647c Makefile to import generated scripts and headers when doing a spec update
Motivated by recent problems building the SC 1.0.15 spec update - will
import to VulkanSC-Headers and tweak once it's proven out for
Vulkan-Headers.

The Makefile may need to be modified when directory structure is changed
or new files are added.
2024-07-07 14:05:33 -05:00
Jon Leech
190d2cb24e Update for Vulkan-Docs 1.3.289 2024-06-28 02:50:56 -07:00
Charles Giessen
e3c37e6e18 cmake: Workaround MSVC module support compiler bug
Adds the VULKAN_HEADERS_ENABLE_MODULE option to control whether to build the Vulkan-Hpp module.
This is necessary to allow CI to pass while waiting for the MSVC version 17.11, which fixes an
internal compiler bug, to be added to github actions runners.
2024-06-18 14:25:22 -06:00
Charles Giessen
cde27c9456 ci: Add explicit build step
This tests the Vulkan Module building without needing to run inside an integration
test. While theoretically the integration tests will exercise the build, the nature
of running the build inside of a test makes it more difficult to diagnose if the test
is poorly setup or if the build itself isn't working.
2024-06-18 14:25:22 -06:00
Charles Giessen
7dacb97fba cmake: Remove explicit install of Vulkan-Module
Installing a C++ module in CMake isn't something which is well defined currently.
Rather than add code which behaves poorly or flat out wrong, it is better to not
try to install a binary module for the time being. The vulkan.cppm file is still
included in the install so downstream users can still create a module from it.
2024-06-18 14:25:22 -06:00
Charles Giessen
a692a9c939 ci: Add install step 2024-06-18 14:25:22 -06:00
Sharadh Rajaraman
85256c712c Add vulkan.cppm as a separate library: Vulkan::VulkanHppModule
- Guarded behind `if()` version and compiler test
- Linked to `Vulkan-Headers` as a dependency
- Also added `CXX` to the `LANGUAGES` property of the project
2024-06-18 14:25:22 -06:00
David Neto
8f034f6b48 cmake: Allow external control of whether to test or install
This makes the project more composable: It can be built and
tested as part of a larger set of projects, from source.
2024-06-14 14:42:51 -06:00
Jon Leech
05fe2cc910 Update for Vulkan-Docs 1.3.288 2024-06-14 05:46:24 -07:00
Jon Leech
d192041a2f Update for Vulkan-Docs 1.3.287 2024-06-07 05:09:34 -07:00
Jon Leech
192d051db3 Update for Vulkan-Docs 1.3.286 2024-05-31 03:06:51 -07:00
Jon Leech
5677bafb82 Update for Vulkan-Docs 1.3.285 2024-05-10 01:39:29 -07:00
Jon Leech
4bc77c26ff Update for Vulkan-Docs 1.3.284 2024-05-05 22:35:37 -07:00
Jon Leech
eaa319dade Update for Vulkan-Docs 1.3.283 2024-04-18 23:54:17 -07:00
Jon Leech
1e7b8a6d03 Update for Vulkan-Docs 1.3.282 2024-04-14 00:28:51 -07:00
Jon Leech
cfebfc96b2 Update for Vulkan-Docs 1.3.281 2024-03-22 04:06:02 -07:00
Jon Leech
577baa0503 Update for Vulkan-Docs 1.3.280 2024-03-08 05:16:31 -08:00
dependabot[bot]
f030d9dd8c build(deps): bump fsfe/reuse-action from 2 to 3
Bumps [fsfe/reuse-action](https://github.com/fsfe/reuse-action) from 2 to 3.
- [Release notes](https://github.com/fsfe/reuse-action/releases)
- [Commits](https://github.com/fsfe/reuse-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: fsfe/reuse-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 10:37:11 -07:00
Jon Leech
46dc0f6e51 Update for Vulkan-Docs 1.3.279 2024-03-01 06:26:07 -08:00
Jon Leech
31aa7f634b Update for Vulkan-Docs 1.3.278 2024-02-16 02:34:38 -08:00
unknown
5ac36269f5 build: Update build.gn with AV1 headers
av1std_decode.h & av1std.h were added recently and needed adding to the
build.gn build.
2024-02-09 08:18:46 -08:00
Jon Leech
5a5c9a6434 Update for Vulkan-Docs 1.3.277 2024-02-01 05:51:47 -08:00
Jon Leech
ea45703eff Fix REUSE 2024-01-25 03:53:51 -08:00
Jon Leech
170cde531f Update for Vulkan-Docs 1.3.276
Note that `registry/profiles/VP_KHR_roadmap.json` was renamed from
`registry/profiles/VP_KHR_roadmap_2022.json`, now that the file contains
multiple roadmap profiles.
2024-01-25 03:53:51 -08:00
Jon Leech
217e93c664 Update for Vulkan-Docs 1.3.275 2024-01-05 05:16:23 -08:00
Jon Leech
80207f9da8 Update for Vulkan-Docs 1.3.274 2023-12-19 03:17:29 -08:00
Jon Leech
41263fc5aa Update for Vulkan-Docs 1.3.273 2023-12-08 06:36:27 -08:00
Jon Leech
19a863ccce Update for Vulkan-Docs 1.3.272 2023-12-01 03:22:54 -08:00
Jon Leech
9d27c893cd Update for Vulkan-Docs 1.3.271 2023-11-26 21:54:32 -08:00
Juan Ramos
7d92fe7b68 cmake: Fix integration.install for multi config generators 2023-11-20 18:07:10 -07:00
Juan Ramos
b93aa80bbc Fix testing for 3.15 2023-11-20 18:07:10 -07:00
Juan Ramos
d9542c985b ci: Use matrix.cmake-version 2023-11-20 17:41:58 -07:00
Juan Ramos
a32b2b412b Use ctest for integration testing 2023-11-20 14:18:09 -07:00
Juan Ramos
af4fb97d7b ci cleanup 2023-11-10 17:23:53 -07:00
Jon Leech
8ccd414a46 Update for Vulkan-Docs 1.3.270 2023-11-10 04:22:15 -08:00
Juan Ramos
aff5071d4e gn: Fix validation layer build
closes KhronosGroup/Vulkan-ValidationLayers/issues/6780
2023-10-23 14:34:57 -06:00
Juan Ramos
3f7a5370a3 docs: Remove INTEGRATION.md
This document hasn't been getting updated and is out of date
in more than a few ways.
2023-10-23 14:01:35 -06:00
Jon Leech
c26f44cc8a Remove genvk.py from Vulkan-Headers
Per comments in #449 and INTEGRATION.md, it is not needed, nor useful in
this repository.
2023-10-23 13:27:44 -06:00
Jon Leech
374f9fd975 Update for Vulkan-Docs 1.3.269 2023-10-20 04:02:25 -07:00
Juan Ramos
f4bfcd8852 ci: Fix fork development
Well the prior change does eliminate duplicate runs it stops
automated testing on forks.
2023-10-16 16:39:30 -06:00
dependabot[bot]
7b3466a1f4 build(deps): bump fsfe/reuse-action from 1 to 2
Bumps [fsfe/reuse-action](https://github.com/fsfe/reuse-action) from 1 to 2.
- [Release notes](https://github.com/fsfe/reuse-action/releases)
- [Commits](https://github.com/fsfe/reuse-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: fsfe/reuse-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-13 14:31:59 -06:00
dependabot[bot]
58ca9534a2 build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-13 14:25:53 -06:00
Juan Ramos
e65ef887fc ci: Prevent duplicate CI runs
https://github.com/orgs/community/discussions/26276
2023-10-13 14:25:30 -06:00
Juan Ramos
1e451348f0 ci: Add dependabot 2023-10-13 14:00:57 -06:00
Jon Leech
07ff4233bc Update for Vulkan-Docs 1.3.268 2023-10-13 03:51:16 -07:00
Juan Ramos
3fb9d9fde5 ci: Fix -Wdeprecated-non-prototype warnings
Occurs on AppleClang
2023-10-12 17:23:05 -06:00
Jon Leech
bbe0f575eb Update for Vulkan-Docs 1.3.267 2023-10-06 06:25:37 -07:00
Juan Ramos
6f0d6550e6 docs: New SDK branch convention
Next SDK we will be changing branch/tag naming scheme from sdk-1.x.yyy to vulkan-sdk-1.x.yyy
2023-10-04 10:26:34 -06:00
Jon Leech
7e69138016 Update for Vulkan-Docs 1.3.266 2023-09-29 02:57:03 -07:00
Jon Leech
df60f03168 Update for Vulkan-Docs 1.3.265 2023-09-23 01:41:24 -07:00
Jon Leech
4f51aac14f Add new .hpp file 2023-09-10 03:25:21 -07:00
Jon Leech
fff6d143cc Update for Vulkan-Docs 1.3.264 2023-09-08 03:47:33 -07:00
Jon Leech
2634c969d7 Update for Vulkan-Docs 1.3.263 2023-09-02 03:16:59 -07:00
Juan Ramos
a0c76b4ef7 cmake: Document vlk_get_header_version 2023-08-28 16:16:25 -06:00
Jon Leech
9085224a1b Update for Vulkan-Docs 1.3.262 2023-08-25 01:23:58 -07:00
Juan Ramos
85c2334e92 reuse: Cleanup copyright for *.md files 2023-08-14 13:06:51 -06:00
Juan Ramos
b3da20eebd Create SECURITY.md
closes #430
2023-08-14 12:55:13 -06:00
Jon Leech
450ead13e1 Update for Vulkan-Docs 1.3.261 2023-08-04 04:04:01 -07:00
Jon Leech
a3b683653e Use MIT license 2023-07-29 01:50:36 -07:00
Jon Leech
6dcbe90f9b Update CoC link 2023-07-29 01:50:36 -07:00
Jon Leech
94bb3c998b Update for Vulkan-Docs 1.3.260 2023-07-28 04:50:00 -07:00
Jon Leech
cb7b123f2d Update for Vulkan-Docs 1.3.259 2023-07-22 04:52:29 -07:00
Jon Leech
9c37439a79 Update for Vulkan-Docs 1.3.258 2023-07-21 03:42:08 -07:00
Juan Ramos
6eee20744f ci: Add Windows to CI 2023-07-17 12:47:51 -06:00
Juan Ramos
bc14fdad60 Add REUSE compliance checker to CI 2023-07-14 09:57:20 -06:00
Juan Ramos
2565ffa31e cmake: Use share instead of DATADIR for CMake config files
See the following discussion for context:
https://discourse.cmake.org/t/what-should-the-destination-be-for-a-header-only-librarys-cmake-config-file/8473/3

TLDR: `DATADIR` can be `share` but it doesn't have to be. It can
be changed by the user.
2023-07-10 13:02:41 -06:00
Jon Leech
485c0395ad Update for Vulkan-Docs 1.3.257 2023-07-07 07:22:11 -07:00
Juan Ramos
179b26a792 docs: Remove outdated documentation referencing cmake/ 2023-07-05 15:27:21 -06:00
Juan Ramos
482af6d865 cmake: Remove VULKAN_HEADERS_INSTALL
VULKAN_HEADERS_INSTALL was added since it was believed there was
a valid use case for it.

After looking into the use case that provoked this change there is
no reason to keep VULKAN_HEADERS_INSTALL as an option.

Here is the use case we do NOT want to support:
https://github.com/KhronosGroup/Vulkan-Headers/pull/416#issuecomment-1622318949

Fundamentally this problem is caused add_subdirectory/find_package
not being able to work together flawlessly.

Which isn't the responsibility of Vulkan-Headers to fix.

It's the responsibility of projects that consume Vulkan-Headers
to account for either method.

As described by the CMake maintainers:
https://discourse.cmake.org/t/idiomatic-way-to-handle-packages-and-add-subdirectory/8400
2023-07-05 15:22:17 -06:00
Juan Ramos
6f34ca5a37 cmake: Remove usage of configure_package_config_file
Fixes issue shown here:
https://github.com/KhronosGroup/Vulkan-Headers/pull/415
2023-07-05 10:19:57 -06:00
Juan Ramos
ad5f8ee975 cmake: Add VULKAN_HEADERS_INSTALL option
Allows add_subdirectory users to install vulkan-headers
2023-06-30 09:56:11 -06:00
Jon Leech
60b89abf43 Add new .cppm file to CONTRIBUTING.md 2023-06-30 06:35:30 -07:00
Jon Leech
ed857118e2 Update for Vulkan-Docs 1.3.256 2023-06-30 06:30:05 -07:00
Jon Leech
9b834aa443 Update README to be more clear about use of the different files in the repo
This is intended to clarify that developers using Vulkan are likely to
need only the header files, not the scripts and other material in the
repository which are used by the SDK and other downstream ecosystem
components.

Closes #407
2023-06-26 17:03:30 -07:00
Jon Leech
b6a29e5ca8 Update for Vulkan-Docs 1.3.255 2023-06-23 05:19:14 -07:00
Jon Leech
c1a8560c5c Update for Vulkan-Docs 1.3.254 2023-06-16 07:52:27 -07:00
Jon Leech
cb71b646f1 Update for Vulkan-Docs 1.3.253 2023-06-09 20:58:28 -07:00
Jon Leech
605dc6d3e7 Update for Vulkan-Docs 1.3.252 2023-06-02 06:23:03 -07:00
Jon Leech
3df77fb3e4 Update for Vulkan-Docs 1.3.251 2023-05-28 05:45:47 -07:00
90 changed files with 233510 additions and 90734 deletions

8
.gitattributes vendored
View file

@ -1,3 +1,11 @@
# ~~~
# Copyright 2018-2023 The Khronos Group Inc.
# Copyright 2018-2023 Valve Corporation
# Copyright 2018-2023 LunarG, Inc.
#
# SPDX-License-Identifier: Apache-2.0
# ~~~
# See https://git-scm.com/docs/gitattributes
# See https://help.github.com/articles/dealing-with-line-endings/

View file

@ -15,11 +15,9 @@ This repository is responsible for the following files
* BUILD.gn
* BUILD.md
* cmake/
* CMakeLists.txt
* tests/*
* CODE_OF_CONDUCT.md
* INTEGRATION.md
* LICENSE.txt
* README.md
* Non-API headers

12
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,12 @@
# ~~~
# Copyright 2023 LunarG, Inc.
#
# SPDX-License-Identifier: Apache-2.0
# ~~~
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 3

View file

@ -6,11 +6,9 @@ This repository is responsible for the following files
* BUILD.gn
* BUILD.md
* cmake/
* CMakeLists.txt
* tests/*
* CODE_OF_CONDUCT.md
* INTEGRATION.md
* LICENSE.txt
* README.md
* Non-API headers

135
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,135 @@
# Copyright 2022-2023 LunarG, Inc.
#
# SPDX-License-Identifier: Apache-2.0
name: ci
on:
push:
pull_request:
env:
CMAKE_GENERATOR: Ninja
permissions:
contents: read
jobs:
cmake-unix:
runs-on: ${{ matrix.os }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
cmake-version: [ '3.22.1', 'latest']
steps:
- uses: actions/checkout@v4
- uses: lukka/get-cmake@latest
with:
cmakeVersion: ${{ matrix.cmake-version }}
- uses: ilammy/msvc-dev-cmd@v1
- run: cmake -S . -B build -D VULKAN_HEADERS_ENABLE_TESTS=ON -D VULKAN_HEADERS_ENABLE_INSTALL=ON -G Ninja
- run: cmake --build ./build
- run: cmake --install build/ --prefix build/install
- run: ctest --output-on-failure
working-directory: build
cmake-windows:
runs-on: windows-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
cmake-version: [ '3.22.1', 'latest']
steps:
- uses: actions/checkout@v4
- uses: lukka/get-cmake@latest
with:
cmakeVersion: ${{ matrix.cmake-version }}
- uses: ilammy/msvc-dev-cmd@v1
- run: cmake -S . -B build -D VULKAN_HEADERS_ENABLE_TESTS=ON -D VULKAN_HEADERS_ENABLE_INSTALL=ON -G Ninja
- run: cmake --build ./build
- run: cmake --install build/ --prefix build/install
- run: ctest --output-on-failure
working-directory: build
windows_clang:
runs-on: windows-2022
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
compiler: [ clang, clang-cl ]
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- run: |
cmake -S . -B build `
-D CMAKE_C_COMPILER=${{matrix.compiler}} `
-D CMAKE_CXX_COMPILER=${{matrix.compiler}} `
-D CMAKE_BUILD_TYPE=Release `
-D VULKAN_HEADERS_ENABLE_TESTS=ON `
-D VULKAN_HEADERS_ENABLE_INSTALL=ON `
-G Ninja
- run: cmake --build ./build
- run: cmake --install build/ --prefix build/install
- run: ctest --output-on-failure
working-directory: build
cmake-unix-modules:
runs-on: ${{ matrix.os }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
os: [ ubuntu-latest ]
cmake-version: [ 'latest' ]
compiler: [ clang++-18 ]
steps:
- uses: actions/checkout@v4
- uses: lukka/get-cmake@latest
with:
cmakeVersion: ${{ matrix.cmake-version }}
- uses: ilammy/msvc-dev-cmd@v1
- run: |
cmake -S . -B build \
-D VULKAN_HEADERS_ENABLE_TESTS=ON \
-D VULKAN_HEADERS_ENABLE_INSTALL=ON \
-D VULKAN_HEADERS_ENABLE_MODULE=ON \
-D VULKAN_HEADERS_ENABLE_MODULE_STD=OFF \
-D CMAKE_CXX_COMPILER=${{ matrix.compiler }} \
-G Ninja
- run: cmake --build ./build
- run: cmake --install build/ --prefix build/install
- run: CXX=${{ matrix.compiler }} ctest --output-on-failure
working-directory: build
cmake-windows-modules:
runs-on: ${{ matrix.os }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
os: [ windows-latest ]
cmake-version: [ 'latest' ]
steps:
- uses: actions/checkout@v4
- uses: lukka/get-cmake@latest
with:
cmakeVersion: ${{ matrix.cmake-version }}
- uses: ilammy/msvc-dev-cmd@v1
- run: |
cmake -S . -B build `
-D VULKAN_HEADERS_ENABLE_TESTS=ON `
-D VULKAN_HEADERS_ENABLE_INSTALL=ON `
-D VULKAN_HEADERS_ENABLE_MODULE=ON `
-D VULKAN_HEADERS_ENABLE_MODULE_STD=OFF `
-G Ninja
- run: cmake --build ./build
- run: cmake --install build/ --prefix build/install
- run: ctest --output-on-failure
working-directory: build
reuse:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v5

View file

@ -1,63 +0,0 @@
# Copyright (c) 2022-2023 LunarG, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Linux
on:
push:
pull_request:
branches:
- main
permissions:
contents: read
jobs:
ubuntu-cmake-install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.17.0
- name: Configure Vulkan-Headers
run: cmake -S . -B build -G "Ninja"
- name: Install Vulkan-Headers
run: cmake --install build --prefix ${{ github.workspace }}/build/install
- name: Test Vulkan-Headers find_package support
run: cmake -S tests/find_package -B build/tests/find_package -D CMAKE_PREFIX_PATH=${{ github.workspace }}/build/install
ubuntu-cmake-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.25.0
- name: Configure Vulkan-Headers
run: cmake -S . -B build -D BUILD_TESTS=ON --log-level=DEBUG -G "Ninja"
- name: Build Vulkan-Headers Tests
run: cmake --build build
test-cmake-minimum:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.15.0
- name: Configure Vulkan-Headers
run: cmake -S . -B build/ -G "Ninja" --loglevel=DEBUG
- name: Install Vulkan-Headers
run: cmake --install build/ --prefix build/install

10
.gitignore vendored
View file

@ -1,6 +1,16 @@
# ~~~
# Copyright 2018-2023 The Khronos Group Inc.
# Copyright 2018-2023 Valve Corporation
# Copyright 2018-2023 LunarG, Inc.
#
# SPDX-License-Identifier: Apache-2.0
# ~~~
# Python cache
__pycache__
*.pyc
build
cmake-build-*/
.idea/
.vscode/
**/.*.swp

15
.reuse/dep5 Normal file
View file

@ -0,0 +1,15 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Vulkan-Headers
Source: https://github.com/KhronosGroup/Vulkan-Headers
Files: registry/profiles/VP_KHR_roadmap.json
Copyright: 2022-2024 The Khronos Group Inc.
License: Apache-2.0
Files: registry/validusage.json
Copyright: 2018-2024 The Khronos Group Inc.
License: Apache-2.0
Files: .github/ISSUE_TEMPLATE/bug_report.md .github/pull_request_template.md
Copyright: 2022-2024 The Khronos Group Inc.
License: Apache-2.0

View file

@ -1,17 +1,7 @@
# Copyright (C) 2018-2023 The ANGLE Project Authors.
# Copyright (C) 2019-2023 LunarG, Inc.
# Copyright 2018-2023 The ANGLE Project Authors.
# Copyright 2019-2023 LunarG, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0
import("//build_overrides/vulkan_headers.gni")
@ -23,7 +13,10 @@ config("vulkan_headers_config") {
defines += [ "VK_USE_PLATFORM_WIN32_KHR" ]
}
if (defined(vulkan_use_x11) && vulkan_use_x11) {
defines += [ "VK_USE_PLATFORM_XCB_KHR" ]
defines += [
"VK_USE_PLATFORM_XCB_KHR",
"VK_USE_PLATFORM_XLIB_KHR",
]
}
if (defined(vulkan_use_wayland) && vulkan_use_wayland) {
defines += [ "VK_USE_PLATFORM_WAYLAND_KHR" ]
@ -37,9 +30,15 @@ config("vulkan_headers_config") {
if (is_fuchsia) {
defines += [ "VK_USE_PLATFORM_FUCHSIA" ]
}
if (is_mac) {
if (is_apple) {
defines += [ "VK_USE_PLATFORM_METAL_EXT" ]
}
if (is_mac) {
defines += [ "VK_USE_PLATFORM_MACOS_MVK" ]
}
if (is_ios) {
defines += [ "VK_USE_PLATFORM_IOS_MVK" ]
}
if (defined(is_ggp) && is_ggp) {
defines += [ "VK_USE_PLATFORM_GGP" ]
}
@ -60,6 +59,9 @@ source_set("vulkan_headers") {
"include/vulkan/vulkan.hpp",
"include/vulkan/vulkan_core.h",
"include/vulkan/vulkan_screen.h",
"include/vk_video/vulkan_video_codec_av1std_decode.h",
"include/vk_video/vulkan_video_codec_av1std_encode.h",
"include/vk_video/vulkan_video_codec_av1std.h",
"include/vk_video/vulkan_video_codec_h264std_decode.h",
"include/vk_video/vulkan_video_codec_h264std_encode.h",
"include/vk_video/vulkan_video_codec_h264std.h",

View file

@ -1,3 +1,9 @@
<!--
Copyright 2018-2023 The Khronos Group Inc.
SPDX-License-Identifier: Apache-2.0
-->
# Build Instructions
Instructions for building this repository.
@ -36,7 +42,5 @@ find_package(VulkanHeaders REQUIRED CONFIG)
target_link_libraries(foobar PRIVATE Vulkan::Headers)
message(STATUS "Vulkan Headers Registry: ${VULKAN_HEADERS_REGISTRY_DIRECTORY}")
message(STATUS "Vulkan Headers Version: ${VulkanHeaders_VERSION}")
```

View file

@ -1,21 +1,16 @@
# ~~~
# Copyright (c) 2018-2023 Valve Corporation
# Copyright (c) 2018-2023 LunarG, Inc.
# Copyright 2018-2023 The Khronos Group Inc.
# Copyright 2018-2023 Valve Corporation
# Copyright 2018-2023 LunarG, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0
# ~~~
cmake_minimum_required(VERSION 3.15...3.25)
cmake_minimum_required(VERSION 3.22.1)
# NOTE: Parsing the version like this is suboptimal but neccessary due to our release process:
# https://github.com/KhronosGroup/Vulkan-Headers/pull/346
#
# As shown a more robust approach would be just to add basic test code to check the project version.
function(vlk_get_header_version)
set(vulkan_core_header_file "${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan/vulkan_core.h")
if (NOT EXISTS ${vulkan_core_header_file})
@ -41,54 +36,90 @@ function(vlk_get_header_version)
endfunction()
vlk_get_header_version()
project(VULKAN_HEADERS LANGUAGES C VERSION ${VK_VERSION_STRING})
project(VULKAN_HEADERS LANGUAGES C CXX VERSION ${VK_VERSION_STRING})
# options for Vulkan-Headers and the Vulkan-Hpp C++20 module
option(VULKAN_HEADERS_ENABLE_TESTS "Test Vulkan-Headers" ${PROJECT_IS_TOP_LEVEL})
option(VULKAN_HEADERS_ENABLE_INSTALL "Install Vulkan-Headers" ${PROJECT_IS_TOP_LEVEL})
option(VULKAN_HEADERS_ENABLE_MODULE "Enables building of the Vulkan C++20 module; requires minimum CMake version 3.28" OFF)
option(VULKAN_HEADERS_ENABLE_MODULE_STD "Enables building of the Vulkan C++20 module with import std; requires minimum CMake version 3.30" OFF)
# set up Vulkan-Headers
add_library(Vulkan-Headers INTERFACE)
add_library(Vulkan::Headers ALIAS Vulkan-Headers)
target_include_directories(Vulkan-Headers INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
if (CMAKE_VERSION VERSION_LESS "3.21")
# https://cmake.org/cmake/help/latest/variable/PROJECT_IS_TOP_LEVEL.html
string(COMPARE EQUAL ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} PROJECT_IS_TOP_LEVEL)
if (VULKAN_HEADERS_ENABLE_MODULE)
# check for compiler support
if ((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND (MSVC_VERSION GREATER_EQUAL "1941")) OR
# clang-cl doesn't currently support modules
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "16.0"
AND (NOT CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC")
AND (NOT CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS STREQUAL CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND)) OR
(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "14.0")
)
# check for CMake support
if(VULKAN_HEADERS_ENABLE_MODULE_STD AND CMAKE_VERSION VERSION_LESS "3.30")
message(FATAL_ERROR "Vulkan-Hpp: C++20 module with import std requires CMake 3.30 or later")
elseif (CMAKE_VERSION VERSION_LESS "3.28")
message(FATAL_ERROR "Vulkan-Hpp: C++20 module requires CMake 3.28 or later")
endif()
# set up Vulkan-HppModule
add_library(Vulkan-HppModule)
add_library(Vulkan::HppModule ALIAS Vulkan-HppModule)
target_sources(Vulkan-HppModule
PUBLIC
FILE_SET module
TYPE CXX_MODULES
FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan/vulkan.cppm")
if (VULKAN_HEADERS_ENABLE_MODULE_STD)
target_compile_features(Vulkan-HppModule
PRIVATE cxx_std_23
INTERFACE cxx_std_20) # only C++20 is required to consume this module
set_target_properties(Vulkan-HppModule PROPERTIES CXX_MODULE_STD ON)
else()
target_compile_features(Vulkan-HppModule PUBLIC cxx_std_20)
endif()
target_link_libraries(Vulkan-HppModule PUBLIC Vulkan::Headers)
# Clang 16's module support can be broken with extensions enabled
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "16.0")
set_target_properties(Vulkan-HppModule PROPERTIES CXX_EXTENSIONS OFF)
endif()
# set up fallback targets to notify about name deprecation
add_library(Vulkan-Module INTERFACE)
add_library(Vulkan::Module ALIAS Vulkan-Module)
target_link_libraries(Vulkan-Module INTERFACE Vulkan::HppModule)
set_target_properties(Vulkan-Module PROPERTIES
DEPRECATION "The Vulkan-Module and Vulkan::Module targets have been deprecated by the Vulkan-HppModule and Vulkan::HppModule targets respectively and will be removed at a future date.")
else()
message(FATAL_ERROR "Vulkan-Hpp: C++20 module support is requested but was disabled due to lacking compiler support on this platform")
endif()
endif()
if (PROJECT_IS_TOP_LEVEL)
option(BUILD_TESTS "Build the tests")
if (BUILD_TESTS)
add_subdirectory(tests)
endif()
if (VULKAN_HEADERS_ENABLE_TESTS)
enable_testing() # This is only effective in the top level CMakeLists.txt file.
add_subdirectory(tests)
endif()
if (VULKAN_HEADERS_ENABLE_INSTALL)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
set(VLK_REGISTRY_DIR "${CMAKE_INSTALL_DATADIR}/vulkan")
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/vk_video" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
# Preserve source permissions https://github.com/KhronosGroup/Vulkan-Headers/issues/336
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/registry" DESTINATION ${VLK_REGISTRY_DIR} USE_SOURCE_PERMISSIONS)
set(cmake_files_install_dir ${CMAKE_INSTALL_DATADIR}/cmake/VulkanHeaders/)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/registry" DESTINATION "${CMAKE_INSTALL_DATADIR}/vulkan" USE_SOURCE_PERMISSIONS)
set_target_properties(Vulkan-Headers PROPERTIES EXPORT_NAME "Headers")
install(TARGETS Vulkan-Headers EXPORT VulkanHeadersConfig INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS Vulkan-Headers EXPORT VulkanHeadersTargets INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(EXPORT VulkanHeadersConfig NAMESPACE "Vulkan::" DESTINATION "share/cmake/VulkanHeaders")
install(EXPORT VulkanHeadersTargets FILE VulkanHeadersTargets.cmake NAMESPACE "Vulkan::" DESTINATION ${cmake_files_install_dir})
set(vulkan_headers_config "${CMAKE_CURRENT_BINARY_DIR}/VulkanHeadersConfig.cmake")
set(VULKAN_HEADERS_REGISTRY_DIRECTORY "${VLK_REGISTRY_DIR}/registry")
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/VulkanHeadersConfig.cmake.in ${vulkan_headers_config}
INSTALL_DESTINATION ${cmake_files_install_dir}
PATH_VARS VULKAN_HEADERS_REGISTRY_DIRECTORY
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
set(config_version "${CMAKE_CURRENT_BINARY_DIR}/VulkanHeadersConfigVersion.cmake")
write_basic_package_version_file(${config_version} COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT)
install(FILES ${config_version} ${vulkan_headers_config} DESTINATION ${cmake_files_install_dir})
set(version_config "${CMAKE_CURRENT_BINARY_DIR}/generated/VulkanHeadersConfigVersion.cmake")
write_basic_package_version_file("${version_config}" COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT)
install(FILES "${version_config}" DESTINATION "share/cmake/VulkanHeaders")
endif()

10
CODE_OF_CONDUCT.adoc Normal file
View file

@ -0,0 +1,10 @@
// Copyright 2018-2023 The Khronos Group Inc.
// SPDX-License-Identifier: MIT
= Code of Conduct
A reminder that this repository is managed by the Khronos Group.
Interactions here should follow the
https://www.khronos.org/about/code-of-conduct[Khronos Code of Conduct],
which prohibits aggressive or derogatory language. Please keep the
discussion friendly and civil.

View file

@ -1 +0,0 @@
A reminder that this issue tracker is managed by the Khronos Group. Interactions here should follow the Khronos Code of Conduct (https://www.khronos.org/developers/code-of-conduct), which prohibits aggressive or derogatory language. Please keep the discussion friendly and civil.

View file

@ -1,3 +1,9 @@
<!--
Copyright 2018-2023 The Khronos Group Inc.
SPDX-License-Identifier: Apache-2.0
-->
# CONTRIBUTING
Please note when contributing what files this repository actually is responsible for.
@ -8,11 +14,9 @@ The majority for the Vulkan headers come from [Vulkan-Docs](https://github.com/K
* BUILD.gn
* BUILD.md
* cmake/
* CMakeLists.txt
* tests/*
* CODE_OF_CONDUCT.md
* INTEGRATION.md
* LICENSE.txt
* README.md
* Non-API headers
@ -33,3 +37,4 @@ split into multiple files. All of those files are now included in this
repository.
* include/vulkan/*.hpp
* include/vulkan/*.cppm

View file

@ -1,99 +0,0 @@
# Integrating Updated Vulkan Headers into Vulkan Repositories
- This guide assumes the [Vulkan-Headers](https://github.com/KhronosGroup/Vulkan-Headers), [Vulkan-Loader](https://github.com/KhronosGroup/Vulkan-Loader), [Vulkan-Tools](https://github.com/KhronosGroup/Vulkan-Tools), [Vulkan-ValidationLayers](https://github.com/KhronosGroup/Vulkan-ValidationLayers), [LunarG/VulkanSamples](https://github.com/LunarG/VulkanSamples), and [LunarG/VulkanTools](https://github.com/LunarG/VulkanTools) repositories have been cloned to a known directory on the system. If necessary, see the `BUILD.md` file in each repository for information on how to clone and build the projects.
- If build issues exist at any point in the Vulkan header integration process, include the fix in the known-good update commit, propose a fix by creating a pull request, or create an issue in the relevant repository and wait for resolution.
# Clone and build the Vulkan-Headers
The first step of integrating Vulkan header updates is to checkout and build the desired Vulkan-Headers commit. Typically this is the latest tagged release.
Pull and build the dependent repositories
Update the Vulkan-Loader, Vulkan-ValidationLayers, and Vulkan-Tools known-good files
### Recommended order for updating the repositories
If the known-good of a repository needs to be updated, all repositories of interest that appear in its known-good files must be updated first using the procedure described in this wiki. See section [5. Update the Known Good Files](https://github.com/KhronosGroup/Vulkan-Headers/wiki/Integrating-Updated-Vulkan-Headers-into-Vulkan-Repositories/#5-update-the-known-good-files) for a list of dependencies per repository. The following list indicates the preferred known-good update order:
1. Vulkan-Loader
1. Vulkan-ValidationLayers
3. Vulkan-Tools
4. LunarG repositories when applicable
**Notes**:
* Typically the Vulkan-Loader's known-good is updated first, but the Vulkan-ValidationLayers known-good can also be updated first.
* The Vulkan-ValidationLayers GitHub CI currently contains a dependency on LunarG-VulkanTools. Occasionally Vulkan-Header updates require changes to be made to LunarG-VulkanTools before updating Vulkan-ValidationLayers known-good files (see the [update LunarG known-good section](https://github.com/KhronosGroup/Vulkan-Headers/wiki/Integrating-Vulkan-Header-Updates-into-Vulkan-Repositories#update-the-lunargvulkantools-and-lunargvulkansamples-known-good-files) below for more information).
### 1. Checkout and pull the `master` branch
Navigate to the directory of the project of interest and checkout the `master` branch. Pull in the most recent commits.
### 2. Generate new source files using `scripts/generate_source.py`
Using your favorite command prompt, navigate to the `scripts` directory and run the `generate_source.py` script. This script requires the specification of the location of the `Vulkan-Headers/registry` directory on the system. An example of how to run this script:
```
./generate_source.py ../../Vulkan-Headers/registry/
```
#### 2-1. Propogate `genvk.py` changes
All Khronos repositories and LunarG/VulkanTools contain a flavor of Vulkan-Headers's `genvk.py`. If `genvk.py` in the Vulkan-Headers repository is modified, the same changes must be made to each version of the file in each repository as part of the header update.
#### 2-2. Vulkan-ValidationLayers sub-step: check for VUID inconsistencies
In Vulkan-ValidationLayers, every time the `generate_source.py` script is run a new VUID database is generated. When VUIDs are added, removed, or modified consistency testing must be performed. The `vk_validation_stats.py` script found in the ValidationLayers `scripts` directory can be used to report consistency warnings using the `-c` option.
```
./vk_validation_stats.py ../../Vulkan-Headers/registry/validusage.json -c
```
All consistency warnings must be resolved and included in the pull request for the repository's known-good update.
### 3. Build the project
Build the project, referring to the `BUILD.md` file in the directory if necessary.
### 4. Test the build
- To test the Vulkan-Loader build, run the loader tests (`run_all_tests.sh`) found in the `build/tests` directory. Information on how to build and run the tests can be found in the [Vulkan-Loader `BUILD.md`](https://github.com/KhronosGroup/Vulkan-Loader/blob/master/BUILD.md) file. **Note**: The `VK_LAYER_PATH` environment variable must be set to point at the layers found in `Vulkan-Loader/build/tests/layers` when running the loader tests.
- To test the Vulkan-ValidationLayers build, run the validation layers tests (`vk_layer_validation_tests`) found in the `build/tests` directory. Information on how to build and run the tests can be found in the [Vulkan-ValidationLayers `BUILD.md`](https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/BUILD.md) file.
- To test the Vulkan-Tools build, run `vkcube` and verify `vulkaninfo` produces reasonable output. More information on how to use `vulkaninfo` can be found [here](https://github.com/KhronosGroup/Vulkan-Tools/blob/master/vulkaninfo/vulkaninfo.md).
### 5. Update the known-good files
Every repository contains a `scripts/known_good.json` file which contains information about the known good commits for each dependent repository. Some repositories require an additional known-good file to be updated for Android builds and are specified below. Known-good updates require updating only the "commit" values of the relevant JSON objects. Using an existing tag for this value is preferred over using a full commit id. If a tag does not exist, typically the most recent commit on `master` is chosen for updating the known good. **Note**: Do not change commit values for repositories not listed below unless an update is absolutely required.
- Vulkan-Loader: Update requires specifying a new `Vulkan-Headers` commit in `scripts/known_good.json`
- Vulkan-ValidationLayers: Update requires specifying a new `Vulkan-Headers` commit in `scripts/known_good.json`. Additionally, new `Vulkan-Headers` and `Vulkan-Tools` commits must be specified in the `build-android/known_good.json` file.
- Vulkan-Tools: Update requires specifying new `Vulkan-Headers` and `Vulkan-Loader` commits in `scripts/known_good.json`. Additionally, a new `Vulkan-Headers` commit must be specified in the `vulkan-headers_revision_android` file.
### 6. Commit changes
Commit all changes (e.g., newly generated scripts, known-good files, etc.) in a single commit on a branch and push it up to the online repository. In Vulkan-ValidationLayers, VUID inconsistency resolutions can be included in a single commit with the known-good update or on the same branch in a separate commit.
### 7. Create a pull request in the relevant repository
Verify the branch with the proposed known-good commit is rebased on the tip of `master` and create a pull request in the GitHub repository. The repository owner will assign someone with push rights and specify reviewers for the PR. Prior to approval, the proposed changes will be run through internal LunarG CI testing.
### 8. Rebase changes onto `master`
Once the known-good update PR is approved, the assignee will rebase the approved commits onto the `master` branch.
### 9. Tag the known-good commit
Once approved and rebased onto `master`, the known-good update commit must be marked with a version tag. For more information on the version tag format see the "Version Tagging Scheme" section of each repository's `BUILD.md` file
## Update the LunarG/VulkanTools and LunarG/VulkanSamples known-good files
Updating the Known-good files in LunarG repositories follows the same steps as updating the known-good files in the Khronos repositories.
### Testing LunarG builds
- LunarG/VulkanTools: Build Debug and Release on Linux and Windows. Verify vktrace/replay works. Verify several of the layers built in this repo work.
- LunarG/VulkanSamples: Build all and run a few of the Vulkan Samples. Instructions on how to build and run the LunarG Vulkan samples can be found in the repository's [`BUILD.md` file](https://github.com/LunarG/VulkanSamples/blob/master/BUILD.md).
### Updating LunarG known-good files
- LunarG/VulkanTools: Update requires specifying new `Vulkan-Headers`, `Vulkan-Loader`, `Vulkan-Tools`, and `Vulkan-ValidationLayers` commits in `scripts/known_good.json`. Additionally, the new `Vulkan-Headers` commit must be specified in the `build-android/vulkan-headers_revision_android` file and the new `Vulkan-Tools` commit must be specified in the `build-android/vulkan-tools_revision_android` file.
- LunarG/VulkanSamples: Update requires specifying new `Vulkan-Headers` and `Vulkan-Loader` commits in `scripts/known_good.json`.

18
LICENSE.md Normal file
View file

@ -0,0 +1,18 @@
Copyright 2015-2023 The Khronos Group Inc.
Files in this repository fall under one of these licenses:
- `Apache-2.0`
- `MIT`
Note: With the exception of `parse_dependency.py` the files using `MIT` license
also fall under `Apache-2.0`. Example:
```
SPDX-License-Identifier: Apache-2.0 OR MIT
```
Full license text of these licenses is available at:
* Apache-2.0: https://opensource.org/licenses/Apache-2.0
* MIT: https://opensource.org/licenses/MIT

9
LICENSES/MIT.txt Normal file
View file

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2015-2023 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

110
Makefile.release Normal file
View file

@ -0,0 +1,110 @@
# Copyright 2024 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
# Makefile.release - update external files generated in Vulkan spec
# repository when a public specification update is done.
# Needed to get the right version of test, apparently
SHELL = /bin/bash
REVISION = 999
# Location of other repository clones
GIT = ..
SPEC = $(GIT)/Vulkan-Docs
HPP = $(GIT)/Vulkan-Hpp
REGISTRY = $(GIT)/registry/vulkan
update: version-check create-branch update-files push-branch
# Working branch for the update, and a test if it exists
BRANCH = update-$(REVISION)
# Switch to new branch which will contain the update
create-branch: version-check
git switch -q main
git pull -q
# If branch already exists, do nothing
@if test `git branch -l $(BRANCH) | wc -l` == 1 ; then \
echo "Branch $(BRANCH) already exists" ; \
git switch $(BRANCH) ; \
else \
echo "Creating branch $(BRANCH)" ; \
git switch -c $(BRANCH) ; \
fi
# Update headers and scripts in the new branch
update-files: remove-files update-headers update-scripts
# Vulkan SC Vulkan-Hpp headers not published in the Vulkan-Headers repository
SCHPPFILES = \
include/vulkan/vulkansc.hpp \
include/vulkan/vulkansc.cppm \
include/vulkan/vulkansc_*.hpp
update-headers:
if test ! -d $(SPEC)/gen/include/ ; then \
echo "No C header file source directory $(SPEC)/gen/include" ; \
exit 1 ; \
fi
if test ! -d $(HPP)/vulkan ; then \
echo "No C++ header file source directory $(HPP)/vulkan" ; \
exit 1 ; \
fi
cp -r $(SPEC)/gen/include/* include/
cp -r $(HPP)/vulkan/* include/vulkan/
rm -f $(SCHPPFILES)
# Top-level scripts / XML to install
SCRIPTS = \
$(SPEC)/scripts/base_generator.py \
$(SPEC)/scripts/cgenerator.py \
$(SPEC)/scripts/generator.py \
$(SPEC)/scripts/parse_dependency.py \
$(SPEC)/scripts/reg.py \
$(SPEC)/scripts/stripAPI.py \
$(SPEC)/scripts/apiconventions.py \
$(SPEC)/scripts/vkconventions.py \
$(SPEC)/scripts/vulkan_object.py \
$(SPEC)/xml/vk.xml \
$(SPEC)/xml/video.xml \
$(REGISTRY)/specs/latest/validation/validusage.json
# Scripts in registry/spec_tools to install
SCRIPT_TOOLS = \
$(SPEC)/scripts/spec_tools/conventions.py \
$(SPEC)/scripts/spec_tools/util.py
# Profiles to install
PROFILES = \
$(wildcard $(SPEC)/xml/profiles/*)
update-scripts:
cp $(SCRIPTS) registry/
cp $(PROFILES) registry/profiles/
cp $(SCRIPT_TOOLS) registry/spec_tools/
# To ensure updates are caught, old versions of installed files are
# removed.
# Files in include/ to keep
HEADERS_KEEP = \
include/vulkan/vk_icd.h \
include/vulkan/vk_layer.h
remove-files:
rm -rf $(filter-out $(HEADERS_KEEP), $(wildcard include/vulkan/*))
rm -rf include/vk_video
rm -rf registry
mkdir include/vk_video registry registry/profiles registry/spec_tools
# Once the branch is updated, push it to upstream
# This does not actually push it for safety reasons
push-branch:
@echo Verify that all new files are 'git add'ed and obsolete files removed, then:
@echo git commit -m \"Update for Vulkan-Docs 1.3.$(REVISION)\"
@echo git push --set-upstream origin $(BRANCH)
@echo git switch main
version-check:
@if test $(REVISION) = 999 ; then echo "Must specify explicit REVISION= in make invocation" ; exit 1 ; fi

View file

@ -1,7 +1,32 @@
<!--
Copyright 2018-2023 The Khronos Group Inc.
SPDX-License-Identifier: Apache-2.0
-->
# Vulkan-Headers
Vulkan header files and API registry
This repository contains Vulkan header files, include files for C and C++,
and related scripts and tests.
Most of the files in this repository are sourced from, or generated from,
other repositories as described in [CONTRIBUTING.md](CONTRIBUTING.md).
Vulkan-Headers exists as a staging area for these files, most of which are
then consumed by downstream repositories used to build SDK components such
as the Vulkan Validation Layers and Conformance Test Suite.
Developers normally obtain headers from the official
[Vulkan-SDK](https://www.lunarg.com/vulkan-sdk/).
They can also use headers from, or packaged from, this repository.
In most cases, developers should only need the headers, not the scripts and
other material in this repository.
If you need to run the scripts, please use them from their canonical source
in the [Vulkan Specification
repository](https://github.com/KhronosGroup/Vulkan-Docs).
## Contributing
See the [CONTRIBUTING.md](CONTRIBUTING.md)
@ -20,10 +45,8 @@ Vulkan-Headers are shipped as part of the official [Vulkan-SDK](https://www.luna
## Version Tagging Scheme
Updates to the `Vulkan-Headers` repository which correspond to a new Vulkan
specification release are tagged using the following format:
`v<`_`version`_`>` (e.g., `v1.1.96`).
Updates to this repository which correspond to a new Vulkan specification release are tagged using the following format: `v<`_`version`_`>` (e.g., `v1.3.266`).
**Note**: Marked version releases have undergone thorough testing but do not
imply the same quality level as SDK tags. SDK tags follow the
`sdk-<`_`version`_`>.<`_`patch`_`>` format (e.g., `sdk-1.1.92.0`).
**Note**: Marked version releases have undergone thorough testing but do not imply the same quality level as SDK tags. SDK tags follow the `vulkan-sdk-<`_`version`_`>.<`_`patch`_`>` format (e.g., `vulkan-sdk-1.3.266.0`).
This scheme was adopted following the `1.3.266` Vulkan specification release.

11
SECURITY.md Normal file
View file

@ -0,0 +1,11 @@
<!--
Copyright 2023 The Khronos Group Inc.
SPDX-License-Identifier: Apache-2.0
-->
# Security Policy
To report a security issue, please disclose it at [security advisory](https://github.com/KhronosGroup/Vulkan-Headers/security/advisories/new).
This project is maintained by a team of volunteers on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure.

View file

@ -1,5 +0,0 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/VulkanHeadersTargets.cmake")
set(VULKAN_HEADERS_REGISTRY_DIRECTORY "@PACKAGE_VULKAN_HEADERS_REGISTRY_DIRECTORY@")

View file

@ -0,0 +1,394 @@
#ifndef VULKAN_VIDEO_CODEC_AV1STD_H_
#define VULKAN_VIDEO_CODEC_AV1STD_H_ 1
/*
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus
extern "C" {
#endif
// vulkan_video_codec_av1std is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_av1std 1
#include "vulkan_video_codecs_common.h"
#define STD_VIDEO_AV1_NUM_REF_FRAMES 8
#define STD_VIDEO_AV1_REFS_PER_FRAME 7
#define STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME 8
#define STD_VIDEO_AV1_MAX_TILE_COLS 64
#define STD_VIDEO_AV1_MAX_TILE_ROWS 64
#define STD_VIDEO_AV1_MAX_SEGMENTS 8
#define STD_VIDEO_AV1_SEG_LVL_MAX 8
#define STD_VIDEO_AV1_PRIMARY_REF_NONE 7
#define STD_VIDEO_AV1_SELECT_INTEGER_MV 2
#define STD_VIDEO_AV1_SELECT_SCREEN_CONTENT_TOOLS 2
#define STD_VIDEO_AV1_SKIP_MODE_FRAMES 2
#define STD_VIDEO_AV1_MAX_LOOP_FILTER_STRENGTHS 4
#define STD_VIDEO_AV1_LOOP_FILTER_ADJUSTMENTS 2
#define STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS 8
#define STD_VIDEO_AV1_MAX_NUM_PLANES 3
#define STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS 6
#define STD_VIDEO_AV1_MAX_NUM_Y_POINTS 14
#define STD_VIDEO_AV1_MAX_NUM_CB_POINTS 10
#define STD_VIDEO_AV1_MAX_NUM_CR_POINTS 10
#define STD_VIDEO_AV1_MAX_NUM_POS_LUMA 24
#define STD_VIDEO_AV1_MAX_NUM_POS_CHROMA 25
typedef enum StdVideoAV1Profile {
STD_VIDEO_AV1_PROFILE_MAIN = 0,
STD_VIDEO_AV1_PROFILE_HIGH = 1,
STD_VIDEO_AV1_PROFILE_PROFESSIONAL = 2,
STD_VIDEO_AV1_PROFILE_INVALID = 0x7FFFFFFF,
STD_VIDEO_AV1_PROFILE_MAX_ENUM = 0x7FFFFFFF
} StdVideoAV1Profile;
typedef enum StdVideoAV1Level {
STD_VIDEO_AV1_LEVEL_2_0 = 0,
STD_VIDEO_AV1_LEVEL_2_1 = 1,
STD_VIDEO_AV1_LEVEL_2_2 = 2,
STD_VIDEO_AV1_LEVEL_2_3 = 3,
STD_VIDEO_AV1_LEVEL_3_0 = 4,
STD_VIDEO_AV1_LEVEL_3_1 = 5,
STD_VIDEO_AV1_LEVEL_3_2 = 6,
STD_VIDEO_AV1_LEVEL_3_3 = 7,
STD_VIDEO_AV1_LEVEL_4_0 = 8,
STD_VIDEO_AV1_LEVEL_4_1 = 9,
STD_VIDEO_AV1_LEVEL_4_2 = 10,
STD_VIDEO_AV1_LEVEL_4_3 = 11,
STD_VIDEO_AV1_LEVEL_5_0 = 12,
STD_VIDEO_AV1_LEVEL_5_1 = 13,
STD_VIDEO_AV1_LEVEL_5_2 = 14,
STD_VIDEO_AV1_LEVEL_5_3 = 15,
STD_VIDEO_AV1_LEVEL_6_0 = 16,
STD_VIDEO_AV1_LEVEL_6_1 = 17,
STD_VIDEO_AV1_LEVEL_6_2 = 18,
STD_VIDEO_AV1_LEVEL_6_3 = 19,
STD_VIDEO_AV1_LEVEL_7_0 = 20,
STD_VIDEO_AV1_LEVEL_7_1 = 21,
STD_VIDEO_AV1_LEVEL_7_2 = 22,
STD_VIDEO_AV1_LEVEL_7_3 = 23,
STD_VIDEO_AV1_LEVEL_INVALID = 0x7FFFFFFF,
STD_VIDEO_AV1_LEVEL_MAX_ENUM = 0x7FFFFFFF
} StdVideoAV1Level;
typedef enum StdVideoAV1FrameType {
STD_VIDEO_AV1_FRAME_TYPE_KEY = 0,
STD_VIDEO_AV1_FRAME_TYPE_INTER = 1,
STD_VIDEO_AV1_FRAME_TYPE_INTRA_ONLY = 2,
STD_VIDEO_AV1_FRAME_TYPE_SWITCH = 3,
STD_VIDEO_AV1_FRAME_TYPE_INVALID = 0x7FFFFFFF,
STD_VIDEO_AV1_FRAME_TYPE_MAX_ENUM = 0x7FFFFFFF
} StdVideoAV1FrameType;
typedef enum StdVideoAV1ReferenceName {
STD_VIDEO_AV1_REFERENCE_NAME_INTRA_FRAME = 0,
STD_VIDEO_AV1_REFERENCE_NAME_LAST_FRAME = 1,
STD_VIDEO_AV1_REFERENCE_NAME_LAST2_FRAME = 2,
STD_VIDEO_AV1_REFERENCE_NAME_LAST3_FRAME = 3,
STD_VIDEO_AV1_REFERENCE_NAME_GOLDEN_FRAME = 4,
STD_VIDEO_AV1_REFERENCE_NAME_BWDREF_FRAME = 5,
STD_VIDEO_AV1_REFERENCE_NAME_ALTREF2_FRAME = 6,
STD_VIDEO_AV1_REFERENCE_NAME_ALTREF_FRAME = 7,
STD_VIDEO_AV1_REFERENCE_NAME_INVALID = 0x7FFFFFFF,
STD_VIDEO_AV1_REFERENCE_NAME_MAX_ENUM = 0x7FFFFFFF
} StdVideoAV1ReferenceName;
typedef enum StdVideoAV1InterpolationFilter {
STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP = 0,
STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH = 1,
STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP_SHARP = 2,
STD_VIDEO_AV1_INTERPOLATION_FILTER_BILINEAR = 3,
STD_VIDEO_AV1_INTERPOLATION_FILTER_SWITCHABLE = 4,
STD_VIDEO_AV1_INTERPOLATION_FILTER_INVALID = 0x7FFFFFFF,
STD_VIDEO_AV1_INTERPOLATION_FILTER_MAX_ENUM = 0x7FFFFFFF
} StdVideoAV1InterpolationFilter;
typedef enum StdVideoAV1TxMode {
STD_VIDEO_AV1_TX_MODE_ONLY_4X4 = 0,
STD_VIDEO_AV1_TX_MODE_LARGEST = 1,
STD_VIDEO_AV1_TX_MODE_SELECT = 2,
STD_VIDEO_AV1_TX_MODE_INVALID = 0x7FFFFFFF,
STD_VIDEO_AV1_TX_MODE_MAX_ENUM = 0x7FFFFFFF
} StdVideoAV1TxMode;
typedef enum StdVideoAV1FrameRestorationType {
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_NONE = 0,
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_WIENER = 1,
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SGRPROJ = 2,
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SWITCHABLE = 3,
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_INVALID = 0x7FFFFFFF,
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_MAX_ENUM = 0x7FFFFFFF
} StdVideoAV1FrameRestorationType;
typedef enum StdVideoAV1ColorPrimaries {
STD_VIDEO_AV1_COLOR_PRIMARIES_BT_709 = 1,
STD_VIDEO_AV1_COLOR_PRIMARIES_UNSPECIFIED = 2,
STD_VIDEO_AV1_COLOR_PRIMARIES_BT_470_M = 4,
STD_VIDEO_AV1_COLOR_PRIMARIES_BT_470_B_G = 5,
STD_VIDEO_AV1_COLOR_PRIMARIES_BT_601 = 6,
STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_240 = 7,
STD_VIDEO_AV1_COLOR_PRIMARIES_GENERIC_FILM = 8,
STD_VIDEO_AV1_COLOR_PRIMARIES_BT_2020 = 9,
STD_VIDEO_AV1_COLOR_PRIMARIES_XYZ = 10,
STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_431 = 11,
STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_432 = 12,
STD_VIDEO_AV1_COLOR_PRIMARIES_EBU_3213 = 22,
STD_VIDEO_AV1_COLOR_PRIMARIES_INVALID = 0x7FFFFFFF,
// STD_VIDEO_AV1_COLOR_PRIMARIES_BT_UNSPECIFIED is a deprecated alias
STD_VIDEO_AV1_COLOR_PRIMARIES_BT_UNSPECIFIED = STD_VIDEO_AV1_COLOR_PRIMARIES_UNSPECIFIED,
STD_VIDEO_AV1_COLOR_PRIMARIES_MAX_ENUM = 0x7FFFFFFF
} StdVideoAV1ColorPrimaries;
typedef enum StdVideoAV1TransferCharacteristics {
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_RESERVED_0 = 0,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_709 = 1,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_UNSPECIFIED = 2,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_RESERVED_3 = 3,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_470_M = 4,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_470_B_G = 5,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_601 = 6,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_240 = 7,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LINEAR = 8,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LOG_100 = 9,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LOG_100_SQRT10 = 10,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_IEC_61966 = 11,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_1361 = 12,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SRGB = 13,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_2020_10_BIT = 14,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_2020_12_BIT = 15,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_2084 = 16,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_428 = 17,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_HLG = 18,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_INVALID = 0x7FFFFFFF,
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_MAX_ENUM = 0x7FFFFFFF
} StdVideoAV1TransferCharacteristics;
typedef enum StdVideoAV1MatrixCoefficients {
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_IDENTITY = 0,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_709 = 1,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_UNSPECIFIED = 2,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_RESERVED_3 = 3,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_FCC = 4,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_470_B_G = 5,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_601 = 6,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_240 = 7,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_YCGCO = 8,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_2020_NCL = 9,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_2020_CL = 10,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_2085 = 11,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_CHROMAT_NCL = 12,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_CHROMAT_CL = 13,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_ICTCP = 14,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_INVALID = 0x7FFFFFFF,
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_MAX_ENUM = 0x7FFFFFFF
} StdVideoAV1MatrixCoefficients;
typedef enum StdVideoAV1ChromaSamplePosition {
STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_UNKNOWN = 0,
STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_VERTICAL = 1,
STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_COLOCATED = 2,
STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_RESERVED = 3,
STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_INVALID = 0x7FFFFFFF,
STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_MAX_ENUM = 0x7FFFFFFF
} StdVideoAV1ChromaSamplePosition;
typedef struct StdVideoAV1ColorConfigFlags {
uint32_t mono_chrome : 1;
uint32_t color_range : 1;
uint32_t separate_uv_delta_q : 1;
uint32_t color_description_present_flag : 1;
uint32_t reserved : 28;
} StdVideoAV1ColorConfigFlags;
typedef struct StdVideoAV1ColorConfig {
StdVideoAV1ColorConfigFlags flags;
uint8_t BitDepth;
uint8_t subsampling_x;
uint8_t subsampling_y;
uint8_t reserved1;
StdVideoAV1ColorPrimaries color_primaries;
StdVideoAV1TransferCharacteristics transfer_characteristics;
StdVideoAV1MatrixCoefficients matrix_coefficients;
StdVideoAV1ChromaSamplePosition chroma_sample_position;
} StdVideoAV1ColorConfig;
typedef struct StdVideoAV1TimingInfoFlags {
uint32_t equal_picture_interval : 1;
uint32_t reserved : 31;
} StdVideoAV1TimingInfoFlags;
typedef struct StdVideoAV1TimingInfo {
StdVideoAV1TimingInfoFlags flags;
uint32_t num_units_in_display_tick;
uint32_t time_scale;
uint32_t num_ticks_per_picture_minus_1;
} StdVideoAV1TimingInfo;
typedef struct StdVideoAV1LoopFilterFlags {
uint32_t loop_filter_delta_enabled : 1;
uint32_t loop_filter_delta_update : 1;
uint32_t reserved : 30;
} StdVideoAV1LoopFilterFlags;
typedef struct StdVideoAV1LoopFilter {
StdVideoAV1LoopFilterFlags flags;
uint8_t loop_filter_level[STD_VIDEO_AV1_MAX_LOOP_FILTER_STRENGTHS];
uint8_t loop_filter_sharpness;
uint8_t update_ref_delta;
int8_t loop_filter_ref_deltas[STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME];
uint8_t update_mode_delta;
int8_t loop_filter_mode_deltas[STD_VIDEO_AV1_LOOP_FILTER_ADJUSTMENTS];
} StdVideoAV1LoopFilter;
typedef struct StdVideoAV1QuantizationFlags {
uint32_t using_qmatrix : 1;
uint32_t diff_uv_delta : 1;
uint32_t reserved : 30;
} StdVideoAV1QuantizationFlags;
typedef struct StdVideoAV1Quantization {
StdVideoAV1QuantizationFlags flags;
uint8_t base_q_idx;
int8_t DeltaQYDc;
int8_t DeltaQUDc;
int8_t DeltaQUAc;
int8_t DeltaQVDc;
int8_t DeltaQVAc;
uint8_t qm_y;
uint8_t qm_u;
uint8_t qm_v;
} StdVideoAV1Quantization;
typedef struct StdVideoAV1Segmentation {
uint8_t FeatureEnabled[STD_VIDEO_AV1_MAX_SEGMENTS];
int16_t FeatureData[STD_VIDEO_AV1_MAX_SEGMENTS][STD_VIDEO_AV1_SEG_LVL_MAX];
} StdVideoAV1Segmentation;
typedef struct StdVideoAV1TileInfoFlags {
uint32_t uniform_tile_spacing_flag : 1;
uint32_t reserved : 31;
} StdVideoAV1TileInfoFlags;
typedef struct StdVideoAV1TileInfo {
StdVideoAV1TileInfoFlags flags;
uint8_t TileCols;
uint8_t TileRows;
uint16_t context_update_tile_id;
uint8_t tile_size_bytes_minus_1;
uint8_t reserved1[7];
const uint16_t* pMiColStarts;
const uint16_t* pMiRowStarts;
const uint16_t* pWidthInSbsMinus1;
const uint16_t* pHeightInSbsMinus1;
} StdVideoAV1TileInfo;
typedef struct StdVideoAV1CDEF {
uint8_t cdef_damping_minus_3;
uint8_t cdef_bits;
uint8_t cdef_y_pri_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS];
uint8_t cdef_y_sec_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS];
uint8_t cdef_uv_pri_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS];
uint8_t cdef_uv_sec_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS];
} StdVideoAV1CDEF;
typedef struct StdVideoAV1LoopRestoration {
StdVideoAV1FrameRestorationType FrameRestorationType[STD_VIDEO_AV1_MAX_NUM_PLANES];
uint16_t LoopRestorationSize[STD_VIDEO_AV1_MAX_NUM_PLANES];
} StdVideoAV1LoopRestoration;
typedef struct StdVideoAV1GlobalMotion {
uint8_t GmType[STD_VIDEO_AV1_NUM_REF_FRAMES];
int32_t gm_params[STD_VIDEO_AV1_NUM_REF_FRAMES][STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS];
} StdVideoAV1GlobalMotion;
typedef struct StdVideoAV1FilmGrainFlags {
uint32_t chroma_scaling_from_luma : 1;
uint32_t overlap_flag : 1;
uint32_t clip_to_restricted_range : 1;
uint32_t update_grain : 1;
uint32_t reserved : 28;
} StdVideoAV1FilmGrainFlags;
typedef struct StdVideoAV1FilmGrain {
StdVideoAV1FilmGrainFlags flags;
uint8_t grain_scaling_minus_8;
uint8_t ar_coeff_lag;
uint8_t ar_coeff_shift_minus_6;
uint8_t grain_scale_shift;
uint16_t grain_seed;
uint8_t film_grain_params_ref_idx;
uint8_t num_y_points;
uint8_t point_y_value[STD_VIDEO_AV1_MAX_NUM_Y_POINTS];
uint8_t point_y_scaling[STD_VIDEO_AV1_MAX_NUM_Y_POINTS];
uint8_t num_cb_points;
uint8_t point_cb_value[STD_VIDEO_AV1_MAX_NUM_CB_POINTS];
uint8_t point_cb_scaling[STD_VIDEO_AV1_MAX_NUM_CB_POINTS];
uint8_t num_cr_points;
uint8_t point_cr_value[STD_VIDEO_AV1_MAX_NUM_CR_POINTS];
uint8_t point_cr_scaling[STD_VIDEO_AV1_MAX_NUM_CR_POINTS];
int8_t ar_coeffs_y_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_LUMA];
int8_t ar_coeffs_cb_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_CHROMA];
int8_t ar_coeffs_cr_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_CHROMA];
uint8_t cb_mult;
uint8_t cb_luma_mult;
uint16_t cb_offset;
uint8_t cr_mult;
uint8_t cr_luma_mult;
uint16_t cr_offset;
} StdVideoAV1FilmGrain;
typedef struct StdVideoAV1SequenceHeaderFlags {
uint32_t still_picture : 1;
uint32_t reduced_still_picture_header : 1;
uint32_t use_128x128_superblock : 1;
uint32_t enable_filter_intra : 1;
uint32_t enable_intra_edge_filter : 1;
uint32_t enable_interintra_compound : 1;
uint32_t enable_masked_compound : 1;
uint32_t enable_warped_motion : 1;
uint32_t enable_dual_filter : 1;
uint32_t enable_order_hint : 1;
uint32_t enable_jnt_comp : 1;
uint32_t enable_ref_frame_mvs : 1;
uint32_t frame_id_numbers_present_flag : 1;
uint32_t enable_superres : 1;
uint32_t enable_cdef : 1;
uint32_t enable_restoration : 1;
uint32_t film_grain_params_present : 1;
uint32_t timing_info_present_flag : 1;
uint32_t initial_display_delay_present_flag : 1;
uint32_t reserved : 13;
} StdVideoAV1SequenceHeaderFlags;
typedef struct StdVideoAV1SequenceHeader {
StdVideoAV1SequenceHeaderFlags flags;
StdVideoAV1Profile seq_profile;
uint8_t frame_width_bits_minus_1;
uint8_t frame_height_bits_minus_1;
uint16_t max_frame_width_minus_1;
uint16_t max_frame_height_minus_1;
uint8_t delta_frame_id_length_minus_2;
uint8_t additional_frame_id_length_minus_1;
uint8_t order_hint_bits_minus_1;
uint8_t seq_force_integer_mv;
uint8_t seq_force_screen_content_tools;
uint8_t reserved1[5];
const StdVideoAV1ColorConfig* pColorConfig;
const StdVideoAV1TimingInfo* pTimingInfo;
} StdVideoAV1SequenceHeader;
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,109 @@
#ifndef VULKAN_VIDEO_CODEC_AV1STD_DECODE_H_
#define VULKAN_VIDEO_CODEC_AV1STD_DECODE_H_ 1
/*
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus
extern "C" {
#endif
// vulkan_video_codec_av1std_decode is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_av1std_decode 1
#include "vulkan_video_codec_av1std.h"
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0)
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_API_VERSION_1_0_0
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_av1_decode"
typedef struct StdVideoDecodeAV1PictureInfoFlags {
uint32_t error_resilient_mode : 1;
uint32_t disable_cdf_update : 1;
uint32_t use_superres : 1;
uint32_t render_and_frame_size_different : 1;
uint32_t allow_screen_content_tools : 1;
uint32_t is_filter_switchable : 1;
uint32_t force_integer_mv : 1;
uint32_t frame_size_override_flag : 1;
uint32_t buffer_removal_time_present_flag : 1;
uint32_t allow_intrabc : 1;
uint32_t frame_refs_short_signaling : 1;
uint32_t allow_high_precision_mv : 1;
uint32_t is_motion_mode_switchable : 1;
uint32_t use_ref_frame_mvs : 1;
uint32_t disable_frame_end_update_cdf : 1;
uint32_t allow_warped_motion : 1;
uint32_t reduced_tx_set : 1;
uint32_t reference_select : 1;
uint32_t skip_mode_present : 1;
uint32_t delta_q_present : 1;
uint32_t delta_lf_present : 1;
uint32_t delta_lf_multi : 1;
uint32_t segmentation_enabled : 1;
uint32_t segmentation_update_map : 1;
uint32_t segmentation_temporal_update : 1;
uint32_t segmentation_update_data : 1;
uint32_t UsesLr : 1;
uint32_t usesChromaLr : 1;
uint32_t apply_grain : 1;
uint32_t reserved : 3;
} StdVideoDecodeAV1PictureInfoFlags;
typedef struct StdVideoDecodeAV1PictureInfo {
StdVideoDecodeAV1PictureInfoFlags flags;
StdVideoAV1FrameType frame_type;
uint32_t current_frame_id;
uint8_t OrderHint;
uint8_t primary_ref_frame;
uint8_t refresh_frame_flags;
uint8_t reserved1;
StdVideoAV1InterpolationFilter interpolation_filter;
StdVideoAV1TxMode TxMode;
uint8_t delta_q_res;
uint8_t delta_lf_res;
uint8_t SkipModeFrame[STD_VIDEO_AV1_SKIP_MODE_FRAMES];
uint8_t coded_denom;
uint8_t reserved2[3];
uint8_t OrderHints[STD_VIDEO_AV1_NUM_REF_FRAMES];
uint32_t expectedFrameId[STD_VIDEO_AV1_NUM_REF_FRAMES];
const StdVideoAV1TileInfo* pTileInfo;
const StdVideoAV1Quantization* pQuantization;
const StdVideoAV1Segmentation* pSegmentation;
const StdVideoAV1LoopFilter* pLoopFilter;
const StdVideoAV1CDEF* pCDEF;
const StdVideoAV1LoopRestoration* pLoopRestoration;
const StdVideoAV1GlobalMotion* pGlobalMotion;
const StdVideoAV1FilmGrain* pFilmGrain;
} StdVideoDecodeAV1PictureInfo;
typedef struct StdVideoDecodeAV1ReferenceInfoFlags {
uint32_t disable_frame_end_update_cdf : 1;
uint32_t segmentation_enabled : 1;
uint32_t reserved : 30;
} StdVideoDecodeAV1ReferenceInfoFlags;
typedef struct StdVideoDecodeAV1ReferenceInfo {
StdVideoDecodeAV1ReferenceInfoFlags flags;
uint8_t frame_type;
uint8_t RefFrameSignBias;
uint8_t OrderHint;
uint8_t SavedOrderHints[STD_VIDEO_AV1_NUM_REF_FRAMES];
} StdVideoDecodeAV1ReferenceInfo;
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,143 @@
#ifndef VULKAN_VIDEO_CODEC_AV1STD_ENCODE_H_
#define VULKAN_VIDEO_CODEC_AV1STD_ENCODE_H_ 1
/*
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus
extern "C" {
#endif
// vulkan_video_codec_av1std_encode is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_av1std_encode 1
#include "vulkan_video_codec_av1std.h"
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0)
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_API_VERSION_1_0_0
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_av1_encode"
typedef struct StdVideoEncodeAV1DecoderModelInfo {
uint8_t buffer_delay_length_minus_1;
uint8_t buffer_removal_time_length_minus_1;
uint8_t frame_presentation_time_length_minus_1;
uint8_t reserved1;
uint32_t num_units_in_decoding_tick;
} StdVideoEncodeAV1DecoderModelInfo;
typedef struct StdVideoEncodeAV1ExtensionHeader {
uint8_t temporal_id;
uint8_t spatial_id;
} StdVideoEncodeAV1ExtensionHeader;
typedef struct StdVideoEncodeAV1OperatingPointInfoFlags {
uint32_t decoder_model_present_for_this_op : 1;
uint32_t low_delay_mode_flag : 1;
uint32_t initial_display_delay_present_for_this_op : 1;
uint32_t reserved : 29;
} StdVideoEncodeAV1OperatingPointInfoFlags;
typedef struct StdVideoEncodeAV1OperatingPointInfo {
StdVideoEncodeAV1OperatingPointInfoFlags flags;
uint16_t operating_point_idc;
uint8_t seq_level_idx;
uint8_t seq_tier;
uint32_t decoder_buffer_delay;
uint32_t encoder_buffer_delay;
uint8_t initial_display_delay_minus_1;
} StdVideoEncodeAV1OperatingPointInfo;
typedef struct StdVideoEncodeAV1PictureInfoFlags {
uint32_t error_resilient_mode : 1;
uint32_t disable_cdf_update : 1;
uint32_t use_superres : 1;
uint32_t render_and_frame_size_different : 1;
uint32_t allow_screen_content_tools : 1;
uint32_t is_filter_switchable : 1;
uint32_t force_integer_mv : 1;
uint32_t frame_size_override_flag : 1;
uint32_t buffer_removal_time_present_flag : 1;
uint32_t allow_intrabc : 1;
uint32_t frame_refs_short_signaling : 1;
uint32_t allow_high_precision_mv : 1;
uint32_t is_motion_mode_switchable : 1;
uint32_t use_ref_frame_mvs : 1;
uint32_t disable_frame_end_update_cdf : 1;
uint32_t allow_warped_motion : 1;
uint32_t reduced_tx_set : 1;
uint32_t skip_mode_present : 1;
uint32_t delta_q_present : 1;
uint32_t delta_lf_present : 1;
uint32_t delta_lf_multi : 1;
uint32_t segmentation_enabled : 1;
uint32_t segmentation_update_map : 1;
uint32_t segmentation_temporal_update : 1;
uint32_t segmentation_update_data : 1;
uint32_t UsesLr : 1;
uint32_t usesChromaLr : 1;
uint32_t show_frame : 1;
uint32_t showable_frame : 1;
uint32_t reserved : 3;
} StdVideoEncodeAV1PictureInfoFlags;
typedef struct StdVideoEncodeAV1PictureInfo {
StdVideoEncodeAV1PictureInfoFlags flags;
StdVideoAV1FrameType frame_type;
uint32_t frame_presentation_time;
uint32_t current_frame_id;
uint8_t order_hint;
uint8_t primary_ref_frame;
uint8_t refresh_frame_flags;
uint8_t coded_denom;
uint16_t render_width_minus_1;
uint16_t render_height_minus_1;
StdVideoAV1InterpolationFilter interpolation_filter;
StdVideoAV1TxMode TxMode;
uint8_t delta_q_res;
uint8_t delta_lf_res;
uint8_t ref_order_hint[STD_VIDEO_AV1_NUM_REF_FRAMES];
int8_t ref_frame_idx[STD_VIDEO_AV1_REFS_PER_FRAME];
uint8_t reserved1[3];
uint32_t delta_frame_id_minus_1[STD_VIDEO_AV1_REFS_PER_FRAME];
const StdVideoAV1TileInfo* pTileInfo;
const StdVideoAV1Quantization* pQuantization;
const StdVideoAV1Segmentation* pSegmentation;
const StdVideoAV1LoopFilter* pLoopFilter;
const StdVideoAV1CDEF* pCDEF;
const StdVideoAV1LoopRestoration* pLoopRestoration;
const StdVideoAV1GlobalMotion* pGlobalMotion;
const StdVideoEncodeAV1ExtensionHeader* pExtensionHeader;
const uint32_t* pBufferRemovalTimes;
} StdVideoEncodeAV1PictureInfo;
typedef struct StdVideoEncodeAV1ReferenceInfoFlags {
uint32_t disable_frame_end_update_cdf : 1;
uint32_t segmentation_enabled : 1;
uint32_t reserved : 30;
} StdVideoEncodeAV1ReferenceInfoFlags;
typedef struct StdVideoEncodeAV1ReferenceInfo {
StdVideoEncodeAV1ReferenceInfoFlags flags;
uint32_t RefFrameId;
StdVideoAV1FrameType frame_type;
uint8_t OrderHint;
uint8_t reserved1[3];
const StdVideoEncodeAV1ExtensionHeader* pExtensionHeader;
} StdVideoEncodeAV1ReferenceInfo;
#ifdef __cplusplus
}
#endif
#endif

View file

@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H264STD_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,8 +19,9 @@ extern "C" {
// vulkan_video_codec_h264std is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_h264std 1
#include <stdint.h>
#include "vulkan_video_codecs_common.h"
#define STD_VIDEO_H264_CPB_CNT_LIST_SIZE 32
#define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS 6
#define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS 16
@ -28,6 +29,7 @@ extern "C" {
#define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS 64
#define STD_VIDEO_H264_MAX_NUM_LIST_REF 32
#define STD_VIDEO_H264_MAX_CHROMA_PLANES 2
#define STD_VIDEO_H264_NO_REFERENCE_PICTURE 0xFF
typedef enum StdVideoH264ChromaFormatIdc {
STD_VIDEO_H264_CHROMA_FORMAT_IDC_MONOCHROME = 0,

View file

@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,13 +19,15 @@ extern "C" {
// vulkan_video_codec_h264std_decode is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_h264std_decode 1
#include "vulkan_video_codec_h264std.h"
#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0)
#define STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE 2
#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0
#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_decode"
#define STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE 2
typedef enum StdVideoDecodeH264FieldOrderCount {
STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_TOP = 0,

View file

@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,11 +19,13 @@ extern "C" {
// vulkan_video_codec_h264std_encode is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_h264std_encode 1
// Vulkan 0.9 provisional Vulkan video H.264 encode std specification version number
#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_9 VK_MAKE_VIDEO_STD_VERSION(0, 9, 9)
#include "vulkan_video_codec_h264std.h"
#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_9
#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0)
#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_1_0_0
#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_encode"
typedef struct StdVideoEncodeH264WeightTableFlags {
uint32_t luma_weight_l0_flag;
@ -49,24 +51,27 @@ typedef struct StdVideoEncodeH264WeightTable {
typedef struct StdVideoEncodeH264SliceHeaderFlags {
uint32_t direct_spatial_mv_pred_flag : 1;
uint32_t num_ref_idx_active_override_flag : 1;
uint32_t no_output_of_prior_pics_flag : 1;
uint32_t adaptive_ref_pic_marking_mode_flag : 1;
uint32_t no_prior_references_available_flag : 1;
uint32_t reserved : 30;
} StdVideoEncodeH264SliceHeaderFlags;
typedef struct StdVideoEncodeH264PictureInfoFlags {
uint32_t idr_flag : 1;
uint32_t is_reference_flag : 1;
uint32_t used_for_long_term_reference : 1;
uint32_t IdrPicFlag : 1;
uint32_t is_reference : 1;
uint32_t no_output_of_prior_pics_flag : 1;
uint32_t long_term_reference_flag : 1;
uint32_t adaptive_ref_pic_marking_mode_flag : 1;
uint32_t reserved : 27;
} StdVideoEncodeH264PictureInfoFlags;
typedef struct StdVideoEncodeH264ReferenceInfoFlags {
uint32_t used_for_long_term_reference : 1;
uint32_t reserved : 31;
} StdVideoEncodeH264ReferenceInfoFlags;
typedef struct StdVideoEncodeH264ReferenceListsInfoFlags {
uint32_t ref_pic_list_modification_flag_l0 : 1;
uint32_t ref_pic_list_modification_flag_l1 : 1;
uint32_t reserved : 30;
} StdVideoEncodeH264ReferenceListsInfoFlags;
typedef struct StdVideoEncodeH264RefListModEntry {
@ -76,7 +81,7 @@ typedef struct StdVideoEncodeH264RefListModEntry {
} StdVideoEncodeH264RefListModEntry;
typedef struct StdVideoEncodeH264RefPicMarkingEntry {
StdVideoH264MemMgmtControlOp operation;
StdVideoH264MemMgmtControlOp memory_management_control_operation;
uint16_t difference_of_pic_nums_minus1;
uint16_t long_term_pic_num;
uint16_t long_term_frame_idx;
@ -85,51 +90,52 @@ typedef struct StdVideoEncodeH264RefPicMarkingEntry {
typedef struct StdVideoEncodeH264ReferenceListsInfo {
StdVideoEncodeH264ReferenceListsInfoFlags flags;
uint8_t refPicList0EntryCount;
uint8_t refPicList1EntryCount;
uint8_t num_ref_idx_l0_active_minus1;
uint8_t num_ref_idx_l1_active_minus1;
uint8_t RefPicList0[STD_VIDEO_H264_MAX_NUM_LIST_REF];
uint8_t RefPicList1[STD_VIDEO_H264_MAX_NUM_LIST_REF];
uint8_t refList0ModOpCount;
uint8_t refList1ModOpCount;
uint8_t refPicMarkingOpCount;
uint8_t reserved1[7];
const uint8_t* pRefPicList0Entries;
const uint8_t* pRefPicList1Entries;
const StdVideoEncodeH264RefListModEntry* pRefList0ModOperations;
const StdVideoEncodeH264RefListModEntry* pRefList1ModOperations;
const StdVideoEncodeH264RefPicMarkingEntry* pRefPicMarkingOperations;
} StdVideoEncodeH264ReferenceListsInfo;
typedef struct StdVideoEncodeH264PictureInfo {
StdVideoEncodeH264PictureInfoFlags flags;
uint8_t seq_parameter_set_id;
uint8_t pic_parameter_set_id;
uint16_t reserved1;
StdVideoH264PictureType pictureType;
uint32_t frame_num;
int32_t PicOrderCnt;
StdVideoEncodeH264PictureInfoFlags flags;
uint8_t seq_parameter_set_id;
uint8_t pic_parameter_set_id;
uint16_t idr_pic_id;
StdVideoH264PictureType primary_pic_type;
uint32_t frame_num;
int32_t PicOrderCnt;
uint8_t temporal_id;
uint8_t reserved1[3];
const StdVideoEncodeH264ReferenceListsInfo* pRefLists;
} StdVideoEncodeH264PictureInfo;
typedef struct StdVideoEncodeH264ReferenceInfo {
StdVideoEncodeH264ReferenceInfoFlags flags;
StdVideoH264PictureType pictureType;
StdVideoH264PictureType primary_pic_type;
uint32_t FrameNum;
int32_t PicOrderCnt;
uint16_t long_term_pic_num;
uint16_t long_term_frame_idx;
uint8_t temporal_id;
} StdVideoEncodeH264ReferenceInfo;
typedef struct StdVideoEncodeH264SliceHeader {
StdVideoEncodeH264SliceHeaderFlags flags;
uint32_t first_mb_in_slice;
StdVideoH264SliceType slice_type;
uint16_t idr_pic_id;
uint8_t num_ref_idx_l0_active_minus1;
uint8_t num_ref_idx_l1_active_minus1;
StdVideoH264CabacInitIdc cabac_init_idc;
StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc;
int8_t slice_alpha_c0_offset_div2;
int8_t slice_beta_offset_div2;
uint16_t reserved1;
uint32_t reserved2;
int8_t slice_qp_delta;
uint8_t reserved1;
StdVideoH264CabacInitIdc cabac_init_idc;
StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc;
const StdVideoEncodeH264WeightTable* pWeightTable;
} StdVideoEncodeH264SliceHeader;

View file

@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H265STD_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,9 +19,11 @@ extern "C" {
// vulkan_video_codec_h265std is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_h265std 1
#define STD_VIDEO_H265_SUBLAYERS_LIST_SIZE 7
#include "vulkan_video_codecs_common.h"
#define STD_VIDEO_H265_CPB_CNT_LIST_SIZE 32
#define STD_VIDEO_H265_SUBLAYERS_LIST_SIZE 7
#define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS 6
#define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS 16
#define STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS 6
@ -30,18 +32,19 @@ extern "C" {
#define STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS 64
#define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS 2
#define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS 64
#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE 3
#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE 128
#define STD_VIDEO_H265_MAX_DPB_SIZE 16
#define STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS 32
#define STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE 6
#define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE 19
#define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE 21
#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE 3
#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE 128
#define STD_VIDEO_H265_MAX_NUM_LIST_REF 15
#define STD_VIDEO_H265_MAX_CHROMA_PLANES 2
#define STD_VIDEO_H265_MAX_SHORT_TERM_REF_PIC_SETS 64
#define STD_VIDEO_H265_MAX_DPB_SIZE 16
#define STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS 32
#define STD_VIDEO_H265_MAX_LONG_TERM_PICS 16
#define STD_VIDEO_H265_MAX_DELTA_POC 48
#define STD_VIDEO_H265_NO_REFERENCE_PICTURE 0xFF
typedef enum StdVideoH265ChromaFormatIdc {
STD_VIDEO_H265_CHROMA_FORMAT_IDC_MONOCHROME = 0,

View file

@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,13 +19,15 @@ extern "C" {
// vulkan_video_codec_h265std_decode is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_h265std_decode 1
#include "vulkan_video_codec_h265std.h"
#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0)
#define STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE 8
#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0
#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_decode"
#define STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE 8
typedef struct StdVideoDecodeH265PictureInfoFlags {
uint32_t IrapPicFlag : 1;
uint32_t IdrPicFlag : 1;

View file

@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,11 +19,13 @@ extern "C" {
// vulkan_video_codec_h265std_encode is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_h265std_encode 1
// Vulkan 0.9 provisional Vulkan video H.265 encode std specification version number
#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_10 VK_MAKE_VIDEO_STD_VERSION(0, 9, 10)
#include "vulkan_video_codec_h265std.h"
#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_10
#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0)
#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_1_0_0
#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_encode"
typedef struct StdVideoEncodeH265WeightTableFlags {
uint16_t luma_weight_l0_flag;
@ -48,11 +50,7 @@ typedef struct StdVideoEncodeH265WeightTable {
typedef struct StdVideoEncodeH265SliceSegmentHeaderFlags {
uint32_t first_slice_segment_in_pic_flag : 1;
uint32_t no_output_of_prior_pics_flag : 1;
uint32_t dependent_slice_segment_flag : 1;
uint32_t pic_output_flag : 1;
uint32_t short_term_ref_pic_set_sps_flag : 1;
uint32_t slice_temporal_mvp_enable_flag : 1;
uint32_t slice_sao_luma_flag : 1;
uint32_t slice_sao_chroma_flag : 1;
uint32_t num_ref_idx_active_override_flag : 1;
@ -63,9 +61,57 @@ typedef struct StdVideoEncodeH265SliceSegmentHeaderFlags {
uint32_t slice_deblocking_filter_disabled_flag : 1;
uint32_t collocated_from_l0_flag : 1;
uint32_t slice_loop_filter_across_slices_enabled_flag : 1;
uint32_t reserved : 20;
} StdVideoEncodeH265SliceSegmentHeaderFlags;
typedef struct StdVideoEncodeH265SliceSegmentLongTermRefPics {
typedef struct StdVideoEncodeH265SliceSegmentHeader {
StdVideoEncodeH265SliceSegmentHeaderFlags flags;
StdVideoH265SliceType slice_type;
uint32_t slice_segment_address;
uint8_t collocated_ref_idx;
uint8_t MaxNumMergeCand;
int8_t slice_cb_qp_offset;
int8_t slice_cr_qp_offset;
int8_t slice_beta_offset_div2;
int8_t slice_tc_offset_div2;
int8_t slice_act_y_qp_offset;
int8_t slice_act_cb_qp_offset;
int8_t slice_act_cr_qp_offset;
int8_t slice_qp_delta;
uint16_t reserved1;
const StdVideoEncodeH265WeightTable* pWeightTable;
} StdVideoEncodeH265SliceSegmentHeader;
typedef struct StdVideoEncodeH265ReferenceListsInfoFlags {
uint32_t ref_pic_list_modification_flag_l0 : 1;
uint32_t ref_pic_list_modification_flag_l1 : 1;
uint32_t reserved : 30;
} StdVideoEncodeH265ReferenceListsInfoFlags;
typedef struct StdVideoEncodeH265ReferenceListsInfo {
StdVideoEncodeH265ReferenceListsInfoFlags flags;
uint8_t num_ref_idx_l0_active_minus1;
uint8_t num_ref_idx_l1_active_minus1;
uint8_t RefPicList0[STD_VIDEO_H265_MAX_NUM_LIST_REF];
uint8_t RefPicList1[STD_VIDEO_H265_MAX_NUM_LIST_REF];
uint8_t list_entry_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF];
uint8_t list_entry_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF];
} StdVideoEncodeH265ReferenceListsInfo;
typedef struct StdVideoEncodeH265PictureInfoFlags {
uint32_t is_reference : 1;
uint32_t IrapPicFlag : 1;
uint32_t used_for_long_term_reference : 1;
uint32_t discardable_flag : 1;
uint32_t cross_layer_bla_flag : 1;
uint32_t pic_output_flag : 1;
uint32_t no_output_of_prior_pics_flag : 1;
uint32_t short_term_ref_pic_set_sps_flag : 1;
uint32_t slice_temporal_mvp_enabled_flag : 1;
uint32_t reserved : 23;
} StdVideoEncodeH265PictureInfoFlags;
typedef struct StdVideoEncodeH265LongTermRefPics {
uint8_t num_long_term_sps;
uint8_t num_long_term_pics;
uint8_t lt_idx_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS];
@ -73,71 +119,32 @@ typedef struct StdVideoEncodeH265SliceSegmentLongTermRefPics {
uint16_t used_by_curr_pic_lt_flag;
uint8_t delta_poc_msb_present_flag[STD_VIDEO_H265_MAX_DELTA_POC];
uint8_t delta_poc_msb_cycle_lt[STD_VIDEO_H265_MAX_DELTA_POC];
} StdVideoEncodeH265SliceSegmentLongTermRefPics;
typedef struct StdVideoEncodeH265SliceSegmentHeader {
StdVideoEncodeH265SliceSegmentHeaderFlags flags;
StdVideoH265SliceType slice_type;
uint32_t slice_segment_address;
uint8_t short_term_ref_pic_set_idx;
uint8_t collocated_ref_idx;
uint8_t num_ref_idx_l0_active_minus1;
uint8_t num_ref_idx_l1_active_minus1;
uint8_t MaxNumMergeCand;
int8_t slice_cb_qp_offset;
int8_t slice_cr_qp_offset;
int8_t slice_beta_offset_div2;
int8_t slice_tc_offset_div2;
int8_t slice_act_y_qp_offset;
int8_t slice_act_cb_qp_offset;
int8_t slice_act_cr_qp_offset;
const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSet;
const StdVideoEncodeH265SliceSegmentLongTermRefPics* pLongTermRefPics;
const StdVideoEncodeH265WeightTable* pWeightTable;
} StdVideoEncodeH265SliceSegmentHeader;
typedef struct StdVideoEncodeH265ReferenceListsInfoFlags {
uint32_t ref_pic_list_modification_flag_l0 : 1;
uint32_t ref_pic_list_modification_flag_l1 : 1;
} StdVideoEncodeH265ReferenceListsInfoFlags;
typedef struct StdVideoEncodeH265ReferenceListsInfo {
StdVideoEncodeH265ReferenceListsInfoFlags flags;
uint8_t num_ref_idx_l0_active_minus1;
uint8_t num_ref_idx_l1_active_minus1;
uint16_t reserved1;
const uint8_t* pRefPicList0Entries;
const uint8_t* pRefPicList1Entries;
const uint8_t* pRefList0Modifications;
const uint8_t* pRefList1Modifications;
} StdVideoEncodeH265ReferenceListsInfo;
typedef struct StdVideoEncodeH265PictureInfoFlags {
uint32_t is_reference_flag : 1;
uint32_t IrapPicFlag : 1;
uint32_t long_term_flag : 1;
uint32_t discardable_flag : 1;
uint32_t cross_layer_bla_flag : 1;
} StdVideoEncodeH265PictureInfoFlags;
} StdVideoEncodeH265LongTermRefPics;
typedef struct StdVideoEncodeH265PictureInfo {
StdVideoEncodeH265PictureInfoFlags flags;
StdVideoH265PictureType PictureType;
uint8_t sps_video_parameter_set_id;
uint8_t pps_seq_parameter_set_id;
uint8_t pps_pic_parameter_set_id;
uint8_t TemporalId;
int32_t PicOrderCntVal;
StdVideoEncodeH265PictureInfoFlags flags;
StdVideoH265PictureType pic_type;
uint8_t sps_video_parameter_set_id;
uint8_t pps_seq_parameter_set_id;
uint8_t pps_pic_parameter_set_id;
uint8_t short_term_ref_pic_set_idx;
int32_t PicOrderCntVal;
uint8_t TemporalId;
uint8_t reserved1[7];
const StdVideoEncodeH265ReferenceListsInfo* pRefLists;
const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSet;
const StdVideoEncodeH265LongTermRefPics* pLongTermRefPics;
} StdVideoEncodeH265PictureInfo;
typedef struct StdVideoEncodeH265ReferenceInfoFlags {
uint32_t used_for_long_term_reference : 1;
uint32_t unused_for_reference : 1;
uint32_t reserved : 30;
} StdVideoEncodeH265ReferenceInfoFlags;
typedef struct StdVideoEncodeH265ReferenceInfo {
StdVideoEncodeH265ReferenceInfoFlags flags;
StdVideoH265PictureType PictureType;
StdVideoH265PictureType pic_type;
int32_t PicOrderCntVal;
uint8_t TemporalId;
} StdVideoEncodeH265ReferenceInfo;

View file

@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODECS_COMMON_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,7 +19,12 @@ extern "C" {
// vulkan_video_codecs_common is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codecs_common 1
#if !defined(VK_NO_STDINT_H)
#include <stdint.h>
#endif
#define VK_MAKE_VIDEO_STD_VERSION(major, minor, patch) \
((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch)))

View file

@ -1,23 +1,9 @@
//
// File: vk_icd.h
//
/*
* Copyright (c) 2015-2023 LunarG, Inc.
* Copyright (c) 2015-2023 The Khronos Group Inc.
* Copyright (c) 2015-2023 Valve Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2015-2023 The Khronos Group Inc.
* Copyright 2015-2023 Valve Corporation
* Copyright 2015-2023 LunarG, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once

View file

@ -1,23 +1,9 @@
//
// File: vk_layer.h
//
/*
* Copyright (c) 2015-2023 LunarG, Inc.
* Copyright (c) 2015-2023 The Khronos Group Inc.
* Copyright (c) 2015-2023 Valve Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2015-2023 The Khronos Group Inc.
* Copyright 2015-2023 Valve Corporation
* Copyright 2015-2023 LunarG, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once

View file

@ -2,7 +2,7 @@
// File: vk_platform.h
//
/*
** Copyright 2014-2023 The Khronos Group Inc.
** Copyright 2014-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

8630
include/vulkan/vulkan.cppm Normal file

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
#define VULKAN_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
#define VULKAN_ANDROID_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_KHR_android_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_KHR_android_surface 1
struct ANativeWindow;
#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
@ -42,6 +43,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
#endif
// VK_ANDROID_external_memory_android_hardware_buffer is a preprocessor guard. Do not pass it to API calls.
#define VK_ANDROID_external_memory_android_hardware_buffer 1
struct AHardwareBuffer;
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 5
@ -118,6 +120,32 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID(
struct AHardwareBuffer** pBuffer);
#endif
// VK_ANDROID_external_format_resolve is a preprocessor guard. Do not pass it to API calls.
#define VK_ANDROID_external_format_resolve 1
#define VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_SPEC_VERSION 1
#define VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_EXTENSION_NAME "VK_ANDROID_external_format_resolve"
typedef struct VkPhysicalDeviceExternalFormatResolveFeaturesANDROID {
VkStructureType sType;
void* pNext;
VkBool32 externalFormatResolve;
} VkPhysicalDeviceExternalFormatResolveFeaturesANDROID;
typedef struct VkPhysicalDeviceExternalFormatResolvePropertiesANDROID {
VkStructureType sType;
void* pNext;
VkBool32 nullColorAttachmentWithExternalFormatResolve;
VkChromaLocation externalFormatResolveChromaOffsetX;
VkChromaLocation externalFormatResolveChromaOffsetY;
} VkPhysicalDeviceExternalFormatResolvePropertiesANDROID;
typedef struct VkAndroidHardwareBufferFormatResolvePropertiesANDROID {
VkStructureType sType;
void* pNext;
VkFormat colorAttachmentFormat;
} VkAndroidHardwareBufferFormatResolvePropertiesANDROID;
#ifdef __cplusplus
}
#endif

View file

@ -2,7 +2,7 @@
#define VULKAN_BETA_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_KHR_portability_subset is a preprocessor guard. Do not pass it to API calls.
#define VK_KHR_portability_subset 1
#define VK_KHR_PORTABILITY_SUBSET_SPEC_VERSION 1
#define VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME "VK_KHR_portability_subset"
@ -50,444 +51,132 @@ typedef struct VkPhysicalDevicePortabilitySubsetPropertiesKHR {
#define VK_KHR_video_encode_queue 1
#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 8
#define VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME "VK_KHR_video_encode_queue"
typedef enum VkVideoEncodeTuningModeKHR {
VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR = 0,
VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR = 1,
VK_VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR = 2,
VK_VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR = 3,
VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR = 4,
VK_VIDEO_ENCODE_TUNING_MODE_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoEncodeTuningModeKHR;
typedef VkFlags VkVideoEncodeFlagsKHR;
typedef enum VkVideoEncodeCapabilityFlagBitsKHR {
VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR = 0x00000001,
VK_VIDEO_ENCODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoEncodeCapabilityFlagBitsKHR;
typedef VkFlags VkVideoEncodeCapabilityFlagsKHR;
typedef enum VkVideoEncodeRateControlModeFlagBitsKHR {
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DEFAULT_KHR = 0,
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR = 0x00000001,
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR = 0x00000002,
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR = 0x00000004,
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoEncodeRateControlModeFlagBitsKHR;
typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR;
typedef enum VkVideoEncodeFeedbackFlagBitsKHR {
VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR = 0x00000001,
VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR = 0x00000002,
VK_VIDEO_ENCODE_FEEDBACK_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoEncodeFeedbackFlagBitsKHR;
typedef VkFlags VkVideoEncodeFeedbackFlagsKHR;
typedef enum VkVideoEncodeUsageFlagBitsKHR {
VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR = 0,
VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001,
VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR = 0x00000002,
VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR = 0x00000004,
VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR = 0x00000008,
VK_VIDEO_ENCODE_USAGE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoEncodeUsageFlagBitsKHR;
typedef VkFlags VkVideoEncodeUsageFlagsKHR;
typedef enum VkVideoEncodeContentFlagBitsKHR {
VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR = 0,
VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR = 0x00000001,
VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR = 0x00000002,
VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR = 0x00000004,
VK_VIDEO_ENCODE_CONTENT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoEncodeContentFlagBitsKHR;
typedef VkFlags VkVideoEncodeContentFlagsKHR;
typedef VkFlags VkVideoEncodeRateControlFlagsKHR;
typedef struct VkVideoEncodeInfoKHR {
VkStructureType sType;
const void* pNext;
VkVideoEncodeFlagsKHR flags;
uint32_t qualityLevel;
VkBuffer dstBuffer;
VkDeviceSize dstBufferOffset;
VkDeviceSize dstBufferRange;
VkVideoPictureResourceInfoKHR srcPictureResource;
const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot;
uint32_t referenceSlotCount;
const VkVideoReferenceSlotInfoKHR* pReferenceSlots;
uint32_t precedingExternallyEncodedBytes;
} VkVideoEncodeInfoKHR;
typedef struct VkVideoEncodeCapabilitiesKHR {
VkStructureType sType;
void* pNext;
VkVideoEncodeCapabilityFlagsKHR flags;
VkVideoEncodeRateControlModeFlagsKHR rateControlModes;
uint32_t maxRateControlLayers;
uint32_t maxQualityLevels;
VkExtent2D inputImageDataFillAlignment;
VkVideoEncodeFeedbackFlagsKHR supportedEncodeFeedbackFlags;
} VkVideoEncodeCapabilitiesKHR;
typedef struct VkQueryPoolVideoEncodeFeedbackCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkVideoEncodeFeedbackFlagsKHR encodeFeedbackFlags;
} VkQueryPoolVideoEncodeFeedbackCreateInfoKHR;
typedef struct VkVideoEncodeUsageInfoKHR {
VkStructureType sType;
const void* pNext;
VkVideoEncodeUsageFlagsKHR videoUsageHints;
VkVideoEncodeContentFlagsKHR videoContentHints;
VkVideoEncodeTuningModeKHR tuningMode;
} VkVideoEncodeUsageInfoKHR;
typedef struct VkVideoEncodeRateControlLayerInfoKHR {
// VK_AMDX_shader_enqueue is a preprocessor guard. Do not pass it to API calls.
#define VK_AMDX_shader_enqueue 1
#define VK_AMDX_SHADER_ENQUEUE_SPEC_VERSION 2
#define VK_AMDX_SHADER_ENQUEUE_EXTENSION_NAME "VK_AMDX_shader_enqueue"
#define VK_SHADER_INDEX_UNUSED_AMDX (~0U)
typedef struct VkPhysicalDeviceShaderEnqueueFeaturesAMDX {
VkStructureType sType;
const void* pNext;
uint64_t averageBitrate;
uint64_t maxBitrate;
uint32_t frameRateNumerator;
uint32_t frameRateDenominator;
uint32_t virtualBufferSizeInMs;
uint32_t initialVirtualBufferSizeInMs;
} VkVideoEncodeRateControlLayerInfoKHR;
void* pNext;
VkBool32 shaderEnqueue;
VkBool32 shaderMeshEnqueue;
} VkPhysicalDeviceShaderEnqueueFeaturesAMDX;
typedef struct VkVideoEncodeRateControlInfoKHR {
VkStructureType sType;
const void* pNext;
VkVideoEncodeRateControlFlagsKHR flags;
VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode;
uint32_t layerCount;
const VkVideoEncodeRateControlLayerInfoKHR* pLayers;
} VkVideoEncodeRateControlInfoKHR;
typedef struct VkPhysicalDeviceShaderEnqueuePropertiesAMDX {
VkStructureType sType;
void* pNext;
uint32_t maxExecutionGraphDepth;
uint32_t maxExecutionGraphShaderOutputNodes;
uint32_t maxExecutionGraphShaderPayloadSize;
uint32_t maxExecutionGraphShaderPayloadCount;
uint32_t executionGraphDispatchAddressAlignment;
uint32_t maxExecutionGraphWorkgroupCount[3];
uint32_t maxExecutionGraphWorkgroups;
} VkPhysicalDeviceShaderEnqueuePropertiesAMDX;
typedef void (VKAPI_PTR *PFN_vkCmdEncodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR* pEncodeInfo);
typedef struct VkExecutionGraphPipelineScratchSizeAMDX {
VkStructureType sType;
void* pNext;
VkDeviceSize minSize;
VkDeviceSize maxSize;
VkDeviceSize sizeGranularity;
} VkExecutionGraphPipelineScratchSizeAMDX;
typedef struct VkExecutionGraphPipelineCreateInfoAMDX {
VkStructureType sType;
const void* pNext;
VkPipelineCreateFlags flags;
uint32_t stageCount;
const VkPipelineShaderStageCreateInfo* pStages;
const VkPipelineLibraryCreateInfoKHR* pLibraryInfo;
VkPipelineLayout layout;
VkPipeline basePipelineHandle;
int32_t basePipelineIndex;
} VkExecutionGraphPipelineCreateInfoAMDX;
typedef union VkDeviceOrHostAddressConstAMDX {
VkDeviceAddress deviceAddress;
const void* hostAddress;
} VkDeviceOrHostAddressConstAMDX;
typedef struct VkDispatchGraphInfoAMDX {
uint32_t nodeIndex;
uint32_t payloadCount;
VkDeviceOrHostAddressConstAMDX payloads;
uint64_t payloadStride;
} VkDispatchGraphInfoAMDX;
typedef struct VkDispatchGraphCountInfoAMDX {
uint32_t count;
VkDeviceOrHostAddressConstAMDX infos;
uint64_t stride;
} VkDispatchGraphCountInfoAMDX;
typedef struct VkPipelineShaderStageNodeCreateInfoAMDX {
VkStructureType sType;
const void* pNext;
const char* pName;
uint32_t index;
} VkPipelineShaderStageNodeCreateInfoAMDX;
typedef VkResult (VKAPI_PTR *PFN_vkCreateExecutionGraphPipelinesAMDX)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineScratchSizeAMDX)(VkDevice device, VkPipeline executionGraph, VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo);
typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineNodeIndexAMDX)(VkDevice device, VkPipeline executionGraph, const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo, uint32_t* pNodeIndex);
typedef void (VKAPI_PTR *PFN_vkCmdInitializeGraphScratchMemoryAMDX)(VkCommandBuffer commandBuffer, VkPipeline executionGraph, VkDeviceAddress scratch, VkDeviceSize scratchSize);
typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceSize scratchSize, const VkDispatchGraphCountInfoAMDX* pCountInfo);
typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceSize scratchSize, const VkDispatchGraphCountInfoAMDX* pCountInfo);
typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectCountAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceSize scratchSize, VkDeviceAddress countInfo);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdEncodeVideoKHR(
VKAPI_ATTR VkResult VKAPI_CALL vkCreateExecutionGraphPipelinesAMDX(
VkDevice device,
VkPipelineCache pipelineCache,
uint32_t createInfoCount,
const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos,
const VkAllocationCallbacks* pAllocator,
VkPipeline* pPipelines);
VKAPI_ATTR VkResult VKAPI_CALL vkGetExecutionGraphPipelineScratchSizeAMDX(
VkDevice device,
VkPipeline executionGraph,
VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo);
VKAPI_ATTR VkResult VKAPI_CALL vkGetExecutionGraphPipelineNodeIndexAMDX(
VkDevice device,
VkPipeline executionGraph,
const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo,
uint32_t* pNodeIndex);
VKAPI_ATTR void VKAPI_CALL vkCmdInitializeGraphScratchMemoryAMDX(
VkCommandBuffer commandBuffer,
const VkVideoEncodeInfoKHR* pEncodeInfo);
VkPipeline executionGraph,
VkDeviceAddress scratch,
VkDeviceSize scratchSize);
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphAMDX(
VkCommandBuffer commandBuffer,
VkDeviceAddress scratch,
VkDeviceSize scratchSize,
const VkDispatchGraphCountInfoAMDX* pCountInfo);
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectAMDX(
VkCommandBuffer commandBuffer,
VkDeviceAddress scratch,
VkDeviceSize scratchSize,
const VkDispatchGraphCountInfoAMDX* pCountInfo);
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectCountAMDX(
VkCommandBuffer commandBuffer,
VkDeviceAddress scratch,
VkDeviceSize scratchSize,
VkDeviceAddress countInfo);
#endif
#define VK_EXT_video_encode_h264 1
#include "vk_video/vulkan_video_codec_h264std.h"
#include "vk_video/vulkan_video_codec_h264std_encode.h"
#define VK_EXT_VIDEO_ENCODE_H264_SPEC_VERSION 10
#define VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME "VK_EXT_video_encode_h264"
typedef enum VkVideoEncodeH264RateControlStructureEXT {
VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0,
VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_FLAT_EXT = 1,
VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_DYADIC_EXT = 2,
VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH264RateControlStructureEXT;
typedef enum VkVideoEncodeH264CapabilityFlagBitsEXT {
VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_ENABLED_BIT_EXT = 0x00000001,
VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_DISABLED_BIT_EXT = 0x00000002,
VK_VIDEO_ENCODE_H264_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT = 0x00000004,
VK_VIDEO_ENCODE_H264_CAPABILITY_QPPRIME_Y_ZERO_TRANSFORM_BYPASS_BIT_EXT = 0x00000008,
VK_VIDEO_ENCODE_H264_CAPABILITY_SCALING_LISTS_BIT_EXT = 0x00000010,
VK_VIDEO_ENCODE_H264_CAPABILITY_HRD_COMPLIANCE_BIT_EXT = 0x00000020,
VK_VIDEO_ENCODE_H264_CAPABILITY_CHROMA_QP_OFFSET_BIT_EXT = 0x00000040,
VK_VIDEO_ENCODE_H264_CAPABILITY_SECOND_CHROMA_QP_OFFSET_BIT_EXT = 0x00000080,
VK_VIDEO_ENCODE_H264_CAPABILITY_PIC_INIT_QP_MINUS26_BIT_EXT = 0x00000100,
VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_PRED_BIT_EXT = 0x00000200,
VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BIPRED_EXPLICIT_BIT_EXT = 0x00000400,
VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BIPRED_IMPLICIT_BIT_EXT = 0x00000800,
VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_PRED_NO_TABLE_BIT_EXT = 0x00001000,
VK_VIDEO_ENCODE_H264_CAPABILITY_TRANSFORM_8X8_BIT_EXT = 0x00002000,
VK_VIDEO_ENCODE_H264_CAPABILITY_CABAC_BIT_EXT = 0x00004000,
VK_VIDEO_ENCODE_H264_CAPABILITY_CAVLC_BIT_EXT = 0x00008000,
VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_DISABLED_BIT_EXT = 0x00010000,
VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_ENABLED_BIT_EXT = 0x00020000,
VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_PARTIAL_BIT_EXT = 0x00040000,
VK_VIDEO_ENCODE_H264_CAPABILITY_DISABLE_DIRECT_SPATIAL_MV_PRED_BIT_EXT = 0x00080000,
VK_VIDEO_ENCODE_H264_CAPABILITY_MULTIPLE_SLICE_PER_FRAME_BIT_EXT = 0x00100000,
VK_VIDEO_ENCODE_H264_CAPABILITY_SLICE_MB_COUNT_BIT_EXT = 0x00200000,
VK_VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_EXT = 0x00400000,
VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0x00800000,
VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0x01000000,
VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_REFERENCE_FINAL_LISTS_BIT_EXT = 0x02000000,
VK_VIDEO_ENCODE_H264_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH264CapabilityFlagBitsEXT;
typedef VkFlags VkVideoEncodeH264CapabilityFlagsEXT;
typedef struct VkVideoEncodeH264CapabilitiesEXT {
VkStructureType sType;
void* pNext;
VkVideoEncodeH264CapabilityFlagsEXT flags;
uint32_t maxPPictureL0ReferenceCount;
uint32_t maxBPictureL0ReferenceCount;
uint32_t maxL1ReferenceCount;
VkBool32 motionVectorsOverPicBoundariesFlag;
uint32_t maxBytesPerPicDenom;
uint32_t maxBitsPerMbDenom;
uint32_t log2MaxMvLengthHorizontal;
uint32_t log2MaxMvLengthVertical;
} VkVideoEncodeH264CapabilitiesEXT;
typedef struct VkVideoEncodeH264SessionParametersAddInfoEXT {
VkStructureType sType;
const void* pNext;
uint32_t stdSPSCount;
const StdVideoH264SequenceParameterSet* pStdSPSs;
uint32_t stdPPSCount;
const StdVideoH264PictureParameterSet* pStdPPSs;
} VkVideoEncodeH264SessionParametersAddInfoEXT;
typedef struct VkVideoEncodeH264SessionParametersCreateInfoEXT {
VkStructureType sType;
const void* pNext;
uint32_t maxStdSPSCount;
uint32_t maxStdPPSCount;
const VkVideoEncodeH264SessionParametersAddInfoEXT* pParametersAddInfo;
} VkVideoEncodeH264SessionParametersCreateInfoEXT;
typedef struct VkVideoEncodeH264NaluSliceInfoEXT {
VkStructureType sType;
const void* pNext;
uint32_t mbCount;
const StdVideoEncodeH264ReferenceListsInfo* pStdReferenceFinalLists;
const StdVideoEncodeH264SliceHeader* pStdSliceHeader;
} VkVideoEncodeH264NaluSliceInfoEXT;
typedef struct VkVideoEncodeH264VclFrameInfoEXT {
VkStructureType sType;
const void* pNext;
const StdVideoEncodeH264ReferenceListsInfo* pStdReferenceFinalLists;
uint32_t naluSliceEntryCount;
const VkVideoEncodeH264NaluSliceInfoEXT* pNaluSliceEntries;
const StdVideoEncodeH264PictureInfo* pStdPictureInfo;
} VkVideoEncodeH264VclFrameInfoEXT;
typedef struct VkVideoEncodeH264DpbSlotInfoEXT {
VkStructureType sType;
const void* pNext;
const StdVideoEncodeH264ReferenceInfo* pStdReferenceInfo;
} VkVideoEncodeH264DpbSlotInfoEXT;
typedef struct VkVideoEncodeH264ProfileInfoEXT {
VkStructureType sType;
const void* pNext;
StdVideoH264ProfileIdc stdProfileIdc;
} VkVideoEncodeH264ProfileInfoEXT;
typedef struct VkVideoEncodeH264RateControlInfoEXT {
VkStructureType sType;
const void* pNext;
uint32_t gopFrameCount;
uint32_t idrPeriod;
uint32_t consecutiveBFrameCount;
VkVideoEncodeH264RateControlStructureEXT rateControlStructure;
uint32_t temporalLayerCount;
} VkVideoEncodeH264RateControlInfoEXT;
typedef struct VkVideoEncodeH264QpEXT {
int32_t qpI;
int32_t qpP;
int32_t qpB;
} VkVideoEncodeH264QpEXT;
typedef struct VkVideoEncodeH264FrameSizeEXT {
uint32_t frameISize;
uint32_t framePSize;
uint32_t frameBSize;
} VkVideoEncodeH264FrameSizeEXT;
typedef struct VkVideoEncodeH264RateControlLayerInfoEXT {
VkStructureType sType;
const void* pNext;
uint32_t temporalLayerId;
VkBool32 useInitialRcQp;
VkVideoEncodeH264QpEXT initialRcQp;
VkBool32 useMinQp;
VkVideoEncodeH264QpEXT minQp;
VkBool32 useMaxQp;
VkVideoEncodeH264QpEXT maxQp;
VkBool32 useMaxFrameSize;
VkVideoEncodeH264FrameSizeEXT maxFrameSize;
} VkVideoEncodeH264RateControlLayerInfoEXT;
#define VK_EXT_video_encode_h265 1
#include "vk_video/vulkan_video_codec_h265std.h"
#include "vk_video/vulkan_video_codec_h265std_encode.h"
#define VK_EXT_VIDEO_ENCODE_H265_SPEC_VERSION 10
#define VK_EXT_VIDEO_ENCODE_H265_EXTENSION_NAME "VK_EXT_video_encode_h265"
typedef enum VkVideoEncodeH265RateControlStructureEXT {
VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0,
VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_FLAT_EXT = 1,
VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_DYADIC_EXT = 2,
VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH265RateControlStructureEXT;
typedef enum VkVideoEncodeH265CapabilityFlagBitsEXT {
VK_VIDEO_ENCODE_H265_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT = 0x00000001,
VK_VIDEO_ENCODE_H265_CAPABILITY_SCALING_LISTS_BIT_EXT = 0x00000002,
VK_VIDEO_ENCODE_H265_CAPABILITY_SAMPLE_ADAPTIVE_OFFSET_ENABLED_BIT_EXT = 0x00000004,
VK_VIDEO_ENCODE_H265_CAPABILITY_PCM_ENABLE_BIT_EXT = 0x00000008,
VK_VIDEO_ENCODE_H265_CAPABILITY_SPS_TEMPORAL_MVP_ENABLED_BIT_EXT = 0x00000010,
VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_EXT = 0x00000020,
VK_VIDEO_ENCODE_H265_CAPABILITY_INIT_QP_MINUS26_BIT_EXT = 0x00000040,
VK_VIDEO_ENCODE_H265_CAPABILITY_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_EXT = 0x00000080,
VK_VIDEO_ENCODE_H265_CAPABILITY_SIGN_DATA_HIDING_ENABLED_BIT_EXT = 0x00000100,
VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSFORM_SKIP_ENABLED_BIT_EXT = 0x00000200,
VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSFORM_SKIP_DISABLED_BIT_EXT = 0x00000400,
VK_VIDEO_ENCODE_H265_CAPABILITY_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_BIT_EXT = 0x00000800,
VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_PRED_BIT_EXT = 0x00001000,
VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_BIPRED_BIT_EXT = 0x00002000,
VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_PRED_NO_TABLE_BIT_EXT = 0x00004000,
VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSQUANT_BYPASS_ENABLED_BIT_EXT = 0x00008000,
VK_VIDEO_ENCODE_H265_CAPABILITY_ENTROPY_CODING_SYNC_ENABLED_BIT_EXT = 0x00010000,
VK_VIDEO_ENCODE_H265_CAPABILITY_DEBLOCKING_FILTER_OVERRIDE_ENABLED_BIT_EXT = 0x00020000,
VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILE_PER_FRAME_BIT_EXT = 0x00040000,
VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_PER_TILE_BIT_EXT = 0x00080000,
VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILE_PER_SLICE_BIT_EXT = 0x00100000,
VK_VIDEO_ENCODE_H265_CAPABILITY_SLICE_SEGMENT_CTB_COUNT_BIT_EXT = 0x00200000,
VK_VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_EXT = 0x00400000,
VK_VIDEO_ENCODE_H265_CAPABILITY_DEPENDENT_SLICE_SEGMENT_BIT_EXT = 0x00800000,
VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0x01000000,
VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0x02000000,
VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_REFERENCE_FINAL_LISTS_BIT_EXT = 0x04000000,
VK_VIDEO_ENCODE_H265_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH265CapabilityFlagBitsEXT;
typedef VkFlags VkVideoEncodeH265CapabilityFlagsEXT;
typedef enum VkVideoEncodeH265CtbSizeFlagBitsEXT {
VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_EXT = 0x00000001,
VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT = 0x00000002,
VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT = 0x00000004,
VK_VIDEO_ENCODE_H265_CTB_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH265CtbSizeFlagBitsEXT;
typedef VkFlags VkVideoEncodeH265CtbSizeFlagsEXT;
typedef enum VkVideoEncodeH265TransformBlockSizeFlagBitsEXT {
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_EXT = 0x00000001,
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_EXT = 0x00000002,
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_EXT = 0x00000004,
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_EXT = 0x00000008,
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH265TransformBlockSizeFlagBitsEXT;
typedef VkFlags VkVideoEncodeH265TransformBlockSizeFlagsEXT;
typedef struct VkVideoEncodeH265CapabilitiesEXT {
VkStructureType sType;
void* pNext;
VkVideoEncodeH265CapabilityFlagsEXT flags;
VkVideoEncodeH265CtbSizeFlagsEXT ctbSizes;
VkVideoEncodeH265TransformBlockSizeFlagsEXT transformBlockSizes;
uint32_t maxPPictureL0ReferenceCount;
uint32_t maxBPictureL0ReferenceCount;
uint32_t maxL1ReferenceCount;
uint32_t maxSubLayersCount;
uint32_t minLog2MinLumaCodingBlockSizeMinus3;
uint32_t maxLog2MinLumaCodingBlockSizeMinus3;
uint32_t minLog2MinLumaTransformBlockSizeMinus2;
uint32_t maxLog2MinLumaTransformBlockSizeMinus2;
uint32_t minMaxTransformHierarchyDepthInter;
uint32_t maxMaxTransformHierarchyDepthInter;
uint32_t minMaxTransformHierarchyDepthIntra;
uint32_t maxMaxTransformHierarchyDepthIntra;
uint32_t maxDiffCuQpDeltaDepth;
uint32_t minMaxNumMergeCand;
uint32_t maxMaxNumMergeCand;
} VkVideoEncodeH265CapabilitiesEXT;
typedef struct VkVideoEncodeH265SessionParametersAddInfoEXT {
VkStructureType sType;
const void* pNext;
uint32_t stdVPSCount;
const StdVideoH265VideoParameterSet* pStdVPSs;
uint32_t stdSPSCount;
const StdVideoH265SequenceParameterSet* pStdSPSs;
uint32_t stdPPSCount;
const StdVideoH265PictureParameterSet* pStdPPSs;
} VkVideoEncodeH265SessionParametersAddInfoEXT;
typedef struct VkVideoEncodeH265SessionParametersCreateInfoEXT {
VkStructureType sType;
const void* pNext;
uint32_t maxStdVPSCount;
uint32_t maxStdSPSCount;
uint32_t maxStdPPSCount;
const VkVideoEncodeH265SessionParametersAddInfoEXT* pParametersAddInfo;
} VkVideoEncodeH265SessionParametersCreateInfoEXT;
typedef struct VkVideoEncodeH265NaluSliceSegmentInfoEXT {
VkStructureType sType;
const void* pNext;
uint32_t ctbCount;
const StdVideoEncodeH265ReferenceListsInfo* pStdReferenceFinalLists;
const StdVideoEncodeH265SliceSegmentHeader* pStdSliceSegmentHeader;
} VkVideoEncodeH265NaluSliceSegmentInfoEXT;
typedef struct VkVideoEncodeH265VclFrameInfoEXT {
VkStructureType sType;
const void* pNext;
const StdVideoEncodeH265ReferenceListsInfo* pStdReferenceFinalLists;
uint32_t naluSliceSegmentEntryCount;
const VkVideoEncodeH265NaluSliceSegmentInfoEXT* pNaluSliceSegmentEntries;
const StdVideoEncodeH265PictureInfo* pStdPictureInfo;
} VkVideoEncodeH265VclFrameInfoEXT;
typedef struct VkVideoEncodeH265DpbSlotInfoEXT {
VkStructureType sType;
const void* pNext;
const StdVideoEncodeH265ReferenceInfo* pStdReferenceInfo;
} VkVideoEncodeH265DpbSlotInfoEXT;
typedef struct VkVideoEncodeH265ProfileInfoEXT {
VkStructureType sType;
const void* pNext;
StdVideoH265ProfileIdc stdProfileIdc;
} VkVideoEncodeH265ProfileInfoEXT;
typedef struct VkVideoEncodeH265RateControlInfoEXT {
VkStructureType sType;
const void* pNext;
uint32_t gopFrameCount;
uint32_t idrPeriod;
uint32_t consecutiveBFrameCount;
VkVideoEncodeH265RateControlStructureEXT rateControlStructure;
uint32_t subLayerCount;
} VkVideoEncodeH265RateControlInfoEXT;
typedef struct VkVideoEncodeH265QpEXT {
int32_t qpI;
int32_t qpP;
int32_t qpB;
} VkVideoEncodeH265QpEXT;
typedef struct VkVideoEncodeH265FrameSizeEXT {
uint32_t frameISize;
uint32_t framePSize;
uint32_t frameBSize;
} VkVideoEncodeH265FrameSizeEXT;
typedef struct VkVideoEncodeH265RateControlLayerInfoEXT {
VkStructureType sType;
const void* pNext;
uint32_t temporalId;
VkBool32 useInitialRcQp;
VkVideoEncodeH265QpEXT initialRcQp;
VkBool32 useMinQp;
VkVideoEncodeH265QpEXT minQp;
VkBool32 useMaxQp;
VkVideoEncodeH265QpEXT maxQp;
VkBool32 useMaxFrameSize;
VkVideoEncodeH265FrameSizeEXT maxFrameSize;
} VkVideoEncodeH265RateControlLayerInfoEXT;
// VK_NV_displacement_micromap is a preprocessor guard. Do not pass it to API calls.
#define VK_NV_displacement_micromap 1
#define VK_NV_DISPLACEMENT_MICROMAP_SPEC_VERSION 1
#define VK_NV_DISPLACEMENT_MICROMAP_SPEC_VERSION 2
#define VK_NV_DISPLACEMENT_MICROMAP_EXTENSION_NAME "VK_NV_displacement_micromap"
typedef enum VkDisplacementMicromapFormatNV {

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
#define VULKAN_DIRECTFB_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_EXT_directfb_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_EXT_directfb_surface 1
#define VK_EXT_DIRECTFB_SURFACE_SPEC_VERSION 1
#define VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME "VK_EXT_directfb_surface"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
// Copyright 2015-2023 The Khronos Group Inc.
// Copyright 2015-2025 The Khronos Group Inc.
//
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
@ -12,6 +12,7 @@
namespace VULKAN_HPP_NAMESPACE
{
//=====================
//=== Format Traits ===
//=====================
@ -353,6 +354,8 @@ namespace VULKAN_HPP_NAMESPACE
case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SfloatBlock: return 16;
case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SfloatBlock: return 16;
case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SfloatBlock: return 16;
case VULKAN_HPP_NAMESPACE::Format::eA1B5G5R5UnormPack16: return 2;
case VULKAN_HPP_NAMESPACE::Format::eA8Unorm: return 1;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG: return 8;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppUnormBlockIMG: return 8;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppUnormBlockIMG: return 8;
@ -361,7 +364,7 @@ namespace VULKAN_HPP_NAMESPACE
case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG: return 8;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG: return 8;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG: return 8;
case VULKAN_HPP_NAMESPACE::Format::eR16G16S105NV: return 4;
case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfixed5NV: return 4;
default: VULKAN_HPP_ASSERT( false ); return 0;
}
@ -610,6 +613,8 @@ namespace VULKAN_HPP_NAMESPACE
case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SfloatBlock: return "ASTC_10x10";
case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SfloatBlock: return "ASTC_12x10";
case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SfloatBlock: return "ASTC_12x12";
case VULKAN_HPP_NAMESPACE::Format::eA1B5G5R5UnormPack16: return "16-bit";
case VULKAN_HPP_NAMESPACE::Format::eA8Unorm: return "8-bit alpha";
case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG: return "PVRTC1_2BPP";
case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppUnormBlockIMG: return "PVRTC1_4BPP";
case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppUnormBlockIMG: return "PVRTC2_2BPP";
@ -618,7 +623,7 @@ namespace VULKAN_HPP_NAMESPACE
case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG: return "PVRTC1_4BPP";
case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG: return "PVRTC2_2BPP";
case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG: return "PVRTC2_4BPP";
case VULKAN_HPP_NAMESPACE::Format::eR16G16S105NV: return "32-bit";
case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfixed5NV: return "32-bit";
default: VULKAN_HPP_ASSERT( false ); return "";
}
@ -1592,7 +1597,7 @@ namespace VULKAN_HPP_NAMESPACE
{
case 0: return 10;
case 1: return 11;
case 2: return 10;
case 2: return 11;
default: VULKAN_HPP_ASSERT( false ); return 0;
}
case VULKAN_HPP_NAMESPACE::Format::eE5B9G9R9UfloatPack32:
@ -2000,7 +2005,22 @@ namespace VULKAN_HPP_NAMESPACE
case 3: return 4;
default: VULKAN_HPP_ASSERT( false ); return 0;
}
case VULKAN_HPP_NAMESPACE::Format::eR16G16S105NV:
case VULKAN_HPP_NAMESPACE::Format::eA1B5G5R5UnormPack16:
switch ( component )
{
case 0: return 1;
case 1: return 5;
case 2: return 5;
case 3: return 5;
default: VULKAN_HPP_ASSERT( false ); return 0;
}
case VULKAN_HPP_NAMESPACE::Format::eA8Unorm:
switch ( component )
{
case 0: return 8;
default: VULKAN_HPP_ASSERT( false ); return 0;
}
case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfixed5NV:
switch ( component )
{
case 0: return 16;
@ -2255,6 +2275,8 @@ namespace VULKAN_HPP_NAMESPACE
case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SfloatBlock: return 4;
case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SfloatBlock: return 4;
case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SfloatBlock: return 4;
case VULKAN_HPP_NAMESPACE::Format::eA1B5G5R5UnormPack16: return 4;
case VULKAN_HPP_NAMESPACE::Format::eA8Unorm: return 1;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG: return 4;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppUnormBlockIMG: return 4;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppUnormBlockIMG: return 4;
@ -2263,7 +2285,7 @@ namespace VULKAN_HPP_NAMESPACE
case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG: return 4;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG: return 4;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG: return 4;
case VULKAN_HPP_NAMESPACE::Format::eR16G16S105NV: return 2;
case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfixed5NV: return 2;
default: return 0;
}
@ -2328,8 +2350,8 @@ namespace VULKAN_HPP_NAMESPACE
switch ( component )
{
case 0: return "B";
case 1: return "R";
case 2: return "G";
case 1: return "G";
case 2: return "R";
case 3: return "A";
default: VULKAN_HPP_ASSERT( false ); return "";
}
@ -3164,21 +3186,21 @@ namespace VULKAN_HPP_NAMESPACE
switch ( component )
{
case 0: return "R";
case 1: return "B";
case 1: return "G";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eR64G64Sint:
switch ( component )
{
case 0: return "R";
case 1: return "B";
case 1: return "G";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eR64G64Sfloat:
switch ( component )
{
case 0: return "R";
case 1: return "B";
case 1: return "G";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Uint:
@ -4205,6 +4227,21 @@ namespace VULKAN_HPP_NAMESPACE
case 3: return "A";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eA1B5G5R5UnormPack16:
switch ( component )
{
case 0: return "A";
case 1: return "B";
case 2: return "G";
case 3: return "R";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eA8Unorm:
switch ( component )
{
case 0: return "A";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG:
switch ( component )
{
@ -4277,7 +4314,7 @@ namespace VULKAN_HPP_NAMESPACE
case 3: return "A";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eR16G16S105NV:
case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfixed5NV:
switch ( component )
{
case 0: return "R";
@ -4625,7 +4662,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Unorm:
@ -4688,7 +4725,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UnormPack32:
@ -4748,7 +4785,7 @@ namespace VULKAN_HPP_NAMESPACE
case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SrgbPack32:
switch ( component )
{
case 0: return "SRGB";
case 0: return "UNORM";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
@ -5344,7 +5381,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eBc2UnormBlock:
@ -5362,7 +5399,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eBc3UnormBlock:
@ -5380,7 +5417,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eBc4UnormBlock:
@ -5392,7 +5429,7 @@ namespace VULKAN_HPP_NAMESPACE
case VULKAN_HPP_NAMESPACE::Format::eBc4SnormBlock:
switch ( component )
{
case 0: return "SRGB";
case 0: return "SNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eBc5UnormBlock:
@ -5405,8 +5442,8 @@ namespace VULKAN_HPP_NAMESPACE
case VULKAN_HPP_NAMESPACE::Format::eBc5SnormBlock:
switch ( component )
{
case 0: return "SRGB";
case 1: return "SRGB";
case 0: return "SNORM";
case 1: return "SNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eBc6HUfloatBlock:
@ -5440,7 +5477,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8UnormBlock:
@ -5474,7 +5511,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8UnormBlock:
@ -5492,7 +5529,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eEacR11UnormBlock:
@ -5536,7 +5573,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc5x4UnormBlock:
@ -5554,7 +5591,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc5x5UnormBlock:
@ -5572,7 +5609,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc6x5UnormBlock:
@ -5590,7 +5627,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc6x6UnormBlock:
@ -5608,7 +5645,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc8x5UnormBlock:
@ -5626,7 +5663,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc8x6UnormBlock:
@ -5644,7 +5681,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc8x8UnormBlock:
@ -5662,7 +5699,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc10x5UnormBlock:
@ -5680,7 +5717,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc10x6UnormBlock:
@ -5698,7 +5735,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc10x8UnormBlock:
@ -5716,7 +5753,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc10x10UnormBlock:
@ -5734,7 +5771,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc12x10UnormBlock:
@ -5752,7 +5789,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eAstc12x12UnormBlock:
@ -5770,7 +5807,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eG8B8G8R8422Unorm:
@ -6225,6 +6262,21 @@ namespace VULKAN_HPP_NAMESPACE
case 3: return "SFLOAT";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eA1B5G5R5UnormPack16:
switch ( component )
{
case 0: return "UNORM";
case 1: return "UNORM";
case 2: return "UNORM";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eA8Unorm:
switch ( component )
{
case 0: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG:
switch ( component )
{
@ -6267,7 +6319,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG:
@ -6276,7 +6328,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG:
@ -6285,7 +6337,7 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG:
@ -6294,14 +6346,14 @@ namespace VULKAN_HPP_NAMESPACE
case 0: return "SRGB";
case 1: return "SRGB";
case 2: return "SRGB";
case 3: return "SRGB";
case 3: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eR16G16S105NV:
case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfixed5NV:
switch ( component )
{
case 0: return "SINT";
case 1: return "SINT";
case 0: return "SFIXED5";
case 1: return "SFIXED5";
default: VULKAN_HPP_ASSERT( false ); return "";
}
@ -6744,6 +6796,7 @@ namespace VULKAN_HPP_NAMESPACE
case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: return 16;
case VULKAN_HPP_NAMESPACE::Format::eA4R4G4B4UnormPack16: return 16;
case VULKAN_HPP_NAMESPACE::Format::eA4B4G4R4UnormPack16: return 16;
case VULKAN_HPP_NAMESPACE::Format::eA1B5G5R5UnormPack16: return 16;
default: return 0;
}
@ -7596,6 +7649,8 @@ namespace VULKAN_HPP_NAMESPACE
case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SfloatBlock: return 100;
case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SfloatBlock: return 120;
case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SfloatBlock: return 144;
case VULKAN_HPP_NAMESPACE::Format::eA1B5G5R5UnormPack16: return 1;
case VULKAN_HPP_NAMESPACE::Format::eA8Unorm: return 1;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG: return 1;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppUnormBlockIMG: return 1;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppUnormBlockIMG: return 1;
@ -7604,7 +7659,7 @@ namespace VULKAN_HPP_NAMESPACE
case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG: return 1;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG: return 1;
case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG: return 1;
case VULKAN_HPP_NAMESPACE::Format::eR16G16S105NV: return 1;
case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfixed5NV: return 1;
default: VULKAN_HPP_ASSERT( false ); return 0;
}

View file

@ -2,7 +2,7 @@
#define VULKAN_FUCHSIA_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_FUCHSIA_imagepipe_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_FUCHSIA_imagepipe_surface 1
#define VK_FUCHSIA_IMAGEPIPE_SURFACE_SPEC_VERSION 1
#define VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME "VK_FUCHSIA_imagepipe_surface"
@ -41,6 +42,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA(
#endif
// VK_FUCHSIA_external_memory is a preprocessor guard. Do not pass it to API calls.
#define VK_FUCHSIA_external_memory 1
#define VK_FUCHSIA_EXTERNAL_MEMORY_SPEC_VERSION 1
#define VK_FUCHSIA_EXTERNAL_MEMORY_EXTENSION_NAME "VK_FUCHSIA_external_memory"
@ -81,6 +83,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandlePropertiesFUCHSIA(
#endif
// VK_FUCHSIA_external_semaphore is a preprocessor guard. Do not pass it to API calls.
#define VK_FUCHSIA_external_semaphore 1
#define VK_FUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION 1
#define VK_FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_FUCHSIA_external_semaphore"
@ -115,6 +118,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreZirconHandleFUCHSIA(
#endif
// VK_FUCHSIA_buffer_collection is a preprocessor guard. Do not pass it to API calls.
#define VK_FUCHSIA_buffer_collection 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferCollectionFUCHSIA)
#define VK_FUCHSIA_BUFFER_COLLECTION_SPEC_VERSION 2

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
#define VULKAN_GGP_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_GGP_stream_descriptor_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_GGP_stream_descriptor_surface 1
#define VK_GGP_STREAM_DESCRIPTOR_SURFACE_SPEC_VERSION 1
#define VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME "VK_GGP_stream_descriptor_surface"
@ -41,6 +42,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateStreamDescriptorSurfaceGGP(
#endif
// VK_GGP_frame_token is a preprocessor guard. Do not pass it to API calls.
#define VK_GGP_frame_token 1
#define VK_GGP_FRAME_TOKEN_SPEC_VERSION 1
#define VK_GGP_FRAME_TOKEN_EXTENSION_NAME "VK_GGP_frame_token"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,326 @@
// Copyright 2015-2025 The Khronos Group Inc.
//
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// This header is generated from the Khronos Vulkan XML API Registry.
#ifndef VULKAN_HPP_MACROS_HPP
#define VULKAN_HPP_MACROS_HPP
#if defined( _MSVC_LANG )
# define VULKAN_HPP_CPLUSPLUS _MSVC_LANG
#else
# define VULKAN_HPP_CPLUSPLUS __cplusplus
#endif
#if 202002L < VULKAN_HPP_CPLUSPLUS
# define VULKAN_HPP_CPP_VERSION 23
#elif 201703L < VULKAN_HPP_CPLUSPLUS
# define VULKAN_HPP_CPP_VERSION 20
#elif 201402L < VULKAN_HPP_CPLUSPLUS
# define VULKAN_HPP_CPP_VERSION 17
#elif 201103L < VULKAN_HPP_CPLUSPLUS
# define VULKAN_HPP_CPP_VERSION 14
#elif 199711L < VULKAN_HPP_CPLUSPLUS
# define VULKAN_HPP_CPP_VERSION 11
#else
# error "vulkan.hpp needs at least c++ standard version 11"
#endif
// include headers holding feature-test macros
#if 20 <= VULKAN_HPP_CPP_VERSION
# include <version>
#else
# include <ciso646>
#endif
#if defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
# if !defined( VULKAN_HPP_NO_SMART_HANDLE )
# define VULKAN_HPP_NO_SMART_HANDLE
# endif
#endif
#if defined( VULKAN_HPP_NO_CONSTRUCTORS )
# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS )
# define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS
# endif
# if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS )
# define VULKAN_HPP_NO_UNION_CONSTRUCTORS
# endif
#endif
#if defined( VULKAN_HPP_NO_SETTERS )
# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS )
# define VULKAN_HPP_NO_STRUCT_SETTERS
# endif
# if !defined( VULKAN_HPP_NO_UNION_SETTERS )
# define VULKAN_HPP_NO_UNION_SETTERS
# endif
#endif
#if !defined( VULKAN_HPP_ASSERT )
# define VULKAN_HPP_ASSERT assert
#endif
#if !defined( VULKAN_HPP_ASSERT_ON_RESULT )
# define VULKAN_HPP_ASSERT_ON_RESULT VULKAN_HPP_ASSERT
#endif
#if !defined( VULKAN_HPP_STATIC_ASSERT )
# define VULKAN_HPP_STATIC_ASSERT static_assert
#endif
#if !defined( VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL )
# define VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL 1
#endif
#if !defined( __has_include )
# define __has_include( x ) false
#endif
#if defined( __cpp_lib_three_way_comparison ) && ( 201907 <= __cpp_lib_three_way_comparison ) && __has_include( <compare> ) && !defined( VULKAN_HPP_NO_SPACESHIP_OPERATOR )
# define VULKAN_HPP_HAS_SPACESHIP_OPERATOR
#endif
#if defined( __cpp_lib_span ) && ( 201803 <= __cpp_lib_span )
# define VULKAN_HPP_SUPPORT_SPAN
#endif
#if defined( __cpp_lib_modules ) && !defined( VULKAN_HPP_STD_MODULE ) && defined( VULKAN_HPP_ENABLE_STD_MODULE )
# define VULKAN_HPP_STD_MODULE std.compat
#endif
#ifndef VK_USE_64_BIT_PTR_DEFINES
# if defined( __LP64__ ) || defined( _WIN64 ) || ( defined( __x86_64__ ) && !defined( __ILP32__ ) ) || defined( _M_X64 ) || defined( __ia64 ) || \
defined( _M_IA64 ) || defined( __aarch64__ ) || defined( __powerpc64__ ) || ( defined( __riscv ) && __riscv_xlen == 64 )
# define VK_USE_64_BIT_PTR_DEFINES 1
# else
# define VK_USE_64_BIT_PTR_DEFINES 0
# endif
#endif
// 32-bit vulkan is not typesafe for non-dispatchable handles, so don't allow copy constructors on this platform by default.
// To enable this feature on 32-bit platforms please #define VULKAN_HPP_TYPESAFE_CONVERSION 1
// To disable this feature on 64-bit platforms please #define VULKAN_HPP_TYPESAFE_CONVERSION 0
#if ( VK_USE_64_BIT_PTR_DEFINES == 1 )
# if !defined( VULKAN_HPP_TYPESAFE_CONVERSION )
# define VULKAN_HPP_TYPESAFE_CONVERSION 1
# endif
#endif
#if defined( __GNUC__ )
# define GCC_VERSION ( __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ )
#endif
#if !defined( VULKAN_HPP_HAS_UNRESTRICTED_UNIONS )
# if defined( __clang__ )
# if __has_feature( cxx_unrestricted_unions )
# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
# endif
# elif defined( __GNUC__ )
# if 40600 <= GCC_VERSION
# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
# endif
# elif defined( _MSC_VER )
# if 1900 <= _MSC_VER
# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
# endif
# endif
#endif
#if !defined( VULKAN_HPP_INLINE )
# if defined( __clang__ )
# if __has_attribute( always_inline )
# define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__
# else
# define VULKAN_HPP_INLINE inline
# endif
# elif defined( __GNUC__ )
# define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__
# elif defined( _MSC_VER )
# define VULKAN_HPP_INLINE inline
# else
# define VULKAN_HPP_INLINE inline
# endif
#endif
#if ( VULKAN_HPP_TYPESAFE_CONVERSION == 1 )
# define VULKAN_HPP_TYPESAFE_EXPLICIT
#else
# define VULKAN_HPP_TYPESAFE_EXPLICIT explicit
#endif
#if defined( __cpp_constexpr )
# define VULKAN_HPP_CONSTEXPR constexpr
# if 201304 <= __cpp_constexpr
# define VULKAN_HPP_CONSTEXPR_14 constexpr
# else
# define VULKAN_HPP_CONSTEXPR_14
# endif
# if ( 201907 <= __cpp_constexpr ) && ( !defined( __GNUC__ ) || ( 110400 < GCC_VERSION ) )
# define VULKAN_HPP_CONSTEXPR_20 constexpr
# else
# define VULKAN_HPP_CONSTEXPR_20
# endif
# define VULKAN_HPP_CONST_OR_CONSTEXPR constexpr
#else
# define VULKAN_HPP_CONSTEXPR
# define VULKAN_HPP_CONSTEXPR_14
# define VULKAN_HPP_CONST_OR_CONSTEXPR const
#endif
#if !defined( VULKAN_HPP_CONSTEXPR_INLINE )
# if 201606L <= __cpp_inline_variables
# define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR inline
# else
# define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR
# endif
#endif
#if !defined( VULKAN_HPP_NOEXCEPT )
# if defined( _MSC_VER ) && ( _MSC_VER <= 1800 )
# define VULKAN_HPP_NOEXCEPT
# else
# define VULKAN_HPP_NOEXCEPT noexcept
# define VULKAN_HPP_HAS_NOEXCEPT 1
# if defined( VULKAN_HPP_NO_EXCEPTIONS )
# define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS noexcept
# else
# define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS
# endif
# endif
#endif
#if 14 <= VULKAN_HPP_CPP_VERSION
# define VULKAN_HPP_DEPRECATED( msg ) [[deprecated( msg )]]
#else
# define VULKAN_HPP_DEPRECATED( msg )
#endif
#if 17 <= VULKAN_HPP_CPP_VERSION
# define VULKAN_HPP_DEPRECATED_17( msg ) [[deprecated( msg )]]
#else
# define VULKAN_HPP_DEPRECATED_17( msg )
#endif
#if ( 17 <= VULKAN_HPP_CPP_VERSION ) && !defined( VULKAN_HPP_NO_NODISCARD_WARNINGS )
# define VULKAN_HPP_NODISCARD [[nodiscard]]
# if defined( VULKAN_HPP_NO_EXCEPTIONS )
# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS [[nodiscard]]
# else
# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS
# endif
#else
# define VULKAN_HPP_NODISCARD
# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS
#endif
#if !defined( VULKAN_HPP_NAMESPACE )
# define VULKAN_HPP_NAMESPACE vk
#endif
#define VULKAN_HPP_STRINGIFY2( text ) #text
#define VULKAN_HPP_STRINGIFY( text ) VULKAN_HPP_STRINGIFY2( text )
#define VULKAN_HPP_NAMESPACE_STRING VULKAN_HPP_STRINGIFY( VULKAN_HPP_NAMESPACE )
#if !defined( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC )
# if defined( VK_NO_PROTOTYPES )
# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1
# else
# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 0
# endif
#endif
#if !defined( VULKAN_HPP_STORAGE_API )
# if defined( VULKAN_HPP_STORAGE_SHARED )
# if defined( _MSC_VER )
# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT )
# define VULKAN_HPP_STORAGE_API __declspec( dllexport )
# else
# define VULKAN_HPP_STORAGE_API __declspec( dllimport )
# endif
# elif defined( __clang__ ) || defined( __GNUC__ )
# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT )
# define VULKAN_HPP_STORAGE_API __attribute__( ( visibility( "default" ) ) )
# else
# define VULKAN_HPP_STORAGE_API
# endif
# else
# define VULKAN_HPP_STORAGE_API
# pragma warning Unknown import / export semantics
# endif
# else
# define VULKAN_HPP_STORAGE_API
# endif
#endif
namespace VULKAN_HPP_NAMESPACE
{
namespace detail
{
class DispatchLoaderDynamic;
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
extern VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic;
# endif
#endif
} // namespace detail
} // namespace VULKAN_HPP_NAMESPACE
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::defaultDispatchLoaderDynamic
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \
namespace VULKAN_HPP_NAMESPACE \
{ \
namespace detail \
{ \
VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
} \
}
# else
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::getDispatchLoaderStatic()
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
# endif
#endif
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER_TYPE )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderDynamic
# else
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic
# endif
#endif
#if defined( VULKAN_HPP_NO_DEFAULT_DISPATCHER )
# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT
# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT
# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT
#else
# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT = {}
# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT = nullptr
# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT = VULKAN_HPP_DEFAULT_DISPATCHER
#endif
#if !defined( VULKAN_HPP_EXPECTED ) && ( 23 <= VULKAN_HPP_CPP_VERSION ) && defined( __cpp_lib_expected )
# if !( defined( VULKAN_HPP_ENABLE_STD_MODULE ) && defined( VULKAN_HPP_STD_MODULE ) )
# include <expected>
# endif
# define VULKAN_HPP_EXPECTED std::expected
# define VULKAN_HPP_UNEXPECTED std::unexpected
#endif
#if !defined( VULKAN_HPP_RAII_NAMESPACE )
# define VULKAN_HPP_RAII_NAMESPACE raii
#endif
#if defined( VULKAN_HPP_NO_EXCEPTIONS ) && defined( VULKAN_HPP_EXPECTED )
# define VULKAN_HPP_RAII_NO_EXCEPTIONS
# define VULKAN_HPP_RAII_CREATE_NOEXCEPT noexcept
#else
# define VULKAN_HPP_RAII_CREATE_NOEXCEPT
#endif
#endif

View file

@ -2,7 +2,7 @@
#define VULKAN_IOS_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_MVK_ios_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_MVK_ios_surface 1
#define VK_MVK_IOS_SURFACE_SPEC_VERSION 3
#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface"

View file

@ -2,7 +2,7 @@
#define VULKAN_MACOS_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_MVK_macos_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_MVK_macos_surface 1
#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 3
#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface"

View file

@ -2,7 +2,7 @@
#define VULKAN_METAL_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_EXT_metal_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_EXT_metal_surface 1
#ifdef __OBJC__
@class CAMetalLayer;
@ -47,31 +48,32 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT(
#endif
// VK_EXT_metal_objects is a preprocessor guard. Do not pass it to API calls.
#define VK_EXT_metal_objects 1
#ifdef __OBJC__
@protocol MTLDevice;
typedef id<MTLDevice> MTLDevice_id;
typedef __unsafe_unretained id<MTLDevice> MTLDevice_id;
#else
typedef void* MTLDevice_id;
#endif
#ifdef __OBJC__
@protocol MTLCommandQueue;
typedef id<MTLCommandQueue> MTLCommandQueue_id;
typedef __unsafe_unretained id<MTLCommandQueue> MTLCommandQueue_id;
#else
typedef void* MTLCommandQueue_id;
#endif
#ifdef __OBJC__
@protocol MTLBuffer;
typedef id<MTLBuffer> MTLBuffer_id;
typedef __unsafe_unretained id<MTLBuffer> MTLBuffer_id;
#else
typedef void* MTLBuffer_id;
#endif
#ifdef __OBJC__
@protocol MTLTexture;
typedef id<MTLTexture> MTLTexture_id;
typedef __unsafe_unretained id<MTLTexture> MTLTexture_id;
#else
typedef void* MTLTexture_id;
#endif
@ -79,12 +81,12 @@ typedef void* MTLTexture_id;
typedef struct __IOSurface* IOSurfaceRef;
#ifdef __OBJC__
@protocol MTLSharedEvent;
typedef id<MTLSharedEvent> MTLSharedEvent_id;
typedef __unsafe_unretained id<MTLSharedEvent> MTLSharedEvent_id;
#else
typedef void* MTLSharedEvent_id;
#endif
#define VK_EXT_METAL_OBJECTS_SPEC_VERSION 1
#define VK_EXT_METAL_OBJECTS_SPEC_VERSION 2
#define VK_EXT_METAL_OBJECTS_EXTENSION_NAME "VK_EXT_metal_objects"
typedef enum VkExportMetalObjectTypeFlagBitsEXT {
@ -186,6 +188,47 @@ VKAPI_ATTR void VKAPI_CALL vkExportMetalObjectsEXT(
VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
#endif
// VK_EXT_external_memory_metal is a preprocessor guard. Do not pass it to API calls.
#define VK_EXT_external_memory_metal 1
#define VK_EXT_EXTERNAL_MEMORY_METAL_SPEC_VERSION 1
#define VK_EXT_EXTERNAL_MEMORY_METAL_EXTENSION_NAME "VK_EXT_external_memory_metal"
typedef struct VkImportMemoryMetalHandleInfoEXT {
VkStructureType sType;
const void* pNext;
VkExternalMemoryHandleTypeFlagBits handleType;
void* handle;
} VkImportMemoryMetalHandleInfoEXT;
typedef struct VkMemoryMetalHandlePropertiesEXT {
VkStructureType sType;
void* pNext;
uint32_t memoryTypeBits;
} VkMemoryMetalHandlePropertiesEXT;
typedef struct VkMemoryGetMetalHandleInfoEXT {
VkStructureType sType;
const void* pNext;
VkDeviceMemory memory;
VkExternalMemoryHandleTypeFlagBits handleType;
} VkMemoryGetMetalHandleInfoEXT;
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryMetalHandleEXT)(VkDevice device, const VkMemoryGetMetalHandleInfoEXT* pGetMetalHandleInfo, void** pHandle);
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryMetalHandlePropertiesEXT)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHandle, VkMemoryMetalHandlePropertiesEXT* pMemoryMetalHandleProperties);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryMetalHandleEXT(
VkDevice device,
const VkMemoryGetMetalHandleInfoEXT* pGetMetalHandleInfo,
void** pHandle);
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryMetalHandlePropertiesEXT(
VkDevice device,
VkExternalMemoryHandleTypeFlagBits handleType,
const void* pHandle,
VkMemoryMetalHandlePropertiesEXT* pMemoryMetalHandleProperties);
#endif
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
#define VULKAN_SCREEN_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_QNX_screen_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_QNX_screen_surface 1
#define VK_QNX_SCREEN_SURFACE_SPEC_VERSION 1
#define VK_QNX_SCREEN_SURFACE_EXTENSION_NAME "VK_QNX_screen_surface"
@ -47,6 +48,59 @@ VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceScreenPresentationSupportQNX(
struct _screen_window* window);
#endif
// VK_QNX_external_memory_screen_buffer is a preprocessor guard. Do not pass it to API calls.
#define VK_QNX_external_memory_screen_buffer 1
#define VK_QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION 1
#define VK_QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME "VK_QNX_external_memory_screen_buffer"
typedef struct VkScreenBufferPropertiesQNX {
VkStructureType sType;
void* pNext;
VkDeviceSize allocationSize;
uint32_t memoryTypeBits;
} VkScreenBufferPropertiesQNX;
typedef struct VkScreenBufferFormatPropertiesQNX {
VkStructureType sType;
void* pNext;
VkFormat format;
uint64_t externalFormat;
uint64_t screenUsage;
VkFormatFeatureFlags formatFeatures;
VkComponentMapping samplerYcbcrConversionComponents;
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
VkSamplerYcbcrRange suggestedYcbcrRange;
VkChromaLocation suggestedXChromaOffset;
VkChromaLocation suggestedYChromaOffset;
} VkScreenBufferFormatPropertiesQNX;
typedef struct VkImportScreenBufferInfoQNX {
VkStructureType sType;
const void* pNext;
struct _screen_buffer* buffer;
} VkImportScreenBufferInfoQNX;
typedef struct VkExternalFormatQNX {
VkStructureType sType;
void* pNext;
uint64_t externalFormat;
} VkExternalFormatQNX;
typedef struct VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX {
VkStructureType sType;
void* pNext;
VkBool32 screenBufferImport;
} VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX;
typedef VkResult (VKAPI_PTR *PFN_vkGetScreenBufferPropertiesQNX)(VkDevice device, const struct _screen_buffer* buffer, VkScreenBufferPropertiesQNX* pProperties);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetScreenBufferPropertiesQNX(
VkDevice device,
const struct _screen_buffer* buffer,
VkScreenBufferPropertiesQNX* pProperties);
#endif
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
#define VULKAN_VI_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_NN_vi_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_NN_vi_surface 1
#define VK_NN_VI_SURFACE_SPEC_VERSION 1
#define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface"

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
#define VULKAN_WAYLAND_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_KHR_wayland_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_KHR_wayland_surface 1
#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6
#define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface"

View file

@ -2,7 +2,7 @@
#define VULKAN_WIN32_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_KHR_win32_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_KHR_win32_surface 1
#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6
#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface"
@ -47,6 +48,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(
#endif
// VK_KHR_external_memory_win32 is a preprocessor guard. Do not pass it to API calls.
#define VK_KHR_external_memory_win32 1
#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32"
@ -96,6 +98,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(
#endif
// VK_KHR_win32_keyed_mutex is a preprocessor guard. Do not pass it to API calls.
#define VK_KHR_win32_keyed_mutex 1
#define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1
#define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex"
@ -113,6 +116,7 @@ typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR {
// VK_KHR_external_semaphore_win32 is a preprocessor guard. Do not pass it to API calls.
#define VK_KHR_external_semaphore_win32 1
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32"
@ -165,6 +169,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR(
#endif
// VK_KHR_external_fence_win32 is a preprocessor guard. Do not pass it to API calls.
#define VK_KHR_external_fence_win32 1
#define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32"
@ -208,6 +213,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR(
#endif
// VK_NV_external_memory_win32 is a preprocessor guard. Do not pass it to API calls.
#define VK_NV_external_memory_win32 1
#define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
#define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
@ -236,6 +242,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(
#endif
// VK_NV_win32_keyed_mutex is a preprocessor guard. Do not pass it to API calls.
#define VK_NV_win32_keyed_mutex 1
#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 2
#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
@ -253,6 +260,7 @@ typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV {
// VK_EXT_full_screen_exclusive is a preprocessor guard. Do not pass it to API calls.
#define VK_EXT_full_screen_exclusive 1
#define VK_EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION 4
#define VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME "VK_EXT_full_screen_exclusive"
@ -309,6 +317,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModes2EXT(
#endif
// VK_NV_acquire_winrt_display is a preprocessor guard. Do not pass it to API calls.
#define VK_NV_acquire_winrt_display 1
#define VK_NV_ACQUIRE_WINRT_DISPLAY_SPEC_VERSION 1
#define VK_NV_ACQUIRE_WINRT_DISPLAY_EXTENSION_NAME "VK_NV_acquire_winrt_display"

View file

@ -2,7 +2,7 @@
#define VULKAN_XCB_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_KHR_xcb_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_KHR_xcb_surface 1
#define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface"

View file

@ -2,7 +2,7 @@
#define VULKAN_XLIB_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_KHR_xlib_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_KHR_xlib_surface 1
#define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
#define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface"

View file

@ -2,7 +2,7 @@
#define VULKAN_XLIB_XRANDR_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@ extern "C" {
// VK_EXT_acquire_xlib_display is a preprocessor guard. Do not pass it to API calls.
#define VK_EXT_acquire_xlib_display 1
#define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1
#define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display"

View file

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2021-2023 The Khronos Group Inc.
# Copyright 2021-2025 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
# Generic alias for working group-specific API conventions interface.
@ -8,4 +8,14 @@
# This import should be changed at the repository / working group level to
# specify the correct API's conventions.
from vkconventions import VulkanConventions as APIConventions
import os
defaultAPI = 'vulkan'
VulkanAPI = os.getenv('VULKAN_API', default=defaultAPI)
if VulkanAPI == 'vulkansc':
from vkconventions import VulkanSCConventions as APIConventions
else:
from vkconventions import VulkanConventions as APIConventions

803
registry/base_generator.py Normal file
View file

@ -0,0 +1,803 @@
#!/usr/bin/env python3 -i
#
# Copyright 2023-2025 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
import pickle
import os
import tempfile
from vulkan_object import (VulkanObject,
Extension, Version, Handle, Param, Queues, CommandScope, Command,
EnumField, Enum, Flag, Bitmask, Member, Struct,
FormatComponent, FormatPlane, Format,
SyncSupport, SyncEquivalent, SyncStage, SyncAccess, SyncPipelineStage, SyncPipeline,
SpirvEnables, Spirv)
# These live in the Vulkan-Docs repo, but are pulled in via the
# Vulkan-Headers/registry folder
from generator import OutputGenerator, GeneratorOptions, write
from vkconventions import VulkanConventions
# An API style convention object
vulkanConventions = VulkanConventions()
# Helpers to keep things cleaner
def splitIfGet(elem, name):
return elem.get(name).split(',') if elem.get(name) is not None and elem.get(name) != '' else None
def textIfFind(elem, name):
return elem.find(name).text if elem.find(name) is not None else None
def intIfGet(elem, name):
return None if elem.get(name) is None else int(elem.get(name), 0)
def boolGet(elem, name) -> bool:
return elem.get(name) is not None and elem.get(name) == "true"
def getQueues(elem) -> Queues:
queues = 0
queues_list = splitIfGet(elem, 'queues')
if queues_list is not None:
queues |= Queues.TRANSFER if 'transfer' in queues_list else 0
queues |= Queues.GRAPHICS if 'graphics' in queues_list else 0
queues |= Queues.COMPUTE if 'compute' in queues_list else 0
queues |= Queues.PROTECTED if 'protected' in queues_list else 0
queues |= Queues.SPARSE_BINDING if 'sparse_binding' in queues_list else 0
queues |= Queues.OPTICAL_FLOW if 'opticalflow' in queues_list else 0
queues |= Queues.DECODE if 'decode' in queues_list else 0
queues |= Queues.ENCODE if 'encode' in queues_list else 0
return queues
# Shared object used by Sync elements that do not have ones
maxSyncSupport = SyncSupport(None, None, True)
maxSyncEquivalent = SyncEquivalent(None, None, True)
# Helpers to set GeneratorOptions options globally
def SetOutputFileName(fileName: str) -> None:
global globalFileName
globalFileName = fileName
def SetOutputDirectory(directory: str) -> None:
global globalDirectory
globalDirectory = directory
def SetTargetApiName(apiname: str) -> None:
global globalApiName
globalApiName = apiname
def SetMergedApiNames(names: str) -> None:
global mergedApiNames
mergedApiNames = names
cachingEnabled = False
def EnableCaching() -> None:
global cachingEnabled
cachingEnabled = True
# This class is a container for any source code, data, or other behavior that is necessary to
# customize the generator script for a specific target API variant (e.g. Vulkan SC). As such,
# all of these API-specific interfaces and their use in the generator script are part of the
# contract between this repository and its downstream users. Changing or removing any of these
# interfaces or their use in the generator script will have downstream effects and thus
# should be avoided unless absolutely necessary.
class APISpecific:
# Version object factory method
@staticmethod
def createApiVersion(targetApiName: str, name: str) -> Version:
match targetApiName:
# Vulkan SC specific API version creation
case 'vulkansc':
nameApi = name.replace('VK_', 'VK_API_')
nameApi = nameApi.replace('VKSC_', 'VKSC_API_')
nameString = f'"{name}"'
return Version(name, nameString, nameApi)
# Vulkan specific API version creation
case 'vulkan':
nameApi = name.replace('VK_', 'VK_API_')
nameString = f'"{name}"'
return Version(name, nameString, nameApi)
# This Generator Option is used across all generators.
# After years of use, it has shown that most the options are unified across each generator (file)
# as it is easier to modify things per-file that need the difference
class BaseGeneratorOptions(GeneratorOptions):
def __init__(self,
customFileName = None,
customDirectory = None,
customApiName = None):
GeneratorOptions.__init__(self,
conventions = vulkanConventions,
filename = customFileName if customFileName else globalFileName,
directory = customDirectory if customDirectory else globalDirectory,
apiname = customApiName if customApiName else globalApiName,
mergeApiNames = mergedApiNames,
defaultExtensions = customApiName if customApiName else globalApiName,
emitExtensions = '.*',
emitSpirv = '.*',
emitFormats = '.*')
# These are used by the generator.py script
self.apicall = 'VKAPI_ATTR '
self.apientry = 'VKAPI_CALL '
self.apientryp = 'VKAPI_PTR *'
self.alignFuncParam = 48
#
# This object handles all the parsing from reg.py generator scripts in the Vulkan-Headers
# It will grab all the data and form it into a single object the rest of the generators will use
class BaseGenerator(OutputGenerator):
def __init__(self):
OutputGenerator.__init__(self, None, None, None)
self.vk = VulkanObject()
self.targetApiName = globalApiName
# reg.py has a `self.featureName` but this is nicer because
# it will be either the Version or Extension object
self.currentExtension = None
self.currentVersion = None
# Will map alias to promoted name
# ex. ['VK_FILTER_CUBIC_IMG' : 'VK_FILTER_CUBIC_EXT']
# When generating any code, there is no reason so use the old name
self.enumAliasMap = dict()
self.enumFieldAliasMap = dict()
self.bitmaskAliasMap = dict()
self.flagAliasMap = dict()
self.structAliasMap = dict()
self.handleAliasMap = dict()
def write(self, data):
# Prevents having to check before writing
if data is not None and data != "":
write(data, file=self.outFile)
def beginFile(self, genOpts):
OutputGenerator.beginFile(self, genOpts)
self.filename = genOpts.filename
# No gen*() command to get these, so do it manually
for platform in self.registry.tree.findall('platforms/platform'):
self.vk.platforms[platform.get('name')] = platform.get('protect')
for tags in self.registry.tree.findall('tags'):
for tag in tags.findall('tag'):
self.vk.vendorTags.append(tag.get('name'))
# No way known to get this from the XML
self.vk.queueBits[Queues.TRANSFER] = 'VK_QUEUE_TRANSFER_BIT'
self.vk.queueBits[Queues.GRAPHICS] = 'VK_QUEUE_GRAPHICS_BIT'
self.vk.queueBits[Queues.COMPUTE] = 'VK_QUEUE_COMPUTE_BIT'
self.vk.queueBits[Queues.PROTECTED] = 'VK_QUEUE_PROTECTED_BIT'
self.vk.queueBits[Queues.SPARSE_BINDING] = 'VK_QUEUE_SPARSE_BINDING_BIT'
self.vk.queueBits[Queues.OPTICAL_FLOW] = 'VK_QUEUE_OPTICAL_FLOW_BIT_NV'
self.vk.queueBits[Queues.DECODE] = 'VK_QUEUE_VIDEO_DECODE_BIT_KHR'
self.vk.queueBits[Queues.ENCODE] = 'VK_QUEUE_VIDEO_ENCODE_BIT_KHR'
# This function should be overloaded
def generate(self):
print("WARNING: This should not be called from the child class")
return
# This function is dense, it does all the magic to set the right extensions dependencies!
#
# The issue is if 2 extension expose a command, genCmd() will only
# show one of the extension, at endFile() we can finally go through
# and update which things depend on which extensions
#
# self.featureDictionary is built for use in the reg.py framework
# Details found in Vulkan-Docs/scripts/scriptgenerator.py
def applyExtensionDependency(self):
for extension in self.vk.extensions.values():
# dict.key() can be None, so need to double loop
dict = self.featureDictionary[extension.name]['command']
# "required" == None
# or
# an additional feature dependency, which is a boolean expression of
# one or more extension and/or core version names
for required in dict:
for commandName in dict[required]:
# Skip commands removed in the target API
# This check is needed because parts of the base generator code bypass the
# dependency resolution logic in the registry tooling and thus the generator
# may attempt to generate code for commands which are not supported in the
# target API variant, thus this check needs to happen even if any specific
# target API variant may not specifically need it
if not commandName in self.vk.commands:
continue
command = self.vk.commands[commandName]
# Make sure list is unique
command.extensions.extend([extension] if extension not in command.extensions else [])
extension.commands.extend([command] if command not in extension.commands else [])
# While genGroup() will call twice with aliased value, it does not provide all the information we need
dict = self.featureDictionary[extension.name]['enumconstant']
for required in dict:
# group can be a Enum or Bitmask
for group in dict[required]:
if group in self.vk.enums:
if group not in extension.enumFields:
extension.enumFields[group] = [] # Dict needs init
enum = self.vk.enums[group]
# Need to convert all alias so they match what is in EnumField
enumList = list(map(lambda x: x if x not in self.enumFieldAliasMap else self.enumFieldAliasMap[x], dict[required][group]))
for enumField in [x for x in enum.fields if x.name in enumList]:
# Make sure list is unique
enum.fieldExtensions.extend([extension] if extension not in enum.fieldExtensions else [])
enumField.extensions.extend([extension] if extension not in enumField.extensions else [])
extension.enumFields[group].extend([enumField] if enumField not in extension.enumFields[group] else [])
if group in self.vk.bitmasks:
if group not in extension.flags:
extension.flags[group] = [] # Dict needs init
bitmask = self.vk.bitmasks[group]
# Need to convert all alias so they match what is in Flags
flagList = list(map(lambda x: x if x not in self.flagAliasMap else self.flagAliasMap[x], dict[required][group]))
for flags in [x for x in bitmask.flags if x.name in flagList]:
# Make sure list is unique
bitmask.flagExtensions.extend([extension] if extension not in bitmask.flagExtensions else [])
flags.extensions.extend([extension] if extension not in flags.extensions else [])
extension.flags[group].extend([flags] if flags not in extension.flags[group] else [])
# Need to do 'enum'/'bitmask' after 'enumconstant' has applied everything so we can add implicit extensions
#
# Sometimes two extensions enable an Enum, but the newer extension version has extra flags allowed
# This information seems to be implicit, so need to update it here
# Go through each Flag and append the Enum extension to it
#
# ex. VkAccelerationStructureTypeKHR where GENERIC_KHR is not allowed with just VK_NV_ray_tracing
# This only works because the values are aliased as well, making the KHR a superset enum
for extension in self.vk.extensions.values():
dict = self.featureDictionary[extension.name]['enum']
for required in dict:
for group in dict[required]:
for enumName in dict[required][group]:
isAlias = enumName in self.enumAliasMap
enumName = self.enumAliasMap[enumName] if isAlias else enumName
if enumName in self.vk.enums:
enum = self.vk.enums[enumName]
enum.extensions.extend([extension] if extension not in enum.extensions else [])
extension.enums.extend([enum] if enum not in extension.enums else [])
# Update fields with implicit base extension
if isAlias:
continue
enum.fieldExtensions.extend([extension] if extension not in enum.fieldExtensions else [])
for enumField in [x for x in enum.fields if (not x.extensions or (x.extensions and all(e in enum.extensions for e in x.extensions)))]:
enumField.extensions.extend([extension] if extension not in enumField.extensions else [])
if enumName not in extension.enumFields:
extension.enumFields[enumName] = [] # Dict needs init
extension.enumFields[enumName].extend([enumField] if enumField not in extension.enumFields[enumName] else [])
dict = self.featureDictionary[extension.name]['bitmask']
for required in dict:
for group in dict[required]:
for bitmaskName in dict[required][group]:
bitmaskName = bitmaskName.replace('Flags', 'FlagBits') # Works since Flags is not repeated in name
isAlias = bitmaskName in self.bitmaskAliasMap
bitmaskName = self.bitmaskAliasMap[bitmaskName] if isAlias else bitmaskName
if bitmaskName in self.vk.bitmasks:
bitmask = self.vk.bitmasks[bitmaskName]
bitmask.extensions.extend([extension] if extension not in bitmask.extensions else [])
extension.bitmasks.extend([bitmask] if bitmask not in extension.bitmasks else [])
# Update flags with implicit base extension
if isAlias:
continue
bitmask.flagExtensions.extend([extension] if extension not in bitmask.flagExtensions else [])
for flag in [x for x in bitmask.flags if (not x.extensions or (x.extensions and all(e in bitmask.extensions for e in x.extensions)))]:
flag.extensions.extend([extension] if extension not in flag.extensions else [])
if bitmaskName not in extension.flags:
extension.flags[bitmaskName] = [] # Dict needs init
extension.flags[bitmaskName].extend([flag] if flag not in extension.flags[bitmaskName] else [])
# Some structs (ex VkAttachmentSampleCountInfoAMD) can have multiple alias pointing to same extension
for extension in self.vk.extensions.values():
dict = self.featureDictionary[extension.name]['struct']
for required in dict:
for group in dict[required]:
for structName in dict[required][group]:
isAlias = structName in self.structAliasMap
structName = self.structAliasMap[structName] if isAlias else structName
# An EXT struct can alias a KHR struct,
# that in turns aliaes a core struct
# => Try to propagate aliasing, it can safely result in a no-op
isAlias = structName in self.structAliasMap
structName = self.structAliasMap[structName] if isAlias else structName
if structName in self.vk.structs:
struct = self.vk.structs[structName]
struct.extensions.extend([extension] if extension not in struct.extensions else [])
# While we update struct alias inside other structs, the command itself might have the struct as a first level param.
# We use this time to update params to have the promoted name
# Example - https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/9322
for command in self.vk.commands.values():
for member in command.params:
if member.type in self.structAliasMap:
member.type = self.structAliasMap[member.type]
# Could build up a reverse lookup map, but since these are not too large of list, just do here
# (Need to be done after we have found all the aliases)
for key, value in self.structAliasMap.items():
self.vk.structs[value].aliases.append(key)
for key, value in self.enumAliasMap.items():
self.vk.enums[value].aliases.append(key)
for key, value in self.bitmaskAliasMap.items():
self.vk.bitmasks[value].aliases.append(key)
for key, value in self.handleAliasMap.items():
self.vk.handles[value].aliases.append(key)
def endFile(self):
# This is the point were reg.py has ran, everything is collected
# We do some post processing now
self.applyExtensionDependency()
# Use structs and commands to find which things are returnedOnly
for struct in [x for x in self.vk.structs.values() if not x.returnedOnly]:
for enum in [self.vk.enums[x.type] for x in struct.members if x.type in self.vk.enums]:
enum.returnedOnly = False
for bitmask in [self.vk.bitmasks[x.type] for x in struct.members if x.type in self.vk.bitmasks]:
bitmask.returnedOnly = False
for bitmask in [self.vk.bitmasks[x.type.replace('Flags', 'FlagBits')] for x in struct.members if x.type.replace('Flags', 'FlagBits') in self.vk.bitmasks]:
bitmask.returnedOnly = False
for command in self.vk.commands.values():
for enum in [self.vk.enums[x.type] for x in command.params if x.type in self.vk.enums]:
enum.returnedOnly = False
for bitmask in [self.vk.bitmasks[x.type] for x in command.params if x.type in self.vk.bitmasks]:
bitmask.returnedOnly = False
for bitmask in [self.vk.bitmasks[x.type.replace('Flags', 'FlagBits')] for x in command.params if x.type.replace('Flags', 'FlagBits') in self.vk.bitmasks]:
bitmask.returnedOnly = False
# Turn handle parents into pointers to classes
for handle in [x for x in self.vk.handles.values() if x.parent is not None]:
handle.parent = self.vk.handles[handle.parent]
# search up parent chain to see if instance or device
for handle in [x for x in self.vk.handles.values()]:
next_parent = handle.parent
while (not handle.instance and not handle.device):
handle.instance = next_parent.name == 'VkInstance'
handle.device = next_parent.name == 'VkDevice'
next_parent = next_parent.parent
maxSyncSupport.queues = Queues.ALL
maxSyncSupport.stages = self.vk.bitmasks['VkPipelineStageFlagBits2'].flags
maxSyncEquivalent.accesses = self.vk.bitmasks['VkAccessFlagBits2'].flags
maxSyncEquivalent.stages = self.vk.bitmasks['VkPipelineStageFlagBits2'].flags
# All inherited generators should run from here
self.generate()
if cachingEnabled:
cachePath = os.path.join(tempfile.gettempdir(), f'vkobject_{os.getpid()}')
if not os.path.isfile(cachePath):
cacheFile = open(cachePath, 'wb')
pickle.dump(self.vk, cacheFile)
cacheFile.close()
# This should not have to do anything but call into OutputGenerator
OutputGenerator.endFile(self)
#
# Bypass the entire processing and load in the VkObject data
# Still need to handle the beingFile/endFile for reg.py
def generateFromCache(self, cacheVkObjectData, genOpts):
OutputGenerator.beginFile(self, genOpts)
self.filename = genOpts.filename
self.vk = cacheVkObjectData
self.generate()
OutputGenerator.endFile(self)
#
# Processing point at beginning of each extension definition
def beginFeature(self, interface, emit):
OutputGenerator.beginFeature(self, interface, emit)
platform = interface.get('platform')
self.featureExtraProtec = self.vk.platforms[platform] if platform in self.vk.platforms else None
protect = self.vk.platforms[platform] if platform in self.vk.platforms else None
name = interface.get('name')
if interface.tag == 'extension':
instance = interface.get('type') == 'instance'
device = not instance
depends = interface.get('depends')
vendorTag = interface.get('author')
platform = interface.get('platform')
provisional = boolGet(interface, 'provisional')
promotedto = interface.get('promotedto')
deprecatedby = interface.get('deprecatedby')
obsoletedby = interface.get('obsoletedby')
specialuse = splitIfGet(interface, 'specialuse')
# Not sure if better way to get this info
specVersion = self.featureDictionary[name]['enumconstant'][None][None][0]
nameString = self.featureDictionary[name]['enumconstant'][None][None][1]
self.currentExtension = Extension(name, nameString, specVersion, instance, device, depends, vendorTag,
platform, protect, provisional, promotedto, deprecatedby,
obsoletedby, specialuse)
self.vk.extensions[name] = self.currentExtension
else: # version
number = interface.get('number')
if number != '1.0':
self.currentVersion = APISpecific.createApiVersion(self.targetApiName, name)
self.vk.versions[name] = self.currentVersion
def endFeature(self):
OutputGenerator.endFeature(self)
self.currentExtension = None
self.currentVersion = None
#
# All <command> from XML
def genCmd(self, cmdinfo, name, alias):
OutputGenerator.genCmd(self, cmdinfo, name, alias)
params = []
for param in cmdinfo.elem.findall('param'):
paramName = param.find('name').text
paramType = textIfFind(param, 'type')
paramAlias = param.get('alias')
cdecl = self.makeCParamDecl(param, 0)
paramFullType = ' '.join(cdecl.split()[:-1])
pointer = '*' in cdecl or paramType.startswith('PFN_')
paramConst = 'const' in cdecl
fixedSizeArray = [x[:-1] for x in cdecl.split('[') if x.endswith(']')]
paramNoautovalidity = boolGet(param, 'noautovalidity')
nullTerminated = False
length = param.get('altlen') if param.get('altlen') is not None else param.get('len')
if length:
# we will either find it like "null-terminated" or "enabledExtensionCount,null-terminated"
# This finds both
nullTerminated = 'null-terminated' in length
length = length.replace(',null-terminated', '') if 'null-terminated' in length else length
length = None if length == 'null-terminated' else length
if fixedSizeArray and not length:
length = ','.join(fixedSizeArray)
# See Member::optional code for details of this
optionalValues = splitIfGet(param, 'optional')
optional = optionalValues is not None and optionalValues[0].lower() == "true"
optionalPointer = optionalValues is not None and len(optionalValues) > 1 and optionalValues[1].lower() == "true"
# externsync will be 'true' or expression
# if expression, it should be same as 'true'
externSync = boolGet(param, 'externsync')
externSyncPointer = None if externSync else splitIfGet(param, 'externsync')
if not externSync and externSyncPointer is not None:
externSync = True
params.append(Param(paramName, paramAlias, paramType, paramFullType, paramNoautovalidity,
paramConst, length, nullTerminated, pointer, fixedSizeArray,
optional, optionalPointer,
externSync, externSyncPointer, cdecl))
attrib = cmdinfo.elem.attrib
alias = attrib.get('alias')
tasks = splitIfGet(attrib, 'tasks')
queues = getQueues(attrib)
successcodes = splitIfGet(attrib, 'successcodes')
errorcodes = splitIfGet(attrib, 'errorcodes')
cmdbufferlevel = attrib.get('cmdbufferlevel')
primary = cmdbufferlevel is not None and 'primary' in cmdbufferlevel
secondary = cmdbufferlevel is not None and 'secondary' in cmdbufferlevel
renderpass = attrib.get('renderpass')
renderpass = CommandScope.NONE if renderpass is None else getattr(CommandScope, renderpass.upper())
videocoding = attrib.get('videocoding')
videocoding = CommandScope.NONE if videocoding is None else getattr(CommandScope, videocoding.upper())
protoElem = cmdinfo.elem.find('proto')
returnType = textIfFind(protoElem, 'type')
decls = self.makeCDecls(cmdinfo.elem)
cPrototype = decls[0]
cFunctionPointer = decls[1]
protect = self.currentExtension.protect if self.currentExtension is not None else None
# These coammds have no way from the XML to detect they would be an instance command
specialInstanceCommand = ['vkCreateInstance', 'vkEnumerateInstanceExtensionProperties','vkEnumerateInstanceLayerProperties', 'vkEnumerateInstanceVersion']
instance = len(params) > 0 and (params[0].type == 'VkInstance' or params[0].type == 'VkPhysicalDevice' or name in specialInstanceCommand)
device = not instance
implicitElem = cmdinfo.elem.find('implicitexternsyncparams')
implicitExternSyncParams = [x.text for x in implicitElem.findall('param')] if implicitElem else []
self.vk.commands[name] = Command(name, alias, protect, [], self.currentVersion,
returnType, params, instance, device,
tasks, queues, successcodes, errorcodes,
primary, secondary, renderpass, videocoding,
implicitExternSyncParams, cPrototype, cFunctionPointer)
#
# List the enum for the commands
# TODO - Seems empty groups like `VkDeviceDeviceMemoryReportCreateInfoEXT` do not show up in here
def genGroup(self, groupinfo, groupName, alias):
# There can be case where the Enum/Bitmask is in a protect, but the individual
# fields also have their own protect
groupProtect = self.currentExtension.protect if hasattr(self.currentExtension, 'protect') and self.currentExtension.protect is not None else None
enumElem = groupinfo.elem
bitwidth = 32 if enumElem.get('bitwidth') is None else int(enumElem.get('bitwidth'))
fields = []
if enumElem.get('type') == "enum":
if alias is not None:
self.enumAliasMap[groupName] = alias
return
for elem in enumElem.findall('enum'):
fieldName = elem.get('name')
if elem.get('alias') is not None:
self.enumFieldAliasMap[fieldName] = elem.get('alias')
continue
negative = elem.get('dir') is not None
protect = elem.get('protect')
(valueInt, valueStr) = self.enumToValue(elem, True, bitwidth)
# Some values have multiple extensions (ex VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR)
# genGroup() lists them twice
if next((x for x in fields if x.name == fieldName), None) is None:
fields.append(EnumField(fieldName, protect, negative, valueInt, valueStr, []))
self.vk.enums[groupName] = Enum(groupName, [], groupProtect, bitwidth, True, fields, [], [])
else: # "bitmask"
if alias is not None:
self.bitmaskAliasMap[groupName] = alias
return
for elem in enumElem.findall('enum'):
flagName = elem.get('name')
if elem.get('alias') is not None:
self.flagAliasMap[flagName] = elem.get('alias')
continue
protect = elem.get('protect')
(valueInt, valueStr) = self.enumToValue(elem, True, bitwidth)
flagZero = valueInt == 0
flagMultiBit = False
# if flag uses 'value' instead of 'bitpos', will be zero or a mask
if elem.get('bitpos') is None and elem.get('value'):
flagMultiBit = valueInt != 0
# Some values have multiple extensions (ex VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT)
# genGroup() lists them twice
if next((x for x in fields if x.name == flagName), None) is None:
fields.append(Flag(flagName, protect, valueInt, valueStr, flagMultiBit, flagZero, []))
flagName = groupName.replace('FlagBits', 'Flags')
self.vk.bitmasks[groupName] = Bitmask(groupName, [], flagName, groupProtect, bitwidth, True, fields, [], [])
def genType(self, typeInfo, typeName, alias):
OutputGenerator.genType(self, typeInfo, typeName, alias)
typeElem = typeInfo.elem
protect = self.currentExtension.protect if hasattr(self.currentExtension, 'protect') and self.currentExtension.protect is not None else None
category = typeElem.get('category')
if (category == 'struct' or category == 'union'):
extension = [self.currentExtension] if self.currentExtension is not None else []
if alias is not None:
self.structAliasMap[typeName] = alias
return
union = category == 'union'
returnedOnly = boolGet(typeElem, 'returnedonly')
allowDuplicate = boolGet(typeElem, 'allowduplicate')
extends = splitIfGet(typeElem, 'structextends')
extendedBy = self.registry.validextensionstructs[typeName] if len(self.registry.validextensionstructs[typeName]) > 0 else None
membersElem = typeInfo.elem.findall('.//member')
members = []
sType = None
for member in membersElem:
for comment in member.findall('comment'):
member.remove(comment)
name = textIfFind(member, 'name')
type = textIfFind(member, 'type')
sType = member.get('values') if member.get('values') is not None else sType
externSync = boolGet(member, 'externsync')
noautovalidity = boolGet(member, 'noautovalidity')
limittype = member.get('limittype')
nullTerminated = False
length = member.get('altlen') if member.get('altlen') is not None else member.get('len')
if length:
# we will either find it like "null-terminated" or "enabledExtensionCount,null-terminated"
# This finds both
nullTerminated = 'null-terminated' in length
length = length.replace(',null-terminated', '') if 'null-terminated' in length else length
length = None if length == 'null-terminated' else length
cdecl = self.makeCParamDecl(member, 0)
fullType = ' '.join(cdecl.split()[:-1])
pointer = '*' in cdecl or type.startswith('PFN_')
const = 'const' in cdecl
# Some structs like VkTransformMatrixKHR have a 2D array
fixedSizeArray = [x[:-1] for x in cdecl.split('[') if x.endswith(']')]
if fixedSizeArray and not length:
length = ','.join(fixedSizeArray)
# if a pointer, this can be a something like:
# optional="true,false" for ppGeometries
# optional="false,true" for pPhysicalDeviceCount
# the first is if the variable itself is optional
# the second is the value of the pointer is optional;
optionalValues = splitIfGet(member, 'optional')
optional = optionalValues is not None and optionalValues[0].lower() == "true"
optionalPointer = optionalValues is not None and len(optionalValues) > 1 and optionalValues[1].lower() == "true"
members.append(Member(name, type, fullType, noautovalidity, limittype,
const, length, nullTerminated, pointer, fixedSizeArray,
optional, optionalPointer,
externSync, cdecl))
self.vk.structs[typeName] = Struct(typeName, [], extension, self.currentVersion, protect, members,
union, returnedOnly, sType, allowDuplicate, extends, extendedBy)
elif category == 'handle':
if alias is not None:
self.handleAliasMap[typeName] = alias
return
type = typeElem.get('objtypeenum')
# will resolve these later, the VulkanObjectType does not list things in dependent order
parent = typeElem.get('parent')
instance = typeName == 'VkInstance'
device = typeName == 'VkDevice'
dispatchable = typeElem.find('type').text == 'VK_DEFINE_HANDLE'
self.vk.handles[typeName] = Handle(typeName, [], type, protect, parent, instance, device, dispatchable)
elif category == 'define':
if typeName == 'VK_HEADER_VERSION':
self.vk.headerVersion = typeElem.find('name').tail.strip()
else:
# not all categories are used
# 'group'/'enum'/'bitmask' are routed to genGroup instead
# 'basetype'/'include' are only for headers
# 'funcpointer` ignore until needed
return
def genSpirv(self, spirvinfo, spirvName, alias):
OutputGenerator.genSpirv(self, spirvinfo, spirvName, alias)
spirvElem = spirvinfo.elem
name = spirvElem.get('name')
extension = True if spirvElem.tag == 'spirvextension' else False
capability = not extension
enables = []
for elem in spirvElem:
version = elem.attrib.get('version')
extensionEnable = elem.attrib.get('extension')
struct = elem.attrib.get('struct')
feature = elem.attrib.get('feature')
requires = elem.attrib.get('requires')
propertyEnable = elem.attrib.get('property')
member = elem.attrib.get('member')
value = elem.attrib.get('value')
enables.append(SpirvEnables(version, extensionEnable, struct, feature,
requires, propertyEnable, member, value))
self.vk.spirv.append(Spirv(name, extension, capability, enables))
def genFormat(self, format, formatinfo, alias):
OutputGenerator.genFormat(self, format, formatinfo, alias)
formatElem = format.elem
name = formatElem.get('name')
components = []
for component in formatElem.iterfind('component'):
type = component.get('name')
bits = component.get('bits')
numericFormat = component.get('numericFormat')
planeIndex = intIfGet(component, 'planeIndex')
components.append(FormatComponent(type, bits, numericFormat, planeIndex))
planes = []
for plane in formatElem.iterfind('plane'):
index = int(plane.get('index'))
widthDivisor = int(plane.get('widthDivisor'))
heightDivisor = int(plane.get('heightDivisor'))
compatible = plane.get('compatible')
planes.append(FormatPlane(index, widthDivisor, heightDivisor, compatible))
className = formatElem.get('class')
blockSize = int(formatElem.get('blockSize'))
texelsPerBlock = int(formatElem.get('texelsPerBlock'))
blockExtent = splitIfGet(formatElem, 'blockExtent')
packed = intIfGet(formatElem, 'packed')
chroma = formatElem.get('chroma')
compressed = formatElem.get('compressed')
spirvImageFormat = formatElem.find('spirvimageformat')
if spirvImageFormat is not None:
spirvImageFormat = spirvImageFormat.get('name')
self.vk.formats[name] = Format(name, className, blockSize, texelsPerBlock,
blockExtent, packed, chroma, compressed,
components, planes, spirvImageFormat)
def genSyncStage(self, sync):
OutputGenerator.genSyncStage(self, sync)
syncElem = sync.elem
support = maxSyncSupport
supportElem = syncElem.find('syncsupport')
if supportElem is not None:
queues = getQueues(supportElem)
stageNames = splitIfGet(supportElem, 'stage')
stages = [x for x in self.vk.bitmasks['VkPipelineStageFlagBits2'].flags if x.name in stageNames] if stageNames is not None else None
support = SyncSupport(queues, stages, False)
equivalent = maxSyncEquivalent
equivalentElem = syncElem.find('syncequivalent')
if equivalentElem is not None:
stageNames = splitIfGet(equivalentElem, 'stage')
stages = [x for x in self.vk.bitmasks['VkPipelineStageFlagBits2'].flags if x.name in stageNames] if stageNames is not None else None
accessNames = splitIfGet(equivalentElem, 'access')
accesses = [x for x in self.vk.bitmasks['VkAccessFlagBits2'].flags if x.name in accessNames] if accessNames is not None else None
equivalent = SyncEquivalent(stages, accesses, False)
flagName = syncElem.get('name')
flag = [x for x in self.vk.bitmasks['VkPipelineStageFlagBits2'].flags if x.name == flagName]
# This check is needed because not all API variants have VK_KHR_synchronization2
if flag:
self.vk.syncStage.append(SyncStage(flag[0], support, equivalent))
def genSyncAccess(self, sync):
OutputGenerator.genSyncAccess(self, sync)
syncElem = sync.elem
support = maxSyncSupport
supportElem = syncElem.find('syncsupport')
if supportElem is not None:
queues = getQueues(supportElem)
stageNames = splitIfGet(supportElem, 'stage')
stages = [x for x in self.vk.bitmasks['VkPipelineStageFlagBits2'].flags if x.name in stageNames] if stageNames is not None else None
support = SyncSupport(queues, stages, False)
equivalent = maxSyncEquivalent
equivalentElem = syncElem.find('syncequivalent')
if equivalentElem is not None:
stageNames = splitIfGet(equivalentElem, 'stage')
stages = [x for x in self.vk.bitmasks['VkPipelineStageFlagBits2'].flags if x.name in stageNames] if stageNames is not None else None
accessNames = splitIfGet(equivalentElem, 'access')
accesses = [x for x in self.vk.bitmasks['VkAccessFlagBits2'].flags if x.name in accessNames] if accessNames is not None else None
equivalent = SyncEquivalent(stages, accesses, False)
flagName = syncElem.get('name')
flag = [x for x in self.vk.bitmasks['VkAccessFlagBits2'].flags if x.name == flagName]
# This check is needed because not all API variants have VK_KHR_synchronization2
if flag:
self.vk.syncAccess.append(SyncAccess(flag[0], support, equivalent))
def genSyncPipeline(self, sync):
OutputGenerator.genSyncPipeline(self, sync)
syncElem = sync.elem
name = syncElem.get('name')
depends = splitIfGet(syncElem, 'depends')
stages = []
for stageElem in syncElem.findall('syncpipelinestage'):
order = stageElem.get('order')
before = stageElem.get('before')
after = stageElem.get('after')
value = stageElem.text
stages.append(SyncPipelineStage(order, before, after, value))
self.vk.syncPipeline.append(SyncPipeline(name, depends, stages))

View file

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2023 The Khronos Group Inc.
# Copyright 2013-2025 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
@ -242,8 +242,8 @@ class COutputGenerator(OutputGenerator):
raise MissingGeneratorOptionsError()
if self.genOpts.conventions is None:
raise MissingGeneratorOptionsConventionsError()
is_core = self.featureName and self.featureName.startswith(self.conventions.api_prefix + 'VERSION_')
if self.genOpts.conventions.writeFeature(self.featureExtraProtect, self.genOpts.filename):
is_core = self.featureName and self.featureName.startswith(f"{self.conventions.api_prefix}VERSION_")
if self.genOpts.conventions.writeFeature(self.featureName, self.featureExtraProtect, self.genOpts.filename):
self.newline()
if self.genOpts.protectFeature:
write('#ifndef', self.featureName, file=self.outFile)
@ -255,6 +255,8 @@ class COutputGenerator(OutputGenerator):
write('#ifdef', self.featureExtraProtect, file=self.outFile)
self.newline()
# Generate warning of possible use in IDEs
write(f'// {self.featureName} is a preprocessor guard. Do not pass it to API calls.', file=self.outFile)
write('#define', self.featureName, '1', file=self.outFile)
for section in self.TYPE_SECTIONS:
contents = self.sections[section]
@ -332,15 +334,18 @@ class COutputGenerator(OutputGenerator):
else:
if self.genOpts is None:
raise MissingGeneratorOptionsError()
body = self.deprecationComment(typeElem)
# OpenXR: this section was not under 'else:' previously, just fell through
if alias:
# If the type is an alias, just emit a typedef declaration
body = 'typedef ' + alias + ' ' + name + ';\n'
body += f"typedef {alias} {name};\n"
else:
# Replace <apientry /> tags with an APIENTRY-style string
# (from self.genOpts). Copy other text through unchanged.
# If the resulting text is an empty string, do not emit it.
body = noneStr(typeElem.text)
body += noneStr(typeElem.text)
for elem in typeElem:
if elem.tag == 'apientry':
body += self.genOpts.apientry + noneStr(elem.tail)
@ -368,13 +373,13 @@ class COutputGenerator(OutputGenerator):
if ',' in protect_str:
protect_list = protect_str.split(',')
protect_defs = ('defined(%s)' % d for d in protect_list)
protect_defs = (f'defined({d})' for d in protect_list)
protect_def_str = ' && '.join(protect_defs)
protect_if_str = '#if %s\n' % protect_def_str
protect_end_str = '#endif // %s\n' % protect_def_str
protect_if_str = f'#if {protect_def_str}\n'
protect_end_str = f'#endif // {protect_def_str}\n'
else:
protect_if_str = '#ifdef %s\n' % protect_str
protect_end_str = '#endif // %s\n' % protect_str
protect_if_str = f'#ifdef {protect_str}\n'
protect_end_str = f'#endif // {protect_str}\n'
return (protect_if_str, protect_end_str)
@ -415,34 +420,35 @@ class COutputGenerator(OutputGenerator):
raise MissingGeneratorOptionsError()
typeElem = typeinfo.elem
body = self.deprecationComment(typeElem)
if alias:
body = 'typedef ' + alias + ' ' + typeName + ';\n'
body += f"typedef {alias} {typeName};\n"
else:
body = ''
(protect_begin, protect_end) = self.genProtectString(typeElem.get('protect'))
if protect_begin:
body += protect_begin
if self.genOpts.genStructExtendsComment:
structextends = typeElem.get('structextends')
body += '// ' + typeName + ' extends ' + structextends + '\n' if structextends else ''
body += f"// {typeName} extends {structextends}\n" if structextends else ''
body += 'typedef ' + typeElem.get('category')
body += f"typedef {typeElem.get('category')}"
# This is an OpenXR-specific alternative where aliasing refers
# to an inheritance hierarchy of types rather than C-level type
# aliases.
if self.genOpts.genAliasMacro and self.typeMayAlias(typeName):
body += ' ' + self.genOpts.aliasMacro
body += f" {self.genOpts.aliasMacro}"
body += ' ' + typeName + ' {\n'
body += f" {typeName} {{\n"
targetLen = self.getMaxCParamTypeLength(typeinfo)
for member in typeElem.findall('.//member'):
body += self.deprecationComment(member, indent = 4)
body += self.makeCParamDecl(member, targetLen + 4)
body += ';\n'
body += '} ' + typeName + ';\n'
body += f"}} {typeName};\n"
if protect_end:
body += protect_end
@ -468,13 +474,13 @@ class COutputGenerator(OutputGenerator):
if alias:
# If the group name is aliased, just emit a typedef declaration
# for the alias.
body = 'typedef ' + alias + ' ' + groupName + ';\n'
body = f"typedef {alias} {groupName};\n"
self.appendSection(section, body)
else:
if self.genOpts is None:
raise MissingGeneratorOptionsError()
(section, body) = self.buildEnumCDecl(self.genOpts.genEnumBeginEndRange, groupinfo, groupName)
self.appendSection(section, '\n' + body)
self.appendSection(section, f"\n{body}")
def genEnum(self, enuminfo, name, alias):
"""Generate the C declaration for a constant (a single <enum> value).
@ -484,7 +490,8 @@ class COutputGenerator(OutputGenerator):
OutputGenerator.genEnum(self, enuminfo, name, alias)
body = self.buildConstantCDecl(enuminfo, name, alias)
body = self.deprecationComment(enuminfo.elem)
body += self.buildConstantCDecl(enuminfo, name, alias)
self.appendSection('enum', body)
def genCmd(self, cmdinfo, name, alias):
@ -500,12 +507,12 @@ class COutputGenerator(OutputGenerator):
prefix = ''
decls = self.makeCDecls(cmdinfo.elem)
self.appendSection('command', prefix + decls[0] + '\n')
self.appendSection('command', f"{prefix + decls[0]}\n")
if self.genOpts.genFuncPointers:
self.appendSection('commandPointer', decls[1])
def misracstyle(self):
return self.genOpts.misracstyle;
return self.genOpts.misracstyle
def misracppstyle(self):
return self.genOpts.misracppstyle;
return self.genOpts.misracppstyle

View file

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2023 The Khronos Group Inc.
# Copyright 2013-2025 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
"""Base class for source/header/doc generators, as well as some utility functions."""
@ -64,9 +64,8 @@ def regSortCategoryKey(feature):
return 0.5
else:
return 0
if (feature.category == 'ARB'
or feature.category == 'KHR'
or feature.category == 'OES'):
if feature.category.upper() in ('ARB', 'KHR', 'OES'):
return 1
return 2
@ -117,7 +116,7 @@ class MissingGeneratorOptionsError(RuntimeError):
def __init__(self, msg=None):
full_msg = 'Missing generator options object self.genOpts'
if msg:
full_msg += ': ' + msg
full_msg += f": {msg}"
super().__init__(full_msg)
@ -127,7 +126,7 @@ class MissingRegistryError(RuntimeError):
def __init__(self, msg=None):
full_msg = 'Missing Registry object self.registry'
if msg:
full_msg += ': ' + msg
full_msg += f": {msg}"
super().__init__(full_msg)
@ -137,7 +136,7 @@ class MissingGeneratorOptionsConventionsError(RuntimeError):
def __init__(self, msg=None):
full_msg = 'Missing Conventions object self.genOpts.conventions'
if msg:
full_msg += ': ' + msg
full_msg += f": {msg}"
super().__init__(full_msg)
@ -166,6 +165,7 @@ class GeneratorOptions:
reparentEnums=True,
sortProcedure=regSortFeatures,
requireCommandAliases=False,
requireDepends=True,
):
"""Constructor.
@ -208,6 +208,11 @@ class GeneratorOptions:
or <extension> being complete. Defaults to True.
- sortProcedure - takes a list of FeatureInfo objects and sorts
them in place to a preferred order in the generated output.
- requireCommandAliases - if True, treat command aliases
as required dependencies.
- requireDepends - whether to follow API dependencies when emitting
APIs.
Default is
- core API versions
- Khronos (ARB/KHR/OES) extensions
@ -295,6 +300,9 @@ class GeneratorOptions:
"""True if alias= attributes of <command> tags are transitively
required."""
self.requireDepends = requireDepends
"""True if dependencies of API tags are transitively required."""
def emptyRegex(self, pat):
"""Substitute a regular expression which matches no version
or extension names for None or the empty string."""
@ -330,7 +338,7 @@ class OutputGenerator:
)
if name in bad and True:
print('breakName {}: {}'.format(name, msg))
print(f'breakName {name}: {msg}')
pdb.set_trace()
def __init__(self, errFile=sys.stderr, warnFile=sys.stderr, diagFile=sys.stdout):
@ -391,7 +399,7 @@ class OutputGenerator:
write('DIAG:', *args, file=self.diagFile)
else:
raise UserWarning(
'*** FATAL ERROR in Generator.logMsg: unknown level:' + level)
f"*** FATAL ERROR in Generator.logMsg: unknown level:{level}")
def enumToValue(self, elem, needsNum, bitwidth = 32,
forceSuffix = False, parent_for_alias_dereference=None):
@ -444,20 +452,20 @@ class OutputGenerator:
# value += enuminfo.type
if forceSuffix:
if bitwidth == 64:
value = value + 'ULL'
value = f"{value}ULL"
else:
value = value + 'U'
value = f"{value}U"
self.logMsg('diag', 'Enum', name, '-> value [', numVal, ',', value, ']')
return [numVal, value]
if 'bitpos' in elem.keys():
value = elem.get('bitpos')
bitpos = int(value, 0)
numVal = 1 << bitpos
value = '0x%08x' % numVal
value = f'0x{numVal:08x}'
if bitwidth == 64 or bitpos >= 32:
value = value + 'ULL'
value = f"{value}ULL"
elif forceSuffix:
value = value + 'U'
value = f"{value}U"
self.logMsg('diag', 'Enum', name, '-> bitpos [', numVal, ',', value, ']')
return [numVal, value]
if 'offset' in elem.keys():
@ -554,6 +562,41 @@ class OutputGenerator:
def misracppstyle(self):
return False;
def deprecationComment(self, elem, indent = 0):
"""If an API element is marked deprecated, return a brief comment
describing why.
Otherwise, return an empty string.
- elem - Element of the API.
API name is determined depending on the element tag.
- indent - number of spaces to indent the comment"""
reason = elem.get('deprecated')
# This is almost always the path taken.
if reason == None:
return ''
# There is actually a deprecated attribute.
padding = indent * ' '
# Determine the API name.
if elem.tag == 'member' or elem.tag == 'param':
name = elem.find('.//name').text
else:
name = elem.get('name')
if reason == 'aliased':
return f'{padding}// {name} is a deprecated alias\n'
elif reason == 'ignored':
return f'{padding}// {name} is deprecated and should not be used\n'
elif reason == 'true':
return f'{padding}// {name} is deprecated, but no reason was given in the API XML\n'
else:
# This can be caught by schema validation
self.logMsg('error', f"{name} has an unknown deprecation attribute value '{reason}'")
exit(1)
def buildEnumCDecl(self, expand, groupinfo, groupName):
"""Generate the C declaration for an enum"""
if self.genOpts is None:
@ -612,12 +655,12 @@ class OutputGenerator:
flagTypeName = groupElem.get('name')
# Prefix
body = "// Flag bits for " + flagTypeName + "\n"
body = f"// Flag bits for {flagTypeName}\n"
if bitwidth == 64:
body += "typedef VkFlags64 %s;\n" % flagTypeName;
body += f"typedef VkFlags64 {flagTypeName};\n";
else:
body += "typedef VkFlags %s;\n" % flagTypeName;
body += f"typedef VkFlags {flagTypeName};\n";
# Maximum allowable value for a flag (unsigned 64-bit integer)
maxValidValue = 2**(64) - 1
@ -654,23 +697,25 @@ class OutputGenerator:
if self.isEnumRequired(elem):
protect = elem.get('protect')
if protect is not None:
body += '#ifdef {}\n'.format(protect)
body += f'#ifdef {protect}\n'
body += self.deprecationComment(elem, indent = 0)
if usedefine:
decl += "#define {} {}\n".format(name, strVal)
decl += f"#define {name} {strVal}\n"
elif self.misracppstyle():
decl += "static constexpr {} {} {{{}}};\n".format(flagTypeName, name, strVal)
decl += f"static constexpr {flagTypeName} {name} {{{strVal}}};\n"
else:
# Some C compilers only allow initializing a 'static const' variable with a literal value.
# So initializing an alias from another 'static const' value would fail to compile.
# Work around this by chasing the aliases to get the actual value.
while numVal is None:
alias = self.registry.tree.find("enums/enum[@name='" + strVal + "']")
alias = self.registry.tree.find(f"enums/enum[@name='{strVal}']")
if alias is not None:
(numVal, strVal) = self.enumToValue(alias, True, bitwidth, True)
else:
self.logMsg('error', 'No such alias {} for enum {}'.format(strVal, name))
decl += "static const {} {} = {};\n".format(flagTypeName, name, strVal)
self.logMsg('error', f'No such alias {strVal} for enum {name}')
decl += f"static const {flagTypeName} {name} = {strVal};\n"
if numVal is not None:
body += decl
@ -698,7 +743,7 @@ class OutputGenerator:
expandSuffix = ''
expandSuffixMatch = re.search(r'[A-Z][A-Z]+$', groupName)
if expandSuffixMatch:
expandSuffix = '_' + expandSuffixMatch.group()
expandSuffix = f"_{expandSuffixMatch.group()}"
# Strip off the suffix from the prefix
expandPrefix = expandName.rsplit(expandSuffix, 1)[0]
@ -747,14 +792,12 @@ class OutputGenerator:
protect = elem.get('protect')
if protect is not None:
decl += '#ifdef {}\n'.format(protect)
decl += f'#ifdef {protect}\n'
# Indent requirements comment, if there is one
requirements = self.genRequirements(name, mustBeFound = False)
if requirements != '':
requirements = ' ' + requirements
decl += requirements
decl += ' {} = {},'.format(name, strVal)
decl += self.genRequirements(name, mustBeFound = False, indent = 2)
decl += self.deprecationComment(elem, indent = 2)
decl += f' {name} = {strVal},'
if protect is not None:
decl += '\n#endif'
@ -825,8 +868,8 @@ class OutputGenerator:
if typeStr != "float":
number += 'U'
strVal = "~" if invert else ""
strVal += "static_cast<" + typeStr + ">(" + number + ")"
body = 'static constexpr ' + typeStr.ljust(9) + name.ljust(33) + ' {' + strVal + '};'
strVal += f"static_cast<{typeStr}>({number})"
body = f"static constexpr {typeStr.ljust(9)}{name.ljust(33)} {{{strVal}}};"
elif enuminfo.elem.get('type') and not alias:
# Generate e.g.: #define x (~0ULL)
typeStr = enuminfo.elem.get('type');
@ -841,10 +884,10 @@ class OutputGenerator:
strVal = "~" if invert else ""
strVal += number
if paren:
strVal = "(" + strVal + ")";
body = '#define ' + name.ljust(33) + ' ' + strVal;
strVal = f"({strVal})";
body = f"#define {name.ljust(33)} {strVal}";
else:
body = '#define ' + name.ljust(33) + ' ' + strVal
body = f"#define {name.ljust(33)} {strVal}"
return body
@ -852,7 +895,7 @@ class OutputGenerator:
"""Create a directory, if not already done.
Generally called from derived generators creating hierarchies."""
self.logMsg('diag', 'OutputGenerator::makeDir(' + path + ')')
self.logMsg('diag', 'OutputGenerator::makeDir(', path, ')')
if path not in self.madeDirs:
# This can get race conditions with multiple writers, see
# https://stackoverflow.com/questions/273192/
@ -911,11 +954,11 @@ class OutputGenerator:
# On successfully generating output, move the temporary file to the
# target file.
if self.genOpts.filename is not None:
directory = Path(self.genOpts.directory)
if sys.platform == 'win32':
directory = Path(self.genOpts.directory)
if not Path.exists(directory):
os.makedirs(directory)
shutil.copy(self.outFile.name, self.genOpts.directory + '/' + self.genOpts.filename)
shutil.copy(self.outFile.name, directory / self.genOpts.filename)
os.remove(self.outFile.name)
self.genOpts = None
@ -936,7 +979,7 @@ class OutputGenerator:
self.featureName = None
self.featureExtraProtect = None
def genRequirements(self, name, mustBeFound = True):
def genRequirements(self, name, mustBeFound = True, indent = 0):
"""Generate text showing what core versions and extensions introduce
an API. This exists in the base Generator class because it is used by
the shared enumerant-generating interfaces (buildEnumCDecl, etc.).
@ -1021,6 +1064,30 @@ class OutputGenerator:
Extend to generate as desired in your derived class."""
return
def genSyncStage(self, stageinfo):
"""Generate interface for a sync stage element.
- stageinfo - SyncStageInfo
Extend to generate as desired in your derived class."""
return
def genSyncAccess(self, accessinfo):
"""Generate interface for a sync stage element.
- accessinfo - AccessInfo
Extend to generate as desired in your derived class."""
return
def genSyncPipeline(self, pipelineinfo):
"""Generate interface for a sync stage element.
- pipelineinfo - SyncPipelineInfo
Extend to generate as desired in your derived class."""
return
def makeProtoName(self, name, tail):
"""Turn a `<proto>` `<name>` into C-language prototype
and typedef declarations for that name.
@ -1035,7 +1102,7 @@ class OutputGenerator:
"""Make the function-pointer typedef name for a command."""
if self.genOpts is None:
raise MissingGeneratorOptionsError()
return '(' + self.genOpts.apientryp + 'PFN_' + name + tail + ')'
return f"({self.genOpts.apientryp}PFN_{name}{tail})"
def makeCParamDecl(self, param, aligncol):
"""Return a string which is an indented, formatted
@ -1068,14 +1135,14 @@ class OutputGenerator:
# This works around a problem where very long type names -
# longer than the alignment column - would run into the tail
# text.
paramdecl = paramdecl.ljust(aligncol - 1) + ' '
paramdecl = f"{paramdecl.ljust(aligncol - 1)} "
newLen = len(paramdecl)
self.logMsg('diag', 'Adjust length of parameter decl from', oldLen, 'to', newLen, ':', paramdecl)
if (self.misracppstyle() and prefix.find('const ') != -1):
# Change pointer type order from e.g. "const void *" to "void const *".
# If the string starts with 'const', reorder it to be after the first type.
paramdecl += prefix.replace('const ', '') + text + ' const' + tail
paramdecl += f"{prefix.replace('const ', '') + text} const{tail}"
else:
paramdecl += prefix + text + tail
@ -1102,7 +1169,7 @@ class OutputGenerator:
# Allow for missing <name> tag
newLen = 0
paramdecl = ' ' + noneStr(param.text)
paramdecl = f" {noneStr(param.text)}"
for elem in param:
text = noneStr(elem.text)
tail = noneStr(elem.tail)
@ -1333,7 +1400,7 @@ class OutputGenerator:
# Change pointer type order from e.g. "const void *" to "void const *".
# If the string starts with 'const', reorder it to be after the first type.
if (prefix.find('const ') != -1):
param += prefix.replace('const ', '') + t + ' const '
param += f"{prefix.replace('const ', '') + t} const "
else:
param += prefix + t
# Clear prefix for subsequent iterations

View file

@ -1,846 +0,0 @@
#!/usr/bin/python3
#
# Copyright 2013-2023 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
import argparse
import os
import pdb
import re
import sys
import copy
import time
import xml.etree.ElementTree as etree
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
from cgenerator import CGeneratorOptions, COutputGenerator
from docgenerator import DocGeneratorOptions, DocOutputGenerator
from extensionmetadocgenerator import (ExtensionMetaDocGeneratorOptions,
ExtensionMetaDocOutputGenerator)
from interfacedocgenerator import InterfaceDocGenerator
from generator import write
from spirvcapgenerator import SpirvCapabilityOutputGenerator
from hostsyncgenerator import HostSynchronizationOutputGenerator
from formatsgenerator import FormatsOutputGenerator
from jsgenerator import JSOutputGenerator
from pygenerator import PyOutputGenerator
from rubygenerator import RubyOutputGenerator
from reflib import logDiag, logWarn, logErr, setLogFile
from reg import Registry
from validitygenerator import ValidityOutputGenerator
from apiconventions import APIConventions
# Simple timer functions
startTime = None
def startTimer(timeit):
global startTime
if timeit:
startTime = time.process_time()
def endTimer(timeit, msg):
global startTime
if timeit and startTime is not None:
endTime = time.process_time()
logDiag(msg, endTime - startTime)
startTime = None
def makeREstring(strings, default=None, strings_are_regex=False):
"""Turn a list of strings into a regexp string matching exactly those strings."""
if strings or default is None:
if not strings_are_regex:
strings = (re.escape(s) for s in strings)
return '^(' + '|'.join(strings) + ')$'
return default
def makeGenOpts(args):
"""Returns a directory of [ generator function, generator options ] indexed
by specified short names. The generator options incorporate the following
parameters:
args is an parsed argument object; see below for the fields that are used."""
global genOpts
genOpts = {}
# Default class of extensions to include, or None
defaultExtensions = args.defaultExtensions
# Additional extensions to include (list of extensions)
extensions = args.extension
# Extensions to remove (list of extensions)
removeExtensions = args.removeExtensions
# Extensions to emit (list of extensions)
emitExtensions = args.emitExtensions
# SPIR-V capabilities / features to emit (list of extensions & capabilities)
emitSpirv = args.emitSpirv
# Vulkan Formats to emit
emitFormats = args.emitFormats
# Features to include (list of features)
features = args.feature
# Whether to disable inclusion protect in headers
protect = args.protect
# Output target directory
directory = args.directory
# Path to generated files, particularly apimap.py
genpath = args.genpath
# Generate MISRA C-friendly headers
misracstyle = args.misracstyle;
# Generate MISRA C++-friendly headers
misracppstyle = args.misracppstyle;
# Descriptive names for various regexp patterns used to select
# versions and extensions
allFormats = allSpirv = allFeatures = allExtensions = r'.*'
# Turn lists of names/patterns into matching regular expressions
addExtensionsPat = makeREstring(extensions, None)
removeExtensionsPat = makeREstring(removeExtensions, None)
emitExtensionsPat = makeREstring(emitExtensions, allExtensions)
emitSpirvPat = makeREstring(emitSpirv, allSpirv)
emitFormatsPat = makeREstring(emitFormats, allFormats)
featuresPat = makeREstring(features, allFeatures)
# Copyright text prefixing all headers (list of strings).
# The SPDX formatting below works around constraints of the 'reuse' tool
prefixStrings = [
'/*',
'** Copyright 2015-2023 The Khronos Group Inc.',
'**',
'** SPDX-License-Identifier' + ': Apache-2.0',
'*/',
''
]
# Text specific to Vulkan headers
vkPrefixStrings = [
'/*',
'** This header is generated from the Khronos Vulkan XML API Registry.',
'**',
'*/',
''
]
# Defaults for generating re-inclusion protection wrappers (or not)
protectFile = protect
# An API style conventions object
conventions = APIConventions()
if args.apiname is not None:
defaultAPIName = args.apiname
else:
defaultAPIName = conventions.xml_api_name
# APIs to merge
mergeApiNames = args.mergeApiNames
# API include files for spec and ref pages
# Overwrites include subdirectories in spec source tree
# The generated include files do not include the calling convention
# macros (apientry etc.), unlike the header files.
# Because the 1.0 core branch includes ref pages for extensions,
# all the extension interfaces need to be generated, even though
# none are used by the core spec itself.
genOpts['apiinc'] = [
DocOutputGenerator,
DocGeneratorOptions(
conventions = conventions,
filename = 'timeMarker',
directory = directory,
genpath = genpath,
apiname = defaultAPIName,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = None,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
prefixText = prefixStrings + vkPrefixStrings,
apicall = '',
apientry = '',
apientryp = '*',
alignFuncParam = 48,
expandEnumerants = False)
]
# JavaScript, Python, and Ruby representations of API information, used
# by scripts that do not need to load the full XML.
genOpts['apimap.cjs'] = [
JSOutputGenerator,
DocGeneratorOptions(
conventions = conventions,
filename = 'apimap.cjs',
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = None,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
reparentEnums = False)
]
genOpts['apimap.py'] = [
PyOutputGenerator,
DocGeneratorOptions(
conventions = conventions,
filename = 'apimap.py',
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = None,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
reparentEnums = False)
]
genOpts['apimap.rb'] = [
RubyOutputGenerator,
DocGeneratorOptions(
conventions = conventions,
filename = 'apimap.rb',
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = None,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
reparentEnums = False)
]
# API validity files for spec
#
# requireCommandAliases is set to True because we need validity files
# for the command something is promoted to even when the promoted-to
# feature is not included. This avoids wordy includes of validity files.
genOpts['validinc'] = [
ValidityOutputGenerator,
DocGeneratorOptions(
conventions = conventions,
filename = 'timeMarker',
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = None,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
requireCommandAliases = True,
)
]
# API host sync table files for spec
genOpts['hostsyncinc'] = [
HostSynchronizationOutputGenerator,
DocGeneratorOptions(
conventions = conventions,
filename = 'timeMarker',
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = None,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
reparentEnums = False)
]
# Extension metainformation for spec extension appendices
# Includes all extensions by default, but only so that the generated
# 'promoted_extensions_*' files refer to all extensions that were
# promoted to a core version.
genOpts['extinc'] = [
ExtensionMetaDocOutputGenerator,
ExtensionMetaDocGeneratorOptions(
conventions = conventions,
filename = 'timeMarker',
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = featuresPat,
emitversions = None,
defaultExtensions = defaultExtensions,
addExtensions = addExtensionsPat,
removeExtensions = None,
emitExtensions = emitExtensionsPat)
]
# Version and extension interface docs for version/extension appendices
# Includes all extensions by default.
genOpts['interfaceinc'] = [
InterfaceDocGenerator,
DocGeneratorOptions(
conventions = conventions,
filename = 'timeMarker',
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = None,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
reparentEnums = False)
]
genOpts['spirvcapinc'] = [
SpirvCapabilityOutputGenerator,
DocGeneratorOptions(
conventions = conventions,
filename = 'timeMarker',
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = None,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
emitSpirv = emitSpirvPat,
reparentEnums = False)
]
# Used to generate various format chapter tables
genOpts['formatsinc'] = [
FormatsOutputGenerator,
DocGeneratorOptions(
conventions = conventions,
filename = 'timeMarker',
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = None,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
emitFormats = emitFormatsPat,
reparentEnums = False)
]
# Platform extensions, in their own header files
# Each element of the platforms[] array defines information for
# generating a single platform:
# [0] is the generated header file name
# [1] is the set of platform extensions to generate
# [2] is additional extensions whose interfaces should be considered,
# but suppressed in the output, to avoid duplicate definitions of
# dependent types like VkDisplayKHR and VkSurfaceKHR which come from
# non-platform extensions.
# Track all platform extensions, for exclusion from vulkan_core.h
allPlatformExtensions = []
# Extensions suppressed for all WSI platforms (WSI extensions required
# by all platforms)
commonSuppressExtensions = [ 'VK_KHR_display', 'VK_KHR_swapchain' ]
# Extensions required and suppressed for beta "platform". This can
# probably eventually be derived from the requires= attributes of
# the extension blocks.
betaRequireExtensions = [
'VK_KHR_portability_subset',
'VK_KHR_video_encode_queue',
'VK_EXT_video_encode_h264',
'VK_EXT_video_encode_h265',
'VK_NV_displacement_micromap',
]
betaSuppressExtensions = [
'VK_KHR_video_queue',
'VK_EXT_opacity_micromap',
]
platforms = [
[ 'vulkan_android.h', [ 'VK_KHR_android_surface',
'VK_ANDROID_external_memory_android_hardware_buffer'
], commonSuppressExtensions +
[ 'VK_KHR_format_feature_flags2',
] ],
[ 'vulkan_fuchsia.h', [ 'VK_FUCHSIA_imagepipe_surface',
'VK_FUCHSIA_external_memory',
'VK_FUCHSIA_external_semaphore',
'VK_FUCHSIA_buffer_collection' ], commonSuppressExtensions ],
[ 'vulkan_ggp.h', [ 'VK_GGP_stream_descriptor_surface',
'VK_GGP_frame_token' ], commonSuppressExtensions ],
[ 'vulkan_ios.h', [ 'VK_MVK_ios_surface' ], commonSuppressExtensions ],
[ 'vulkan_macos.h', [ 'VK_MVK_macos_surface' ], commonSuppressExtensions ],
[ 'vulkan_vi.h', [ 'VK_NN_vi_surface' ], commonSuppressExtensions ],
[ 'vulkan_wayland.h', [ 'VK_KHR_wayland_surface' ], commonSuppressExtensions ],
[ 'vulkan_win32.h', [ 'VK_.*_win32(|_.*)', 'VK_.*_winrt(|_.*)', 'VK_EXT_full_screen_exclusive' ],
commonSuppressExtensions +
[ 'VK_KHR_external_semaphore',
'VK_KHR_external_memory_capabilities',
'VK_KHR_external_fence',
'VK_KHR_external_fence_capabilities',
'VK_KHR_get_surface_capabilities2',
'VK_NV_external_memory_capabilities',
] ],
[ 'vulkan_xcb.h', [ 'VK_KHR_xcb_surface' ], commonSuppressExtensions ],
[ 'vulkan_xlib.h', [ 'VK_KHR_xlib_surface' ], commonSuppressExtensions ],
[ 'vulkan_directfb.h', [ 'VK_EXT_directfb_surface' ], commonSuppressExtensions ],
[ 'vulkan_xlib_xrandr.h', [ 'VK_EXT_acquire_xlib_display' ], commonSuppressExtensions ],
[ 'vulkan_metal.h', [ 'VK_EXT_metal_surface',
'VK_EXT_metal_objects' ], commonSuppressExtensions ],
[ 'vulkan_screen.h', [ 'VK_QNX_screen_surface' ], commonSuppressExtensions ],
[ 'vulkan_beta.h', betaRequireExtensions, betaSuppressExtensions ],
]
for platform in platforms:
headername = platform[0]
allPlatformExtensions += platform[1]
addPlatformExtensionsRE = makeREstring(
platform[1] + platform[2], strings_are_regex=True)
emitPlatformExtensionsRE = makeREstring(
platform[1], strings_are_regex=True)
opts = CGeneratorOptions(
conventions = conventions,
filename = headername,
directory = directory,
genpath = None,
apiname = defaultAPIName,
mergeApiNames = mergeApiNames,
profile = None,
versions = featuresPat,
emitversions = None,
defaultExtensions = None,
addExtensions = addPlatformExtensionsRE,
removeExtensions = None,
emitExtensions = emitPlatformExtensionsRE,
prefixText = prefixStrings + vkPrefixStrings,
genFuncPointers = True,
protectFile = protectFile,
protectFeature = False,
protectProto = '#ifndef',
protectProtoStr = 'VK_NO_PROTOTYPES',
apicall = 'VKAPI_ATTR ',
apientry = 'VKAPI_CALL ',
apientryp = 'VKAPI_PTR *',
alignFuncParam = 48,
misracstyle = misracstyle,
misracppstyle = misracppstyle)
genOpts[headername] = [ COutputGenerator, opts ]
# Header for core API + extensions.
# To generate just the core API,
# change to 'defaultExtensions = None' below.
#
# By default this adds all enabled, non-platform extensions.
# It removes all platform extensions (from the platform headers options
# constructed above) as well as any explicitly specified removals.
removeExtensionsPat = makeREstring(
allPlatformExtensions + removeExtensions, None, strings_are_regex=True)
genOpts['vulkan_core.h'] = [
COutputGenerator,
CGeneratorOptions(
conventions = conventions,
filename = 'vulkan_core.h',
directory = directory,
genpath = None,
apiname = defaultAPIName,
mergeApiNames = mergeApiNames,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = defaultExtensions,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
prefixText = prefixStrings + vkPrefixStrings,
genFuncPointers = True,
protectFile = protectFile,
protectFeature = False,
protectProto = '#ifndef',
protectProtoStr = 'VK_NO_PROTOTYPES',
apicall = 'VKAPI_ATTR ',
apientry = 'VKAPI_CALL ',
apientryp = 'VKAPI_PTR *',
alignFuncParam = 48,
misracstyle = misracstyle,
misracppstyle = misracppstyle)
]
# Unused - vulkan10.h target.
# It is possible to generate a header with just the Vulkan 1.0 +
# extension interfaces defined, but since the promoted KHR extensions
# are now defined in terms of the 1.1 interfaces, such a header is very
# similar to vulkan_core.h.
genOpts['vulkan10.h'] = [
COutputGenerator,
CGeneratorOptions(
conventions = conventions,
filename = 'vulkan10.h',
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = 'VK_VERSION_1_0',
emitversions = 'VK_VERSION_1_0',
defaultExtensions = None,
addExtensions = None,
removeExtensions = None,
emitExtensions = None,
prefixText = prefixStrings + vkPrefixStrings,
genFuncPointers = True,
protectFile = protectFile,
protectFeature = False,
protectProto = '#ifndef',
protectProtoStr = 'VK_NO_PROTOTYPES',
apicall = 'VKAPI_ATTR ',
apientry = 'VKAPI_CALL ',
apientryp = 'VKAPI_PTR *',
alignFuncParam = 48,
misracstyle = misracstyle,
misracppstyle = misracppstyle)
]
# Video header target - combines all video extension dependencies into a
# single header, at present.
genOpts['vk_video.h'] = [
COutputGenerator,
CGeneratorOptions(
conventions = conventions,
filename = 'vk_video.h',
directory = directory,
genpath = None,
apiname = 'vulkan',
profile = None,
versions = None,
emitversions = None,
defaultExtensions = defaultExtensions,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
prefixText = prefixStrings + vkPrefixStrings,
genFuncPointers = True,
protectFile = protectFile,
protectFeature = False,
protectProto = '#ifndef',
protectProtoStr = 'VK_NO_PROTOTYPES',
apicall = '',
apientry = '',
apientryp = '',
alignFuncParam = 48,
misracstyle = misracstyle,
misracppstyle = misracppstyle)
]
# Video extension 'Std' interfaces, each in its own header files
# These are not Vulkan extensions, or a part of the Vulkan API at all,
# but are treated in a similar fashion for generation purposes.
#
# Each element of the videoStd[] array is an extension name defining an
# interface, and is also the basis for the generated header file name.
videoStd = [
'vulkan_video_codecs_common',
'vulkan_video_codec_h264std',
'vulkan_video_codec_h264std_decode',
'vulkan_video_codec_h264std_encode',
'vulkan_video_codec_h265std',
'vulkan_video_codec_h265std_decode',
'vulkan_video_codec_h265std_encode',
]
addExtensionRE = makeREstring(videoStd)
for codec in videoStd:
headername = f'{codec}.h'
# Consider all of the codecs 'extensions', but only emit this one
emitExtensionRE = makeREstring([codec])
opts = CGeneratorOptions(
conventions = conventions,
filename = headername,
directory = directory,
genpath = None,
apiname = defaultAPIName,
mergeApiNames = mergeApiNames,
profile = None,
versions = None,
emitversions = None,
defaultExtensions = defaultAPIName,
addExtensions = addExtensionRE,
removeExtensions = None,
emitExtensions = emitExtensionRE,
prefixText = prefixStrings + vkPrefixStrings,
genFuncPointers = False,
protectFile = protectFile,
protectFeature = False,
alignFuncParam = 48,
)
genOpts[headername] = [ COutputGenerator, opts ]
# Unused - vulkan11.h target.
# It is possible to generate a header with just the Vulkan 1.0 +
# extension interfaces defined, but since the promoted KHR extensions
# are now defined in terms of the 1.1 interfaces, such a header is very
# similar to vulkan_core.h.
genOpts['vulkan11.h'] = [
COutputGenerator,
CGeneratorOptions(
conventions = conventions,
filename = 'vulkan11.h',
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = '^VK_VERSION_1_[01]$',
emitversions = '^VK_VERSION_1_[01]$',
defaultExtensions = None,
addExtensions = None,
removeExtensions = None,
emitExtensions = None,
prefixText = prefixStrings + vkPrefixStrings,
genFuncPointers = True,
protectFile = protectFile,
protectFeature = False,
protectProto = '#ifndef',
protectProtoStr = 'VK_NO_PROTOTYPES',
apicall = 'VKAPI_ATTR ',
apientry = 'VKAPI_CALL ',
apientryp = 'VKAPI_PTR *',
alignFuncParam = 48,
misracstyle = misracstyle,
misracppstyle = misracppstyle)
]
genOpts['alias.h'] = [
COutputGenerator,
CGeneratorOptions(
conventions = conventions,
filename = 'alias.h',
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = defaultExtensions,
addExtensions = None,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
prefixText = None,
genFuncPointers = False,
protectFile = False,
protectFeature = False,
protectProto = '',
protectProtoStr = '',
apicall = '',
apientry = '',
apientryp = '',
alignFuncParam = 36)
]
def genTarget(args):
"""Create an API generator and corresponding generator options based on
the requested target and command line options.
This is encapsulated in a function so it can be profiled and/or timed.
The args parameter is an parsed argument object containing the following
fields that are used:
- target - target to generate
- directory - directory to generate it in
- protect - True if re-inclusion wrappers should be created
- extensions - list of additional extensions to include in generated interfaces"""
# Create generator options with parameters specified on command line
makeGenOpts(args)
# Select a generator matching the requested target
if args.target in genOpts:
createGenerator = genOpts[args.target][0]
options = genOpts[args.target][1]
logDiag('* Building', options.filename)
logDiag('* options.versions =', options.versions)
logDiag('* options.emitversions =', options.emitversions)
logDiag('* options.defaultExtensions =', options.defaultExtensions)
logDiag('* options.addExtensions =', options.addExtensions)
logDiag('* options.removeExtensions =', options.removeExtensions)
logDiag('* options.emitExtensions =', options.emitExtensions)
logDiag('* options.emitSpirv =', options.emitSpirv)
logDiag('* options.emitFormats =', options.emitFormats)
gen = createGenerator(errFile=errWarn,
warnFile=errWarn,
diagFile=diag)
return (gen, options)
else:
logErr('No generator options for unknown target:', args.target)
return None
# -feature name
# -extension name
# For both, "name" may be a single name, or a space-separated list
# of names, or a regular expression.
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-apiname', action='store',
default=None,
help='Specify API to generate (defaults to repository-specific conventions object value)')
parser.add_argument('-mergeApiNames', action='store',
default=None,
help='Specify a comma separated list of APIs to merge into the target API')
parser.add_argument('-defaultExtensions', action='store',
default=APIConventions().xml_api_name,
help='Specify a single class of extensions to add to targets')
parser.add_argument('-extension', action='append',
default=[],
help='Specify an extension or extensions to add to targets')
parser.add_argument('-removeExtensions', action='append',
default=[],
help='Specify an extension or extensions to remove from targets')
parser.add_argument('-emitExtensions', action='append',
default=[],
help='Specify an extension or extensions to emit in targets')
parser.add_argument('-emitSpirv', action='append',
default=[],
help='Specify a SPIR-V extension or capability to emit in targets')
parser.add_argument('-emitFormats', action='append',
default=[],
help='Specify Vulkan Formats to emit in targets')
parser.add_argument('-feature', action='append',
default=[],
help='Specify a core API feature name or names to add to targets')
parser.add_argument('-debug', action='store_true',
help='Enable debugging')
parser.add_argument('-dump', action='store_true',
help='Enable dump to stderr')
parser.add_argument('-diagfile', action='store',
default=None,
help='Write diagnostics to specified file')
parser.add_argument('-errfile', action='store',
default=None,
help='Write errors and warnings to specified file instead of stderr')
parser.add_argument('-noprotect', dest='protect', action='store_false',
help='Disable inclusion protection in output headers')
parser.add_argument('-profile', action='store_true',
help='Enable profiling')
parser.add_argument('-registry', action='store',
default='vk.xml',
help='Use specified registry file instead of vk.xml')
parser.add_argument('-time', action='store_true',
help='Enable timing')
parser.add_argument('-genpath', action='store', default='gen',
help='Path to generated files')
parser.add_argument('-o', action='store', dest='directory',
default='.',
help='Create target and related files in specified directory')
parser.add_argument('target', metavar='target', nargs='?',
help='Specify target')
parser.add_argument('-quiet', action='store_true', default=True,
help='Suppress script output during normal execution.')
parser.add_argument('-verbose', action='store_false', dest='quiet', default=True,
help='Enable script output during normal execution.')
parser.add_argument('-misracstyle', dest='misracstyle', action='store_true',
help='generate MISRA C-friendly headers')
parser.add_argument('-misracppstyle', dest='misracppstyle', action='store_true',
help='generate MISRA C++-friendly headers')
args = parser.parse_args()
# This splits arguments which are space-separated lists
args.feature = [name for arg in args.feature for name in arg.split()]
args.extension = [name for arg in args.extension for name in arg.split()]
# create error/warning & diagnostic files
if args.errfile:
errWarn = open(args.errfile, 'w', encoding='utf-8')
else:
errWarn = sys.stderr
if args.diagfile:
diag = open(args.diagfile, 'w', encoding='utf-8')
else:
diag = None
if args.time:
# Log diagnostics and warnings
setLogFile(setDiag = True, setWarn = True, filename = '-')
# Create the API generator & generator options
(gen, options) = genTarget(args)
# Create the registry object with the specified generator and generator
# options. The options are set before XML loading as they may affect it.
reg = Registry(gen, options)
# Parse the specified registry XML into an ElementTree object
startTimer(args.time)
tree = etree.parse(args.registry)
endTimer(args.time, '* Time to make ElementTree =')
# Load the XML tree into the registry object
startTimer(args.time)
reg.loadElementTree(tree)
endTimer(args.time, '* Time to parse ElementTree =')
if args.dump:
logDiag('* Dumping registry to regdump.txt')
reg.dumpReg(filehandle=open('regdump.txt', 'w', encoding='utf-8'))
# Finally, use the output generator to create the requested target
if args.debug:
pdb.run('reg.apiGen()')
else:
startTimer(args.time)
reg.apiGen()
endTimer(args.time, '* Time to generate ' + options.filename + ' =')
if not args.quiet:
logDiag('* Generated', options.filename)

View file

@ -1,6 +1,6 @@
#!/usr/bin/python3
#!/usr/bin/env python3
# Copyright 2022-2023 The Khronos Group Inc.
# Copyright 2022-2025 The Khronos Group Inc.
# Copyright 2003-2019 Paul McGuire
# SPDX-License-Identifier: MIT
@ -31,7 +31,8 @@
# - ',' as OR connector
# - parenthesization for grouping
# Based on https://github.com/pyparsing/pyparsing/blob/master/examples/fourFn.py
# Based on `examples/fourFn.py` from the
# https://github.com/pyparsing/pyparsing/ repository.
from pyparsing import (
Literal,
@ -52,23 +53,54 @@ import operator
import pyparsing as pp
import re
def nameMarkup(name):
"""Returns asciidoc markup to generate a link to an API version or
extension anchor.
from apiconventions import APIConventions as APIConventions
conventions = APIConventions()
def markupPassthrough(name):
"""Pass a name (leaf or operator) through without applying markup"""
return name
def leafMarkupAsciidoc(name):
"""Markup a leaf name as an asciidoc link to an API version or extension
anchor.
- name - version or extension name"""
# Could use ApiConventions.is_api_version_name, but that does not split
# out the major/minor version numbers.
match = re.search("[A-Z]+_VERSION_([0-9]+)_([0-9]+)", name)
if match is not None:
major = match.group(1)
minor = match.group(2)
version = major + '.' + minor
return f'<<versions-{major}.{minor}, Version {version}>>'
else:
return 'apiext:' + name
return conventions.formatVersionOrExtension(name)
def leafMarkupC(name):
"""Markup a leaf name as a C expression, using conventions of the
Vulkan Validation Layers
- name - version or extension name"""
(apivariant, major, minor) = apiVersionNameMatch(name)
if apivariant is not None:
return name
else:
return f'ext.{name}'
opMarkupAsciidocMap = { '+' : 'and', ',' : 'or' }
def opMarkupAsciidoc(op):
"""Markup an operator as an asciidoc spec markup equivalent
- op - operator ('+' or ',')"""
return opMarkupAsciidocMap[op]
opMarkupCMap = { '+' : '&&', ',' : '||' }
def opMarkupC(op):
"""Markup an operator as a C language equivalent
- op - operator ('+' or ',')"""
return opMarkupCMap[op]
# Unfortunately global to be used in pyparsing
exprStack = []
def push_first(toks):
@ -78,8 +110,8 @@ def push_first(toks):
exprStack.append(toks[0])
# An identifier (version or extension name)
dependencyIdent = Word(alphanums + '_')
# An identifier (version, feature boolean, or extension name)
dependencyIdent = Word(f"{alphanums}_:")
# Infix expression for depends expressions
dependencyExpr = pp.infixNotation(dependencyIdent,
@ -121,12 +153,6 @@ _opn = {
',': operator.or_,
}
# map operator symbols to corresponding words
_opname = {
'+': 'and',
',': 'or',
}
def evaluateStack(stack, isSupported):
"""Evaluate an expression stack, returning a boolean result.
@ -161,42 +187,66 @@ def evaluateDependency(dependency, isSupported):
val = evaluateStack(exprStack[:], isSupported)
return val
def evalDependencyLanguage(stack, specmacros):
def evalDependencyLanguage(stack, leafMarkup, opMarkup, parenthesize, root):
"""Evaluate an expression stack, returning an English equivalent
- stack - the stack
- specmacros - if True, prepare the language for spec inclusion"""
- leafMarkup, opMarkup, parenthesize - same as dependencyLanguage
- root - True only if this is the outer (root) expression level"""
op, num_args = stack.pop(), 0
if isinstance(op, tuple):
op, num_args = op
if op in '+,':
# Could parenthesize, not needed yet
rhs = evalDependencyLanguage(stack, specmacros)
return evalDependencyLanguage(stack, specmacros) + f' {_opname[op]} ' + rhs
rhs = evalDependencyLanguage(stack, leafMarkup, opMarkup, parenthesize, root = False)
opname = opMarkup(op)
lhs = evalDependencyLanguage(stack, leafMarkup, opMarkup, parenthesize, root = False)
if parenthesize and not root:
return f'({lhs} {opname} {rhs})'
else:
return f'{lhs} {opname} {rhs}'
elif op[0].isalpha():
# This is an extension or feature name
if specmacros:
return nameMarkup(op)
else:
return op
return leafMarkup(op)
else:
raise Exception(f'invalid op: {op}')
def dependencyLanguage(dependency, specmacros = False):
def dependencyLanguage(dependency, leafMarkup, opMarkup, parenthesize):
"""Return an API dependency expression translated to a form suitable for
asciidoctor conditionals or header file comments.
- dependency - the expression
- specmacros - if False, return a string that can be used as an
asciidoctor conditional.
If True, return a string suitable for spec inclusion with macros and
xrefs included."""
- leafMarkup - function taking an extension / version name and
returning an equivalent marked up version
- opMarkup - function taking an operator ('+' / ',') name name and
returning an equivalent marked up version
- parenthesize - True if parentheses should be used in the resulting
expression, False otherwise"""
global exprStack
exprStack = []
results = dependencyBNF().parseString(dependency, parseAll=True)
return evalDependencyLanguage(exprStack, specmacros)
return evalDependencyLanguage(exprStack, leafMarkup, opMarkup, parenthesize, root = True)
# aka specmacros = False
def dependencyLanguageComment(dependency):
"""Return dependency expression translated to a form suitable for
comments in headers of emitted C code, as used by the
docgenerator."""
return dependencyLanguage(dependency, leafMarkup = markupPassthrough, opMarkup = opMarkupAsciidoc, parenthesize = True)
# aka specmacros = True
def dependencyLanguageSpecMacros(dependency):
"""Return dependency expression translated to a form suitable for
comments in headers of emitted C code, as used by the
interfacegenerator."""
return dependencyLanguage(dependency, leafMarkup = leafMarkupAsciidoc, opMarkup = opMarkupAsciidoc, parenthesize = False)
def dependencyLanguageC(dependency):
"""Return dependency expression translated to a form suitable for
use in C expressions"""
return dependencyLanguage(dependency, leafMarkup = leafMarkupC, opMarkup = opMarkupC, parenthesize = True)
def evalDependencyNames(stack):
"""Evaluate an expression stack, returning the set of extension and
@ -238,7 +288,7 @@ def markupTraverse(expr, level = 0, root = True):
- root - True only on initial call"""
if level > 0:
prefix = '{nbsp}{nbsp}' * level * 2 + ' '
prefix = f"{'{nbsp}{nbsp}' * level * 2} "
else:
prefix = ''
str = ''
@ -253,9 +303,9 @@ def markupTraverse(expr, level = 0, root = True):
str = str + markupTraverse(elem, level = nextlevel, root = False)
elif elem in ('+', ','):
str = str + f'{prefix}{_opname[elem]} +\n'
str = f"{str}{prefix}{opMarkupAsciidoc(elem)} +\n"
else:
str = str + f'{prefix}{nameMarkup(elem)} +\n'
str = f"{str}{prefix}{leafMarkupAsciidoc(elem)} +\n"
return str
@ -270,6 +320,10 @@ def dependencyMarkup(dependency):
return markupTraverse(parsed)
if __name__ == "__main__":
for str in [ 'VK_VERSION_1_0', 'cl_khr_extension_name', 'XR_VERSION_3_2', 'CL_VERSION_1_0' ]:
print(f'{str} -> {conventions.formatVersionOrExtension(str)}')
import sys
sys.exit(0)
termdict = {
'VK_VERSION_1_1' : True,
@ -288,7 +342,8 @@ if __name__ == "__main__":
print(dependency, f'failed eval: {dependency}')
if val == expected:
print(f'{dependency} = {val} (as expected)')
True
# print(f'{dependency} = {val} (as expected)')
else:
print(f'{dependency} ERROR: {val} != {expected}')
@ -331,24 +386,19 @@ if __name__ == "__main__":
test('true+(true,false)', True)
test('true+(true,true)', True)
#test('VK_VERSION_1_1+(false,true)', True)
#test('true', True)
#test('(true)', True)
#test('false,false', False)
#test('false,true', True)
#test('false+true', False)
#test('true+true', True)
# Check formatting
for dependency in [
#'true',
#'true+true+false',
'true+false',
'true+(true+false),(false,true)',
'true+((true+false),(false,true))',
#'true+((true+false),(false,true))',
'VK_VERSION_1_0+VK_KHR_display',
#'VK_VERSION_1_1+(true,false)',
]:
print(f'expr = {dependency}\n{dependencyMarkup(dependency)}')
print(f' language = {dependencyLanguage(dependency)}')
print(f' spec language = {dependencyLanguageSpecMacros(dependency)}')
print(f' comment language = {dependencyLanguageComment(dependency)}')
print(f' C language = {dependencyLanguageC(dependency)}')
print(f' names = {dependencyNames(dependency)}')
print(f' value = {evaluateDependency(dependency, termSupported)}')

View file

@ -1,5 +1,5 @@
{
"$schema": "https://schema.khronos.org/vulkan/profiles-0.8.1-204.json#",
"$schema": "https://schema.khronos.org/vulkan/profiles-0.8.2-276.json#",
"capabilities": {
"vulkan10requirements": {
"features": {
@ -8,6 +8,71 @@
}
}
},
"vulkan11requirements": {
"features": {
"VkPhysicalDeviceVulkan11Features": {
"multiview": true
}
},
"properties": {
"VkPhysicalDeviceVulkan11Properties": {
"maxMultiviewViewCount": 6,
"maxMultiviewInstanceIndex": 134217727
}
}
},
"vulkan12requirements": {
"features": {
"VkPhysicalDeviceVulkan12Features": {
"uniformBufferStandardLayout": true,
"subgroupBroadcastDynamicId": true,
"imagelessFramebuffer": true,
"separateDepthStencilLayouts": true,
"hostQueryReset": true,
"timelineSemaphore": true,
"shaderSubgroupExtendedTypes": true
}
},
"properties": {
"VkPhysicalDeviceVulkan12Properties": {
"maxTimelineSemaphoreValueDifference": 2147483647
}
}
},
"vulkan13requirements": {
"features": {
"VkPhysicalDeviceVulkan12Features": {
"vulkanMemoryModel": true,
"vulkanMemoryModelDeviceScope": true,
"bufferDeviceAddress": true
},
"VkPhysicalDeviceVulkan13Features": {
"robustImageAccess": true,
"shaderTerminateInvocation": true,
"shaderZeroInitializeWorkgroupMemory": true,
"synchronization2": true,
"shaderIntegerDotProduct": true,
"maintenance4": true,
"pipelineCreationCacheControl": true,
"subgroupSizeControl": true,
"computeFullSubgroups": true,
"shaderDemoteToHelperInvocation": true,
"inlineUniformBlock": true,
"dynamicRendering": true
}
},
"properties": {
"VkPhysicalDeviceVulkan13Properties": {
"maxBufferSize": 1073741824,
"maxInlineUniformBlockSize": 256,
"maxPerStageDescriptorInlineUniformBlocks": 4,
"maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks": 4,
"maxDescriptorSetInlineUniformBlocks": 4,
"maxDescriptorSetUpdateAfterBindInlineUniformBlocks": 4,
"maxInlineUniformTotalSize": 256
}
}
},
"vulkan10requirements_roadmap2022": {
"features": {
"VkPhysicalDeviceFeatures": {
@ -76,19 +141,6 @@
}
}
},
"vulkan11requirements": {
"features": {
"VkPhysicalDeviceVulkan11Features": {
"multiview": true
}
},
"properties": {
"VkPhysicalDeviceVulkan11Properties": {
"maxMultiviewViewCount": 6,
"maxMultiviewInstanceIndex": 134217727
}
}
},
"vulkan11requirements_roadmap2022": {
"features": {
"VkPhysicalDeviceVulkan11Features": {
@ -103,24 +155,6 @@
}
}
},
"vulkan12requirements": {
"features": {
"VkPhysicalDeviceVulkan12Features": {
"uniformBufferStandardLayout": true,
"subgroupBroadcastDynamicId": true,
"imagelessFramebuffer": true,
"separateDepthStencilLayouts": true,
"hostQueryReset": true,
"timelineSemaphore": true,
"shaderSubgroupExtendedTypes": true
}
},
"properties": {
"VkPhysicalDeviceVulkan12Properties": {
"maxTimelineSemaphoreValueDifference": 2147483647
}
}
},
"vulkan12requirements_roadmap2022": {
"features": {
"VkPhysicalDeviceVulkan12Features": {
@ -168,117 +202,6 @@
}
}
},
"vulkan13requirements": {
"features": {
"VkPhysicalDeviceVulkan12Features": {
"vulkanMemoryModel": true,
"vulkanMemoryModelDeviceScope": true,
"bufferDeviceAddress": true
},
"VkPhysicalDeviceVulkan13Features": {
"robustImageAccess": true,
"shaderTerminateInvocation": true,
"shaderZeroInitializeWorkgroupMemory": true,
"synchronization2": true,
"shaderIntegerDotProduct": true,
"maintenance4": true,
"pipelineCreationCacheControl": true,
"subgroupSizeControl": true,
"computeFullSubgroups": true,
"shaderDemoteToHelperInvocation": true,
"inlineUniformBlock": true,
"dynamicRendering": true
}
},
"properties": {
"VkPhysicalDeviceVulkan13Properties": {
"maxBufferSize": 1073741824,
"maxInlineUniformBlockSize": 256,
"maxPerStageDescriptorInlineUniformBlocks": 4,
"maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks": 4,
"maxDescriptorSetInlineUniformBlocks": 4,
"maxDescriptorSetUpdateAfterBindInlineUniformBlocks": 4,
"maxInlineUniformTotalSize": 256
}
}
},
"vulkan13requirements_1_2": {
"extensions": {
"VK_EXT_image_robustness": 1,
"VK_KHR_shader_non_semantic_info": 1,
"VK_KHR_shader_terminate_invocation": 1,
"VK_KHR_format_feature_flags2": 1,
"VK_KHR_zero_initialize_workgroup_memory": 1,
"VK_KHR_synchronization2": 1,
"VK_KHR_shader_integer_dot_product": 1,
"VK_KHR_maintenance4": 1,
"VK_EXT_4444_formats": 1,
"VK_EXT_extended_dynamic_state": 1,
"VK_EXT_extended_dynamic_state2": 1,
"VK_EXT_pipeline_creation_cache_control": 1,
"VK_EXT_subgroup_size_control": 1,
"VK_EXT_shader_demote_to_helper_invocation": 1,
"VK_EXT_inline_uniform_block": 1,
"VK_EXT_pipeline_creation_feedback": 1,
"VK_EXT_texel_buffer_alignment": 1,
"VK_EXT_ycbcr_2plane_444_formats": 1,
"VK_EXT_texture_compression_astc_hdr": 1,
"VK_EXT_tooling_info": 1,
"VK_EXT_private_data": 1,
"VK_KHR_dynamic_rendering": 1
},
"features": {
"VkPhysicalDeviceVulkan12Features": {
"vulkanMemoryModel": true,
"vulkanMemoryModelDeviceScope": true,
"vulkanMemoryModelAvailabilityVisibilityChains": true,
"bufferDeviceAddress": true
},
"VkPhysicalDeviceImageRobustnessFeaturesEXT": {
"robustImageAccess": true
},
"VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR": {
"shaderTerminateInvocation": true
},
"VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR": {
"shaderZeroInitializeWorkgroupMemory": true
},
"VkPhysicalDeviceSynchronization2FeaturesKHR": {
"synchronization2": true
},
"VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR": {
"shaderIntegerDotProduct": true
},
"VkPhysicalDeviceMaintenance4FeaturesKHR": {
"maintenance4": true
},
"VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT": {
"pipelineCreationCacheControl": true
},
"VkPhysicalDeviceSubgroupSizeControlFeaturesEXT": {
"subgroupSizeControl": true,
"computeFullSubgroups": true
},
"VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT": {
"shaderDemoteToHelperInvocation": true
},
"VkPhysicalDeviceInlineUniformBlockFeaturesEXT": {
"inlineUniformBlock": true
}
},
"properties": {
"VkPhysicalDeviceMaintenance4PropertiesKHR": {
"maxBufferSize": 1073741824
},
"VkPhysicalDeviceInlineUniformBlockPropertiesEXT": {
"maxInlineUniformBlockSize": 256,
"maxPerStageDescriptorInlineUniformBlocks": 4,
"maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks": 4,
"maxDescriptorSetInlineUniformBlocks": 4,
"maxDescriptorSetUpdateAfterBindInlineUniformBlocks": 4
}
}
},
"vulkan13requirements_roadmap2022": {
"extensions": {
"VK_KHR_global_priority": 1
@ -289,19 +212,93 @@
}
}
},
"vulkan13requirements_roadmap2022_1_2": {
"extensions": {
"VK_EXT_global_priority": 1,
"VK_EXT_inline_uniform_block": 1
},
"vulkan10requirements_roadmap2024": {
"features": {
"VkPhysicalDeviceInlineUniformBlockFeaturesEXT": {
"descriptorBindingInlineUniformBlockUpdateAfterBind": true
"VkPhysicalDeviceFeatures": {
"multiDrawIndirect": true,
"shaderInt16": true,
"shaderImageGatherExtended": true
}
},
"properties": {
"VkPhysicalDeviceProperties": {
"limits": {
"timestampComputeAndGraphics": true,
"maxColorAttachments": 8,
"maxBoundDescriptorSets": 7
}
}
}
},
"vulkan11requirements_roadmap2024": {
"features": {
"VkPhysicalDeviceVulkan11Features": {
"shaderDrawParameters": true,
"storageBuffer16BitAccess": true
}
}
},
"vulkan12requirements_roadmap2024": {
"features": {
"VkPhysicalDeviceVulkan12Features": {
"shaderInt8": true,
"shaderFloat16": true,
"storageBuffer8BitAccess": true
}
},
"properties": {
"VkPhysicalDeviceVulkan12Properties": {
"shaderRoundingModeRTEFloat16": true,
"shaderRoundingModeRTEFloat32": true
}
}
},
"vulkan13requirements_roadmap2024": {
"features": {
"VkPhysicalDeviceVulkan13Features": {
}
},
"properties": {
"VkPhysicalDeviceVulkan13Properties": {
}
}
},
"vulkanextensionrequirements_roadmap2024": {
"extensions": {
"VK_KHR_dynamic_rendering_local_read": 1,
"VK_KHR_load_store_op_none": 1,
"VK_KHR_shader_quad_control": 1,
"VK_KHR_shader_maximal_reconvergence": 1,
"VK_KHR_shader_subgroup_uniform_control_flow": 1,
"VK_KHR_shader_subgroup_rotate": 1,
"VK_KHR_shader_float_controls2": 1,
"VK_KHR_shader_expect_assume": 1,
"VK_KHR_line_rasterization": 1,
"VK_KHR_vertex_attribute_divisor": 1,
"VK_KHR_index_type_uint8": 1,
"VK_KHR_map_memory2": 1,
"VK_KHR_maintenance5": 1,
"VK_KHR_push_descriptor": 1
}
}
},
"profiles": {
"VP_KHR_roadmap_2024": {
"version": 1,
"api-version": "1.3.276",
"label": "Khronos Vulkan Roadmap 2024 profile",
"description": "This roadmap profile is intended to be supported by newer devices shipping in 2024 across mainstream smartphone, tablet, laptops, console and desktop devices.",
"profiles": [
"VP_KHR_roadmap_2022"
],
"capabilities": [
"vulkan10requirements_roadmap2024",
"vulkan11requirements_roadmap2024",
"vulkan12requirements_roadmap2024",
"vulkan13requirements_roadmap2024",
"vulkanextensionrequirements_roadmap2024"
]
},
"VP_KHR_roadmap_2022": {
"version": 1,
"api-version": "1.3.204",
@ -320,6 +317,18 @@
}
},
"history": [
{
"revision": 9,
"date": "2024-01-16",
"author": "Tobias Hector",
"comment": "Add Roadmap 2024 profile"
},
{
"revision": 8,
"date": "2023-11-02",
"author": "Christophe Riccio",
"comment": "Remove unreferenced capabilities blocks that were written against Vulkan 1.2 for testing before Vulkan 1.3 was released"
},
{
"revision": 7,
"date": "2022-11-16",

View file

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2023 The Khronos Group Inc.
# Copyright 2013-2025 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
@ -134,8 +134,10 @@ def mergeAPIs(tree, fromApiNames, toApiName):
definitionName = child.get('name')
definitionVariants = parent.findall(f"{child.tag}[@name='{definitionName}']")
elif child.tag in ['require']:
definitionName = child.get('feature')
definitionVariants = parent.findall(f"{child.tag}[@feature='{definitionName}']")
# No way to correlate require tags because they do not have a definite identifier in the way they
# are used in the latest forms of the XML so the best we can do is simply enable all of them
if child.get('api') in fromApiNames:
child.set('api', toApiName)
elif child.tag in ['command']:
definitionName = child.find('proto/name').text
definitionVariants = parent.findall(f"{child.tag}/proto/name[.='{definitionName}']/../..")
@ -376,6 +378,28 @@ class FormatInfo(BaseInfo):
# Need to save the condition here when it is known
self.condition = condition
class SyncStageInfo(BaseInfo):
"""Registry information about <syncstage>."""
def __init__(self, elem, condition):
BaseInfo.__init__(self, elem)
# Need to save the condition here when it is known
self.condition = condition
class SyncAccessInfo(BaseInfo):
"""Registry information about <syncaccess>."""
def __init__(self, elem, condition):
BaseInfo.__init__(self, elem)
# Need to save the condition here when it is known
self.condition = condition
class SyncPipelineInfo(BaseInfo):
"""Registry information about <syncpipeline>."""
def __init__(self, elem):
BaseInfo.__init__(self, elem)
class Registry:
"""Object representing an API registry, loaded from an XML file."""
@ -414,6 +438,12 @@ class Registry:
self.cmddict = {}
"dictionary of CmdInfo objects keyed by command name"
self.aliasdict = {}
"dictionary of type and command names mapped to their alias, such as VkFooKHR -> VkFoo"
self.enumvaluedict = {}
"dictionary of enum values mapped to their type, such as VK_FOO_VALUE -> VkFoo"
self.apidict = {}
"dictionary of FeatureInfo objects for `<feature>` elements keyed by API name"
@ -432,6 +462,15 @@ class Registry:
self.formatsdict = {}
"dictionary of FeatureInfo objects for `<format>` elements keyed by VkFormat name"
self.syncstagedict = {}
"dictionary of Sync*Info objects for `<syncstage>` elements keyed by VkPipelineStageFlagBits2 name"
self.syncaccessdict = {}
"dictionary of Sync*Info objects for `<syncaccess>` elements keyed by VkAccessFlagBits2 name"
self.syncpipelinedict = {}
"dictionary of Sync*Info objects for `<syncpipeline>` elements keyed by pipeline type name"
self.emitFeatures = False
"""True to actually emit features for a version / extension,
or False to just treat them as emitted"""
@ -477,10 +516,10 @@ class Registry:
Intended for internal use only.
- elem - `<type>`/`<enums>`/`<enum>`/`<command>`/`<feature>`/`<extension>`/`<spirvextension>`/`<spirvcapability>`/`<format>` Element
- info - corresponding {Type|Group|Enum|Cmd|Feature|Spirv|Format}Info object
- infoName - 'type' / 'group' / 'enum' / 'command' / 'feature' / 'extension' / 'spirvextension' / 'spirvcapability' / 'format'
- dictionary - self.{type|group|enum|cmd|api|ext|format|spirvext|spirvcap}dict
- elem - `<type>`/`<enums>`/`<enum>`/`<command>`/`<feature>`/`<extension>`/`<spirvextension>`/`<spirvcapability>`/`<format>`/`<syncstage>`/`<syncaccess>`/`<syncpipeline>` Element
- info - corresponding {Type|Group|Enum|Cmd|Feature|Spirv|Format|SyncStage|SyncAccess|SyncPipeline}Info object
- infoName - 'type' / 'group' / 'enum' / 'command' / 'feature' / 'extension' / 'spirvextension' / 'spirvcapability' / 'format' / 'syncstage' / 'syncaccess' / 'syncpipeline'
- dictionary - self.{type|group|enum|cmd|api|ext|format|spirvext|spirvcap|sync}dict
The dictionary key is the element 'name' attribute."""
@ -517,6 +556,22 @@ class Registry:
"""Specify a feature name regexp to break on when generating features."""
self.breakPat = re.compile(regexp)
def addEnumValue(self, enum, type_name):
"""Track aliasing and map back from enum values to their type"""
# Record alias, if any
value = enum.get('name')
alias = enum.get('alias')
if alias:
self.aliasdict[value] = alias
# Map the value back to the type
if type_name in self.aliasdict:
type_name = self.aliasdict[type_name]
if value in self.enumvaluedict:
# Some times the same enum is defined by multiple extensions
assert(type_name == self.enumvaluedict[value])
else:
self.enumvaluedict[value] = type_name
def parseTree(self):
"""Parse the registry Element, once created"""
# This must be the Element for the root <registry>
@ -540,6 +595,9 @@ class Registry:
else:
stripNonmatchingAPIs(self.reg, self.genOpts.apiname, actuallyDelete = True)
self.aliasdict = {}
self.enumvaluedict = {}
# Create dictionary of registry types from toplevel <types> tags
# and add 'name' attribute to each <type> tag (where missing)
# based on its <name> element.
@ -550,13 +608,20 @@ class Registry:
for type_elem in self.reg.findall('types/type'):
# If the <type> does not already have a 'name' attribute, set
# it from contents of its <name> tag.
if type_elem.get('name') is None:
name = type_elem.get('name')
if name is None:
name_elem = type_elem.find('name')
if name_elem is None or not name_elem.text:
raise RuntimeError("Type without a name!")
type_elem.set('name', name_elem.text)
name = name_elem.text
type_elem.set('name', name)
self.addElementInfo(type_elem, TypeInfo(type_elem), 'type', self.typedict)
# Record alias, if any
alias = type_elem.get('alias')
if alias:
self.aliasdict[name] = alias
# Create dictionary of registry enum groups from <enums> tags.
#
# Required <enums> attributes: 'name'. If no name is given, one is
@ -578,10 +643,14 @@ class Registry:
self.enumdict = {}
for enums in self.reg.findall('enums'):
required = (enums.get('type') is not None)
type_name = enums.get('name')
# Enum values are defined only for the type that is not aliased to something else.
assert(type_name not in self.aliasdict)
for enum in enums.findall('enum'):
enumInfo = EnumInfo(enum)
enumInfo.required = required
self.addElementInfo(enum, enumInfo, 'enum', self.enumdict)
self.addEnumValue(enum, type_name)
# Create dictionary of registry commands from <command> tags
# and add 'name' attribute to each <command> tag (where missing)
@ -591,7 +660,7 @@ class Registry:
# Required <command> attributes: 'name' or <proto><name> tag contents
self.cmddict = {}
# List of commands which alias others. Contains
# [ aliasName, element ]
# [ name, aliasName, element ]
# for each alias
cmdAlias = []
for cmd in self.reg.findall('commands/command'):
@ -608,6 +677,7 @@ class Registry:
alias = cmd.get('alias')
if alias:
cmdAlias.append([name, alias, cmd])
self.aliasdict[name] = alias
# Now loop over aliases, injecting a copy of the aliased command's
# Element with the aliased prototype name replaced with the command
@ -682,6 +752,10 @@ class Registry:
if addEnumInfo:
enumInfo = EnumInfo(enum)
self.addElementInfo(enum, enumInfo, 'enum', self.enumdict)
self.addEnumValue(enum, groupName)
sync_pipeline_stage_condition = dict()
sync_access_condition = dict()
self.extensions = self.reg.findall('extensions/extension')
self.extdict = {}
@ -727,9 +801,28 @@ class Registry:
if enum.get('alias'):
format_name = enum.get('alias')
if format_name in format_condition:
format_condition[format_name] += "," + featureInfo.name
format_condition[format_name] += f",{featureInfo.name}"
else:
format_condition[format_name] = featureInfo.name
elif groupName == "VkPipelineStageFlagBits2":
stage_flag = enum.get('name')
if enum.get('alias'):
stage_flag = enum.get('alias')
featureName = elem.get('depends') if elem.get('depends') is not None else featureInfo.name
if stage_flag in sync_pipeline_stage_condition:
sync_pipeline_stage_condition[stage_flag] += f",{featureName}"
else:
sync_pipeline_stage_condition[stage_flag] = featureName
elif groupName == "VkAccessFlagBits2":
access_flag = enum.get('name')
if enum.get('alias'):
access_flag = enum.get('alias')
featureName = elem.get('depends') if elem.get('depends') is not None else featureInfo.name
if access_flag in sync_access_condition:
sync_access_condition[access_flag] += f",{featureName}"
else:
sync_access_condition[access_flag] = featureName
addEnumInfo = True
elif enum.get('value') or enum.get('bitpos') or enum.get('alias'):
# self.gen.logMsg('diag', 'Adding extension constant "enum"',
@ -738,6 +831,7 @@ class Registry:
if addEnumInfo:
enumInfo = EnumInfo(enum)
self.addElementInfo(enum, enumInfo, 'enum', self.enumdict)
self.addEnumValue(enum, groupName)
# Parse out all spirv tags in dictionaries
# Use addElementInfo to catch duplicates
@ -756,6 +850,26 @@ class Registry:
formatInfo = FormatInfo(format, condition)
self.addElementInfo(format, formatInfo, 'format', self.formatsdict)
for stage in self.reg.findall('sync/syncstage'):
condition = None
stage_flag = stage.get('name')
if stage_flag in sync_pipeline_stage_condition:
condition = sync_pipeline_stage_condition[stage_flag]
syncInfo = SyncStageInfo(stage, condition)
self.addElementInfo(stage, syncInfo, 'syncstage', self.syncstagedict)
for access in self.reg.findall('sync/syncaccess'):
condition = None
access_flag = access.get('name')
if access_flag in sync_access_condition:
condition = sync_access_condition[access_flag]
syncInfo = SyncAccessInfo(access, condition)
self.addElementInfo(access, syncInfo, 'syncaccess', self.syncaccessdict)
for pipeline in self.reg.findall('sync/syncpipeline'):
syncInfo = SyncPipelineInfo(pipeline)
self.addElementInfo(pipeline, syncInfo, 'syncpipeline', self.syncpipelinedict)
def dumpReg(self, maxlen=120, filehandle=sys.stdout):
"""Dump all the dictionaries constructed from the Registry object.
@ -877,7 +991,7 @@ class Registry:
# Look up the Info with matching groupName
if groupName in self.groupdict:
gi = self.groupdict[groupName]
gienum = gi.elem.find("enum[@name='" + enumname + "']")
gienum = gi.elem.find(f"enum[@name='{enumname}']")
if gienum is not None:
# Remove copy of this enum from the group
gi.elem.remove(gienum)
@ -974,6 +1088,7 @@ class Registry:
self.markTypeRequired(typeElem.get('name'), required)
for enumElem in feature.findall('enum'):
self.markEnumRequired(enumElem.get('name'), required)
for cmdElem in feature.findall('command'):
self.markCmdRequired(cmdElem.get('name'), required)
@ -1080,6 +1195,8 @@ class Registry:
# Resolve the type info to the actual type, so we get an accurate read for 'structextends'
while alias:
typeinfo = self.lookupElementInfo(alias, self.typedict)
if not typeinfo:
raise RuntimeError(f"Missing alias {alias}")
alias = typeinfo.elem.get('alias')
typecat = typeinfo.elem.get('category')
@ -1090,7 +1207,7 @@ class Registry:
self.gen.featureDictionary[featurename][typecat][required_key][typeextends] = []
self.gen.featureDictionary[featurename][typecat][required_key][typeextends].append(typename)
else:
self.gen.logMsg('warn', 'fillFeatureDictionary: NOT filling for {}'.format(typename))
self.gen.logMsg('warn', f'fillFeatureDictionary: NOT filling for {typename}')
for enumElem in require.findall('enum'):
@ -1107,7 +1224,7 @@ class Registry:
self.gen.featureDictionary[featurename]['enumconstant'][required_key][enumextends] = []
self.gen.featureDictionary[featurename]['enumconstant'][required_key][enumextends].append(enumname)
else:
self.gen.logMsg('warn', 'fillFeatureDictionary: NOT filling for {}'.format(typename))
self.gen.logMsg('warn', f'fillFeatureDictionary: NOT filling for {typename}')
for cmdElem in require.findall('command'):
# Remove aliases in the same extension/feature; these are always added as a correction. Do not need the original to be visible.
@ -1117,7 +1234,7 @@ class Registry:
self.gen.featureDictionary[featurename]['command'][required_key] = []
self.gen.featureDictionary[featurename]['command'][required_key].append(cmdElem.get('name'))
else:
self.gen.logMsg('warn', 'fillFeatureDictionary: NOT filling for {}'.format(typename))
self.gen.logMsg('warn', f'fillFeatureDictionary: NOT filling for {typename}')
def requireFeatures(self, interface, featurename, api, profile):
"""Process `<require>` tags for a `<version>` or `<extension>`.
@ -1167,15 +1284,23 @@ class Registry:
if v.get('struct'):
self.typedict[v.get('struct')].removedValidity.append(copy.deepcopy(v))
def generateFeature(self, fname, ftype, dictionary):
def generateFeature(self, fname, ftype, dictionary, explicit=False):
"""Generate a single type / enum group / enum / command,
and all its dependencies as needed.
- fname - name of feature (`<type>`/`<enum>`/`<command>`)
- ftype - type of feature, 'type' | 'enum' | 'command'
- dictionary - of *Info objects - self.{type|enum|cmd}dict"""
- dictionary - of *Info objects - self.{type|enum|cmd}dict
- explicit - True if this is explicitly required by the top-level
XML <require> tag, False if it is a dependency of an explicit
requirement."""
self.gen.logMsg('diag', 'generateFeature: generating', ftype, fname)
if not (explicit or self.genOpts.requireDepends):
self.gen.logMsg('diag', 'generateFeature: NOT generating', ftype, fname, 'because generator does not require dependencies')
return
f = self.lookupElementInfo(fname, dictionary)
if f is None:
# No such feature. This is an error, but reported earlier
@ -1352,16 +1477,16 @@ class Registry:
# Loop over all features inside all <require> tags.
for features in interface.findall('require'):
for t in features.findall('type'):
self.generateFeature(t.get('name'), 'type', self.typedict)
self.generateFeature(t.get('name'), 'type', self.typedict, explicit=True)
for e in features.findall('enum'):
# If this is an enum extending an enumerated type, do not
# generate it - this has already been done in reg.parseTree,
# by copying this element into the enumerated type.
enumextends = e.get('extends')
if not enumextends:
self.generateFeature(e.get('name'), 'enum', self.enumdict)
self.generateFeature(e.get('name'), 'enum', self.enumdict, explicit=True)
for c in features.findall('command'):
self.generateFeature(c.get('name'), 'command', self.cmddict)
self.generateFeature(c.get('name'), 'command', self.cmddict, explicit=True)
def generateSpirv(self, spirv, dictionary):
if spirv is None:
@ -1402,6 +1527,30 @@ class Registry:
if stripped:
eleminfo.elem.set(attribute, ','.join(apis))
def stripUnsupportedAPIsFromList(self, dictionary, supportedDictionary):
"""Strip unsupported APIs from attributes of APIs.
dictionary - dictionary of list of structure name strings
supportedDictionary - dictionary in which to look for supported
API elements in the attribute"""
for key in dictionary:
attribstring = dictionary[key]
if attribstring is not None:
apis = []
stripped = False
for api in attribstring:
##print('Checking API {} referenced by {}'.format(api, key))
if supportedDictionary[api].required:
apis.append(api)
else:
stripped = True
##print('\t**STRIPPING API {} from {}'.format(api, key))
# Update the attribute after stripping stuff.
# Could sort apis before joining, but it is not a clear win
if stripped:
dictionary[key] = apis
def generateFormat(self, format, dictionary):
if format is None:
self.gen.logMsg('diag', 'No entry found for format element',
@ -1415,6 +1564,18 @@ class Registry:
genProc = self.gen.genFormat
genProc(format, name, alias)
def generateSyncStage(self, sync):
genProc = self.gen.genSyncStage
genProc(sync)
def generateSyncAccess(self, sync):
genProc = self.gen.genSyncAccess
genProc(sync)
def generateSyncPipeline(self, sync):
genProc = self.gen.genSyncPipeline
genProc(sync)
def tagValidExtensionStructs(self):
"""Construct a "validextensionstructs" list for parent structures
based on "structextends" tags in child structures.
@ -1603,6 +1764,7 @@ class Registry:
self.stripUnsupportedAPIs(self.typedict, 'structextends', self.typedict)
self.stripUnsupportedAPIs(self.cmddict, 'successcodes', self.enumdict)
self.stripUnsupportedAPIs(self.cmddict, 'errorcodes', self.enumdict)
self.stripUnsupportedAPIsFromList(self.validextensionstructs, self.typedict)
# Construct lists of valid extension structures
self.tagValidExtensionStructs()
@ -1638,6 +1800,12 @@ class Registry:
self.generateSpirv(s, self.spirvcapdict)
for s in formats:
self.generateFormat(s, self.formatsdict)
for s in self.syncstagedict:
self.generateSyncStage(self.syncstagedict[s])
for s in self.syncaccessdict:
self.generateSyncAccess(self.syncaccessdict[s])
for s in self.syncpipelinedict:
self.generateSyncPipeline(self.syncpipelinedict[s])
self.gen.endFile()
def apiReset(self):

View file

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2023 The Khronos Group Inc.
# Copyright 2013-2025 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
@ -32,12 +32,12 @@ TYPES_KNOWN_ALWAYS_VALID = set(('char',
))
# Split an extension name into vendor ID and name portions
EXT_NAME_DECOMPOSE_RE = re.compile(r'[A-Z]+_(?P<vendor>[A-Z]+)_(?P<name>[\w_]+)')
EXT_NAME_DECOMPOSE_RE = re.compile(r'(?P<prefix>[A-Za-z]+)_(?P<vendor>[A-Za-z]+)_(?P<name>[\w_]+)')
# Match an API version name.
# Match object includes API prefix, major, and minor version numbers.
# This could be refined further for specific APIs.
API_VERSION_NAME_RE = re.compile(r'[A-Z]+_VERSION_[0-9]')
API_VERSION_NAME_RE = re.compile(r'(?P<apivariant>[A-Za-z]+)_VERSION_(?P<major>[0-9]+)_(?P<minor>[0-9]+)')
class ProseListFormats(Enum):
"""A connective, possibly with a quantifier."""
@ -52,7 +52,7 @@ class ProseListFormats(Enum):
return cls.OR
if s == 'and':
return cls.AND
raise RuntimeError("Unrecognized string connective: " + s)
raise RuntimeError(f"Unrecognized string connective: {s}")
@property
def connective(self):
@ -80,9 +80,38 @@ class ConventionsBase(abc.ABC):
self._command_prefix = None
self._type_prefix = None
def formatVersionOrExtension(self, name):
"""Mark up an API version or extension name as a link in the spec."""
# Is this a version name?
match = API_VERSION_NAME_RE.match(name)
if match is not None:
return self.formatVersion(name,
match.group('apivariant'),
match.group('major'),
match.group('minor'))
else:
# If not, assumed to be an extension name. Might be worth checking.
return self.formatExtension(name)
def formatVersion(self, name, apivariant, major, minor):
"""Mark up an API version name as a link in the spec."""
return f'`<<{name}>>`'
def formatExtension(self, name):
"""Mark up an extension name as a link the spec."""
return '`<<{}>>`'.format(name)
"""Mark up an extension name as a link in the spec."""
return f'`<<{name}>>`'
def formatSPIRVlink(self, name):
"""Mark up a SPIR-V extension name as an external link in the spec.
Since these are external links, the formatting probably will be
the same for all APIs creating such links, so long as they use
the asciidoctor {spirv} attribute for the base path to the SPIR-V
extensions."""
(vendor, _) = self.extension_name_split(name)
return f'{{spirv}}/{vendor}/{name}.html[{name}]'
@property
@abc.abstractmethod
@ -123,6 +152,11 @@ class ConventionsBase(abc.ABC):
"""
return 'code:'
@property
def allows_x_number_suffix(self):
"""Whether vendor tags can be suffixed with X and a number to mark experimental extensions."""
return False
@property
@abc.abstractmethod
def structtype_member_name(self):
@ -184,13 +218,13 @@ class ConventionsBase(abc.ABC):
Do not edit these defaults, override self.makeProseList().
"""
assert(serial_comma) # did not implement what we did not need
assert serial_comma # did not implement what we did not need
if isinstance(fmt, str):
fmt = ProseListFormats.from_string(fmt)
my_elts = list(elements)
if len(my_elts) > 1:
my_elts[-1] = '{} {}'.format(fmt.connective, my_elts[-1])
my_elts[-1] = f'{fmt.connective} {my_elts[-1]}'
if not comma_for_two_elts and len(my_elts) <= 2:
prose = ' '.join(my_elts)
@ -260,6 +294,56 @@ class ConventionsBase(abc.ABC):
Must implement."""
raise NotImplementedError
@property
def extension_name_prefix(self):
"""Return extension name prefix.
Typically two uppercase letters followed by an underscore.
Assumed to be the same as api_prefix, but some APIs use different
case conventions."""
return self.api_prefix
def extension_short_description(self, elem):
"""Return a short description of an extension for use in refpages.
elem is an ElementTree for the <extension> tag in the XML.
The default behavior is to use the 'type' field of this tag, but not
all APIs support this field."""
ext_type = elem.get('type')
if ext_type is not None:
return f'{ext_type} extension'
else:
return ''
@property
def write_contacts(self):
"""Return whether contact list should be written to extension appendices"""
return False
@property
def write_extension_type(self):
"""Return whether extension type should be written to extension appendices"""
return True
@property
def write_extension_number(self):
"""Return whether extension number should be written to extension appendices"""
return True
@property
def write_extension_revision(self):
"""Return whether extension revision number should be written to extension appendices"""
return True
@property
def write_refpage_include(self):
"""Return whether refpage include should be written to extension appendices"""
return True
@property
def api_version_prefix(self):
"""Return API core version token prefix.
@ -267,7 +351,7 @@ class ConventionsBase(abc.ABC):
Implemented in terms of api_prefix.
May override."""
return self.api_prefix + 'VERSION_'
return f"{self.api_prefix}VERSION_"
@property
def KHR_prefix(self):
@ -276,7 +360,7 @@ class ConventionsBase(abc.ABC):
Implemented in terms of api_prefix.
May override."""
return self.api_prefix + 'KHR_'
return f"{self.api_prefix}KHR_"
@property
def EXT_prefix(self):
@ -285,9 +369,9 @@ class ConventionsBase(abc.ABC):
Implemented in terms of api_prefix.
May override."""
return self.api_prefix + 'EXT_'
return f"{self.api_prefix}EXT_"
def writeFeature(self, featureExtraProtect, filename):
def writeFeature(self, featureName, featureExtraProtect, filename):
"""Return True if OutputGenerator.endFeature should write this feature.
Defaults to always True.
@ -375,6 +459,16 @@ class ConventionsBase(abc.ABC):
documentation includes."""
return False
def extension_name_split(self, name):
"""Split an extension name, returning (vendor, rest of name).
The API prefix of the name is ignored."""
match = EXT_NAME_DECOMPOSE_RE.match(name)
vendor = match.group('vendor')
bare_name = match.group('name')
return (vendor, bare_name)
@abc.abstractmethod
def extension_file_path(self, name):
"""Return file path to an extension appendix relative to a directory
@ -389,8 +483,7 @@ class ConventionsBase(abc.ABC):
file.
- name - extension name"""
return 'include::{{appendices}}/{}[]'.format(
self.extension_file_path(name))
return f'include::{{appendices}}/{self.extension_file_path(name)}[]'
@property
def provisional_extension_warning(self):
@ -452,3 +545,18 @@ class ConventionsBase(abc.ABC):
"""Return True if name is an API version name."""
return API_VERSION_NAME_RE.match(name) is not None
@property
def docgen_language(self):
"""Return the language to be used in docgenerator [source]
blocks."""
return 'c++'
@property
def docgen_source_options(self):
"""Return block options to be used in docgenerator [source] blocks,
which are appended to the 'source' block type.
Can be empty."""
return '%unbreakable'

View file

@ -1,6 +1,6 @@
"""Utility functions not closely tied to other spec_tools types."""
# Copyright (c) 2018-2019 Collabora, Ltd.
# Copyright 2013-2023 The Khronos Group Inc.
# Copyright 2013-2025 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0

View file

@ -1,6 +1,6 @@
#!/usr/bin/python3
#!/usr/bin/env python3
#
# Copyright 2023 The Khronos Group Inc.
# Copyright 2023-2025 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
import argparse

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

9357
registry/vk.xml Normal file → Executable file

File diff suppressed because it is too large Load diff

47
registry/vkconventions.py Normal file → Executable file
View file

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2023 The Khronos Group Inc.
# Copyright 2013-2025 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
@ -28,6 +28,7 @@ SPECIAL_WORDS = set((
'ASTC', # VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT
'D3D12', # VkD3D12FenceSubmitInfoKHR
'Float16', # VkPhysicalDeviceShaderFloat16Int8FeaturesKHR
'Bfloat16', # VkPhysicalDeviceShaderBfloat16FeaturesKHR
'ImagePipe', # VkImagePipeSurfaceCreateInfoFUCHSIA
'Int64', # VkPhysicalDeviceShaderAtomicInt64FeaturesKHR
'Int8', # VkPhysicalDeviceShaderFloat16Int8FeaturesKHR
@ -38,7 +39,7 @@ SPECIAL_WORDS = set((
))
# A regex to match any of the SPECIAL_WORDS
EXCEPTION_PATTERN = r'(?P<exception>{})'.format(
'|'.join('(%s)' % re.escape(w) for w in SPECIAL_WORDS))
'|'.join(f'({re.escape(w)})' for w in SPECIAL_WORDS))
MAIN_RE = re.compile(
# the negative lookahead is to prevent the all-caps pattern from being too greedy.
r'({}|([0-9]+)|([A-Z][a-z]+)|([A-Z][A-Z]*(?![a-z])))'.format(EXCEPTION_PATTERN))
@ -50,9 +51,21 @@ class VulkanConventions(ConventionsBase):
"""Preferred spelling of NULL."""
return '`NULL`'
def formatVersion(self, name, apivariant, major, minor):
"""Mark up an API version name as a link in the spec."""
version = f'{major}.{minor}'
if apivariant == 'VKSC':
# Vulkan SC has a different anchor pattern for version appendices
if version == '1.0':
return 'Vulkan SC 1.0'
else:
return f'<<versions-sc-{version}, Vulkan SC Version {version}>>'
else:
return f'<<versions-{version}, Vulkan Version {version}>>'
def formatExtension(self, name):
"""Mark up an extension name as a link the spec."""
return '`apiext:{}`'.format(name)
"""Mark up an extension name as a link in the spec."""
return f'apiext:{name}'
@property
def struct_macro(self):
@ -107,7 +120,9 @@ class VulkanConventions(ConventionsBase):
# The simple-minded rules need modification for some structure names
subpats = [
[ r'_H_(26[45])_', r'_H\1_' ],
[ r'_AV_1_', r'_AV1_' ],
[ r'_VULKAN_([0-9])([0-9])_', r'_VULKAN_\1_\2_' ],
[ r'_VULKAN_SC_([0-9])([0-9])_',r'_VULKAN_SC_\1_\2_' ],
[ r'_DIRECT_FB_', r'_DIRECTFB_' ],
[ r'_VULKAN_SC_10', r'_VULKAN_SC_1_0' ],
@ -171,7 +186,7 @@ class VulkanConventions(ConventionsBase):
For Vulkan, these are names with a case-insensitive 'vk' prefix, or
a 'PFN_vk' function pointer type prefix.
"""
return name[0:2].lower() == 'vk' or name[0:6] == 'PFN_vk'
return name[0:2].lower() == 'vk' or name.startswith('PFN_vk')
def specURL(self, spectype='api'):
"""Return public registry URL which ref pages should link to for the
@ -180,7 +195,7 @@ class VulkanConventions(ConventionsBase):
instead. N.b. this may need to change on a per-refpage basis if
there are multiple documents involved.
"""
return 'https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html'
return 'https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html'
@property
def xml_api_name(self):
@ -277,3 +292,21 @@ class VulkanConventions(ConventionsBase):
"""Return any extra text (following the title) for generated
reference pages."""
return 'include::{generated}/specattribs.adoc[]'
class VulkanSCConventions(VulkanConventions):
def specURL(self, spectype='api'):
"""Return public registry URL which ref pages should link to for the
current all-extensions HTML specification, so xrefs in the
asciidoc source that are not to ref pages can link into it
instead. N.b. this may need to change on a per-refpage basis if
there are multiple documents involved.
"""
return 'https://registry.khronos.org/vulkansc/specs/1.0-extensions/html/vkspec.html'
@property
def xml_api_name(self):
"""Return the name used in the default API XML registry for the default API"""
return 'vulkansc'

438
registry/vulkan_object.py Normal file
View file

@ -0,0 +1,438 @@
#!/usr/bin/env python3 -i
#
# Copyright 2023-2025 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
from dataclasses import dataclass, field
from enum import IntFlag, Enum, auto
@dataclass
class Extension:
"""<extension>"""
name: str # ex) VK_KHR_SURFACE
nameString: str # marco with string, ex) VK_KHR_SURFACE_EXTENSION_NAME
specVersion: str # marco with string, ex) VK_KHR_SURFACE_SPEC_VERSION
# Only one will be True, the other is False
instance: bool
device: bool
depends: (str | None)
vendorTag: (str | None) # ex) EXT, KHR, etc
platform: (str | None) # ex) android
protect: (str | None) # ex) VK_USE_PLATFORM_ANDROID_KHR
provisional: bool
promotedTo: (str | None) # ex) VK_VERSION_1_1
deprecatedBy: (str | None)
obsoletedBy: (str | None)
specialUse: list[str]
# These are here to allow for easy reverse lookups
# Quotes allow us to forward declare the dataclass
commands: list['Command'] = field(default_factory=list, init=False)
enums: list['Enum'] = field(default_factory=list, init=False)
bitmasks: list['Bitmask'] = field(default_factory=list, init=False)
# Use the Enum name to see what fields are extended
enumFields: dict[str, list['EnumField']] = field(default_factory=dict, init=False)
# Use the Bitmaks name to see what flags are extended
flags: dict[str, list['Flag']] = field(default_factory=dict, init=False)
@dataclass
class Version:
"""
<feature> which represents a version
This will NEVER be Version 1.0, since having 'no version' is same as being 1.0
"""
name: str # ex) VK_VERSION_1_1
nameString: str # ex) "VK_VERSION_1_1" (no marco, so has quotes)
nameApi: str # ex) VK_API_VERSION_1_1
@dataclass
class Handle:
"""<type> which represents a dispatch handle"""
name: str # ex) VkBuffer
aliases: list[str] # ex) ['VkSamplerYcbcrConversionKHR']
type: str # ex) VK_OBJECT_TYPE_BUFFER
protect: (str | None) # ex) VK_USE_PLATFORM_ANDROID_KHR
parent: 'Handle' # Chain of parent handles, can be None
# Only one will be True, the other is False
instance: bool
device: bool
dispatchable: bool
def __lt__(self, other):
return self.name < other.name
@dataclass
class Param:
"""<command/param>"""
name: str # ex) pCreateInfo, pAllocator, pBuffer
alias: str
# the "base type" - will not preserve the 'const' or pointer info
# ex) void, uint32_t, VkFormat, VkBuffer, etc
type: str
# the "full type" - will be cDeclaration without the type name
# ex) const void*, uint32_t, const VkFormat, VkBuffer*, etc
# For arrays, this will only display the type, fixedSizeArray can be used to get the length
fullType: str
noAutoValidity: bool
const: bool # type contains 'const'
length: (str | None) # the known length of pointer, will never be 'null-terminated'
nullTerminated: bool # If a UTF-8 string, it will be null-terminated
pointer: bool # type contains a pointer (include 'PFN' function pointers)
# Used to list how large an array of the type is
# ex) lineWidthRange is ['2']
# ex) memoryTypes is ['VK_MAX_MEMORY_TYPES']
# ex) VkTransformMatrixKHR:matrix is ['3', '4']
fixedSizeArray: list[str]
optional: bool
optionalPointer: bool # if type contains a pointer, is the pointer value optional
externSync: bool
externSyncPointer: list[str] # if type contains a pointer, might only specific members modified
# C string of member, example:
# - const void* pNext
# - VkFormat format
# - VkStructureType sType
cDeclaration: str
def __lt__(self, other):
return self.name < other.name
class Queues(IntFlag):
TRANSFER = auto() # VK_QUEUE_TRANSFER_BIT
GRAPHICS = auto() # VK_QUEUE_GRAPHICS_BIT
COMPUTE = auto() # VK_QUEUE_COMPUTE_BIT
PROTECTED = auto() # VK_QUEUE_PROTECTED_BIT
SPARSE_BINDING = auto() # VK_QUEUE_SPARSE_BINDING_BIT
OPTICAL_FLOW = auto() # VK_QUEUE_OPTICAL_FLOW_BIT_NV
DECODE = auto() # VK_QUEUE_VIDEO_DECODE_BIT_KHR
ENCODE = auto() # VK_QUEUE_VIDEO_ENCODE_BIT_KHR
ALL = TRANSFER | GRAPHICS | COMPUTE | PROTECTED | SPARSE_BINDING | OPTICAL_FLOW | DECODE | ENCODE
class CommandScope(Enum):
NONE = auto()
INSIDE = auto()
OUTSIDE = auto()
BOTH = auto()
@dataclass
class Command:
"""<command>"""
name: str # ex) vkCmdDraw
alias: (str | None) # Because commands are interfaces into layers/drivers, we need all command alias
protect: (str | None) # ex) 'VK_ENABLE_BETA_EXTENSIONS'
extensions: list[Extension] # All extensions that enable the struct
version: (Version | None) # None if Version 1.0
returnType: str # ex) void, VkResult, etc
params: list[Param] # Each parameter of the command
# Only one will be True, the other is False
instance: bool
device: bool
tasks: list[str] # ex) [ action, state, synchronization ]
queues: Queues # zero == No Queues found
successCodes: list[str] # ex) [ VK_SUCCESS, VK_INCOMPLETE ]
errorCodes: list[str] # ex) [ VK_ERROR_OUT_OF_HOST_MEMORY ]
# Shows support if command can be in a primary and/or secondary command buffer
primary: bool
secondary: bool
renderPass: CommandScope
videoCoding: CommandScope
implicitExternSyncParams: list[str]
# C prototype string - ex:
# VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(
# const VkInstanceCreateInfo* pCreateInfo,
# const VkAllocationCallbacks* pAllocator,
# VkInstance* pInstance);
cPrototype: str
# function pointer typedef - ex:
# typedef VkResult (VKAPI_PTR *PFN_vkCreateInstance)
# (const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance);
cFunctionPointer: str
def __lt__(self, other):
return self.name < other.name
@dataclass
class Member:
"""<member>"""
name: str # ex) sType, pNext, flags, size, usage
# the "base type" - will not preserve the 'const' or pointer info
# ex) void, uint32_t, VkFormat, VkBuffer, etc
type: str
# the "full type" - will be cDeclaration without the type name
# ex) const void*, uint32_t, const VkFormat, VkBuffer*, etc
# For arrays, this will only display the type, fixedSizeArray can be used to get the length
fullType: str
noAutoValidity: bool
limitType: (str | None) # ex) 'max', 'bitmask', 'bits', 'min,mul'
const: bool # type contains 'const'
length: (str | None) # the known length of pointer, will never be 'null-terminated'
nullTerminated: bool # If a UTF-8 string, it will be null-terminated
pointer: bool # type contains a pointer (include 'PFN' function pointers)
# Used to list how large an array of the type is
# ex) lineWidthRange is ['2']
# ex) memoryTypes is ['VK_MAX_MEMORY_TYPES']
# ex) VkTransformMatrixKHR:matrix is ['3', '4']
fixedSizeArray: list[str]
optional: bool
optionalPointer: bool # if type contains a pointer, is the pointer value optional
externSync: bool
# C string of member, example:
# - const void* pNext
# - VkFormat format
# - VkStructureType sType
cDeclaration: str
def __lt__(self, other):
return self.name < other.name
@dataclass
class Struct:
"""<type category="struct"> or <type category="union">"""
name: str # ex) VkImageSubresource2
aliases: list[str] # ex) ['VkImageSubresource2KHR', 'VkImageSubresource2EXT']
extensions: list[Extension] # All extensions that enable the struct
version: (Version | None) # None if Version 1.0
protect: (str | None) # ex) VK_ENABLE_BETA_EXTENSIONS
members: list[Member]
union: bool # Unions are just a subset of a Structs
returnedOnly: bool
sType: (str | None) # ex) VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
allowDuplicate: bool # can have a pNext point to itself
# These use to be list['Struct'] but some circular loops occur and cause
# pydevd warnings and made debugging slow (30 seconds to index a Struct)
extends: list[str] # Struct names that this struct extends
extendedBy: list[str] # Struct names that can be extended by this struct
def __lt__(self, other):
return self.name < other.name
@dataclass
class EnumField:
"""<enum> of type enum"""
name: str # ex) VK_DYNAMIC_STATE_SCISSOR
protect: (str | None) # ex) VK_ENABLE_BETA_EXTENSIONS
negative: bool # True if negative values are allowed (ex. VkResult)
value: int
valueStr: str # value as shown in spec (ex. "0", "2", "1000267000", "0x00000004")
# some fields are enabled from 2 extensions (ex) VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR)
extensions: list[Extension] # None if part of 1.0 core
def __lt__(self, other):
return self.name < other.name
@dataclass
class Enum:
"""<enums> of type enum"""
name: str # ex) VkLineRasterizationMode
aliases: list[str] # ex) ['VkLineRasterizationModeKHR', 'VkLineRasterizationModeEXT']
protect: (str | None) # ex) VK_ENABLE_BETA_EXTENSIONS
bitWidth: int # 32 or 64 (currently all are 32, but field is to match with Bitmask)
returnedOnly: bool
fields: list[EnumField]
extensions: list[Extension] # None if part of 1.0 core
# Unique list of all extension that are involved in 'fields' (superset of 'extensions')
fieldExtensions: list[Extension]
def __lt__(self, other):
return self.name < other.name
@dataclass
class Flag:
"""<enum> of type bitmask"""
name: str # ex) VK_ACCESS_2_SHADER_READ_BIT
protect: (str | None) # ex) VK_ENABLE_BETA_EXTENSIONS
value: int
valueStr: str # value as shown in spec (ex. 0x00000000", "0x00000004", "0x0000000F", "0x800000000ULL")
multiBit: bool # if true, more than one bit is set (ex) VK_SHADER_STAGE_ALL_GRAPHICS)
zero: bool # if true, the value is zero (ex) VK_PIPELINE_STAGE_NONE)
# some fields are enabled from 2 extensions (ex) VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT)
extensions: list[Extension] # None if part of 1.0 core
def __lt__(self, other):
return self.name < other.name
@dataclass
class Bitmask:
"""<enums> of type bitmask"""
name: str # ex) VkAccessFlagBits2
aliases: list[str] # ex) ['VkAccessFlagBits2KHR']
flagName: str # ex) VkAccessFlags2
protect: (str | None) # ex) VK_ENABLE_BETA_EXTENSIONS
bitWidth: int # 32 or 64
returnedOnly: bool
flags: list[Flag]
extensions: list[Extension] # None if part of 1.0 core
# Unique list of all extension that are involved in 'flag' (superset of 'extensions')
flagExtensions: list[Extension]
def __lt__(self, other):
return self.name < other.name
@dataclass
class FormatComponent:
"""<format/component>"""
type: str # ex) R, G, B, A, D, S, etc
bits: str # will be an INT or 'compressed'
numericFormat: str # ex) UNORM, SINT, etc
planeIndex: (int | None) # None if no planeIndex in format
@dataclass
class FormatPlane:
"""<format/plane>"""
index: int
widthDivisor: int
heightDivisor: int
compatible: str
@dataclass
class Format:
"""<format>"""
name: str
className: str
blockSize: int
texelsPerBlock: int
blockExtent: list[str]
packed: (int | None) # None == not-packed
chroma: (str | None)
compressed: (str | None)
components: list[FormatComponent] # <format/component>
planes: list[FormatPlane] # <format/plane>
spirvImageFormat: (str | None)
@dataclass
class SyncSupport:
"""<syncsupport>"""
queues: Queues
stages: list[Flag] # VkPipelineStageFlagBits2
max: bool # If this supports max values
@dataclass
class SyncEquivalent:
"""<syncequivalent>"""
stages: list[Flag] # VkPipelineStageFlagBits2
accesses: list[Flag] # VkAccessFlagBits2
max: bool # If this equivalent to everything
@dataclass
class SyncStage:
"""<syncstage>"""
flag: Flag # VkPipelineStageFlagBits2
support: SyncSupport
equivalent: SyncEquivalent
@dataclass
class SyncAccess:
"""<syncaccess>"""
flag: Flag # VkAccessFlagBits2
support: SyncSupport
equivalent: SyncEquivalent
@dataclass
class SyncPipelineStage:
"""<syncpipelinestage>"""
order: (str | None)
before: (str | None)
after: (str | None)
value: str
@dataclass
class SyncPipeline:
"""<syncpipeline>"""
name: str
depends: list[str]
stages: list[SyncPipelineStage]
@dataclass
class SpirvEnables:
"""What is needed to enable the SPIR-V element"""
version: (str | None)
extension: (str | None)
struct: (str | None)
feature: (str | None)
requires: (str | None)
property: (str | None)
member: (str | None)
value: (str | None)
@dataclass
class Spirv:
"""<spirvextension> and <spirvcapability>"""
name: str
# Only one will be True, the other is False
extension: bool
capability: bool
enable: list[SpirvEnables]
# This is the global Vulkan Object that holds all the information from parsing the XML
# This class is designed so all generator scripts can use this to obtain data
@dataclass
class VulkanObject():
headerVersion: int = 0 # value of VK_HEADER_VERSION
extensions: dict[str, Extension] = field(default_factory=dict, init=False)
versions: dict[str, Version] = field(default_factory=dict, init=False)
handles: dict[str, Handle] = field(default_factory=dict, init=False)
commands: dict[str, Command] = field(default_factory=dict, init=False)
structs: dict[str, Struct] = field(default_factory=dict, init=False)
enums: dict[str, Enum] = field(default_factory=dict, init=False)
bitmasks: dict[str, Bitmask] = field(default_factory=dict, init=False)
formats: dict[str, Format] = field(default_factory=dict, init=False)
syncStage: list[SyncStage] = field(default_factory=list, init=False)
syncAccess: list[SyncAccess] = field(default_factory=list, init=False)
syncPipeline: list[SyncPipeline] = field(default_factory=list, init=False)
spirv: list[Spirv] = field(default_factory=list, init=False)
# ex) [ xlib : VK_USE_PLATFORM_XLIB_KHR ]
platforms: dict[str, str] = field(default_factory=dict, init=False)
# list of all vendor Suffix names (KHR, EXT, etc. )
vendorTags: list[str] = field(default_factory=list, init=False)
# ex) [ Queues.COMPUTE : VK_QUEUE_COMPUTE_BIT ]
queueBits: dict[IntFlag, str] = field(default_factory=dict, init=False)

View file

@ -1,46 +1,33 @@
# ~~~
# Copyright (c) 2022-2023 LunarG, Inc.
# Copyright 2022-2023 The Khronos Group Inc.
# Copyright 2022-2023 Valve Corporation
# Copyright 2022-2023 LunarG, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0
# ~~~
# Test the non-API headers provided by this repo
# NOTE: For us testing just means that these header files compile
# with reasonable warnings.
# Test add_subdirectory suppport
add_test(NAME integration.add_subdirectory
COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test ${CMAKE_CURRENT_LIST_DIR}/integration
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory
--build-generator ${CMAKE_GENERATOR}
--build-options -DFIND_PACKAGE_TESTING=OFF -DVULKAN_HEADERS_ENABLE_MODULE=${VULKAN_HEADERS_ENABLE_MODULE}
)
message(STATUS "${PROJECT_NAME} = ${PROJECT_VERSION}")
set(test_install_dir "${CMAKE_CURRENT_BINARY_DIR}/install")
add_test(NAME integration.install
COMMAND ${CMAKE_COMMAND} --install ${VULKAN_HEADERS_BINARY_DIR} --prefix ${test_install_dir} --config $<CONFIG>
)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
# Test find_package suppport
add_test(NAME integration.find_package
COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test ${CMAKE_CURRENT_LIST_DIR}/integration
${CMAKE_CURRENT_BINARY_DIR}/find_package
--build-generator ${CMAKE_GENERATOR}
--build-options -DFIND_PACKAGE_TESTING=ON -DCMAKE_PREFIX_PATH=${test_install_dir}
)
if(${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
add_compile_options(
-Wpedantic
-Wall
-Wextra
-Werror
)
endif()
# vk_icd.h
add_executable(vk_icd vk_icd.c)
target_link_libraries(vk_icd PRIVATE Vulkan::Headers)
# vk_layer.h
add_library(vk_layer MODULE vk_layer.c)
target_link_libraries(vk_layer PRIVATE Vulkan::Headers)
if (NOT TARGET Vulkan-Headers)
message(FATAL_ERROR "Backcompat for Vulkan-Headers target broken!")
endif()
# Installing comes before testing
set_tests_properties(integration.find_package PROPERTIES DEPENDS integration.install)

View file

@ -1,32 +0,0 @@
cmake_minimum_required(VERSION 3.14.2)
project(TEST_VULKAN_HEADERS_FIND_PACKAGE_SUPPORT LANGUAGES C)
find_package(VulkanHeaders REQUIRED CONFIG)
if (NOT TARGET Vulkan::Headers)
message(FATAL_ERROR "Vulkan::Headers target not defined")
endif()
if (NOT DEFINED VULKAN_HEADERS_REGISTRY_DIRECTORY)
message(FATAL_ERROR "VULKAN_HEADERS_REGISTRY_DIRECTORY not defined!")
endif()
if (NOT EXISTS "${VULKAN_HEADERS_REGISTRY_DIRECTORY}/vk.xml")
message(FATAL_ERROR "VULKAN_HEADERS_REGISTRY_DIRECTORY not valid!")
endif()
message(STATUS "VULKAN_HEADERS_REGISTRY_DIRECTORY = ${VULKAN_HEADERS_REGISTRY_DIRECTORY}")
if (NOT DEFINED VulkanHeaders_VERSION)
message(FATAL_ERROR "VulkanHeaders_VERSION not defined!")
endif()
message(STATUS "VulkanHeaders_VERSION = ${VulkanHeaders_VERSION}")
add_library(foobar STATIC)
target_link_libraries(foobar PRIVATE Vulkan::Headers)
target_sources(foobar PRIVATE
../vk_icd.c
../vk_layer.c
)

View file

@ -0,0 +1,91 @@
# ~~~
# Copyright 2022-2023 The Khronos Group Inc.
# Copyright 2022-2023 Valve Corporation
# Copyright 2022-2023 LunarG, Inc.
#
# SPDX-License-Identifier: Apache-2.0
# ~~~
cmake_minimum_required(VERSION 3.22.1)
project(API LANGUAGES C CXX)
if (FIND_PACKAGE_TESTING)
find_package(VulkanHeaders REQUIRED CONFIG)
else()
add_subdirectory(../../ ${CMAKE_CURRENT_BINARY_DIR}/headers)
endif()
if (NOT TARGET Vulkan::Headers)
message(FATAL_ERROR "Vulkan::Headers target not defined")
endif()
if (NOT TARGET Vulkan::HppModule AND VULKAN_HEADERS_ENABLE_MODULE)
message(FATAL_ERROR "Vulkan::HppModule target not defined")
endif()
if (FIND_PACKAGE_TESTING)
if (NOT DEFINED VulkanHeaders_VERSION)
message(FATAL_ERROR "VulkanHeaders_VERSION not defined!")
endif()
message(STATUS "VulkanHeaders_VERSION = ${VulkanHeaders_VERSION}")
endif()
if (NOT FIND_PACKAGE_TESTING)
# Consuming vulkan-headers via add_subdirectory should NOT add installation code to the parent CMake project.
if (DEFINED CMAKE_INSTALL_INCLUDEDIR)
message(FATAL_ERROR "CMAKE_INSTALL_INCLUDEDIR was defined!")
endif()
# NOTE: Some users may not be using the namespace target.
# Don't accidentally break them unless we have to.
if (NOT TARGET Vulkan-Headers)
message(FATAL_ERROR "Backcompat for Vulkan-Headers target broken!")
endif()
if (NOT TARGET Vulkan-HppModule AND VULKAN_HEADERS_ENABLE_MODULE)
message(FATAL_ERROR "Backcompat for Vulkan-HppModule target broken!")
endif()
endif()
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
if(${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
add_compile_options(
-Wpedantic
-Wall
-Wextra
-Werror
)
endif()
if (MSVC)
add_compile_options(
/W4
/permissive-
/WX
)
endif()
# Test the non-API headers provided by this repo
# NOTE: For us testing just means that these header files compile
# with reasonable warnings.
# vk_icd.h
add_library(vk_icd MODULE ../vk_icd.c)
target_link_libraries(vk_icd PRIVATE Vulkan::Headers)
# vk_layer.h
add_library(vk_layer MODULE ../vk_layer.c)
target_link_libraries(vk_layer PRIVATE Vulkan::Headers)
# vulkan.hpp
add_library(vk_hpp MODULE ../vk_hpp.cpp)
target_compile_features(vk_hpp PUBLIC cxx_std_11)
target_link_libraries(vk_hpp PRIVATE Vulkan::Headers)
# vulkan.cppm
if (VULKAN_HEADERS_ENABLE_MODULE)
add_library(vk_hpp_module MODULE ../vk_hpp_module.cpp)
set_target_properties(vk_hpp_module PROPERTIES CXX_SCAN_FOR_MODULES ON)
target_link_libraries(vk_hpp_module PRIVATE Vulkan::HppModule)
endif()

13
tests/vk_hpp.cpp Normal file
View file

@ -0,0 +1,13 @@
/*
* Copyright 2025 The Khronos Group Inc.
* Copyright 2025 Valve Corporation
* Copyright 2025 LunarG, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <vulkan/vulkan.hpp>
int header_version()
{
return VK_HEADER_VERSION;
}

13
tests/vk_hpp_module.cpp Normal file
View file

@ -0,0 +1,13 @@
/*
* Copyright 2025 The Khronos Group Inc.
* Copyright 2025 Valve Corporation
* Copyright 2025 LunarG, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
import vulkan_hpp;
int test_version()
{
return static_cast<int>(vk::makeApiVersion(1, 0, 0, 0));
}

View file

@ -1,6 +1,14 @@
/*
* Copyright 2022-2023 The Khronos Group Inc.
* Copyright 2022-2023 Valve Corporation
* Copyright 2022-2023 LunarG, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "vulkan/vk_icd.h"
int main()
int square(int i)
{
return 0;
return i * i;
}

View file

@ -1,6 +1,14 @@
/*
* Copyright 2022-2023 The Khronos Group Inc.
* Copyright 2022-2023 Valve Corporation
* Copyright 2022-2023 LunarG, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "vulkan/vk_layer.h"
int foobar()
int square(int i)
{
return 0;
return i * i;
}