update vulkan headers v1.3.275

Signed-off-by: andrew0229 <zhangzhao62@huawei.com>
Change-Id: Iea9dae9f174999d70e16290430669ed16181a54d
This commit is contained in:
andrew0229 2024-05-09 08:32:02 +00:00
parent 3d40582d77
commit 35e74be546
81 changed files with 118071 additions and 59314 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

@ -11,12 +11,18 @@ assignees: ''
Vulkan-Headers exists as a publishing mechanism for headers and related material sourced from multiple other repositories. If you have a problem with that material, it should *not* be reported here, but in the appropriate repository:
- https://github.com/KhronosGroup/Vulkan-Docs - C headers, XML, validusage.json, and generation scripts
- https://github.com/KhronosGroup/Vulkan-Hpp - C++ headers
- This repository - Repository structure, management, and build system *only*
See the repository README for more details.
This repository is responsible for the following files
* BUILD.gn
* BUILD.md
* CMakeLists.txt
* tests/*
* CODE_OF_CONDUCT.md
* LICENSE.txt
* README.md
* Non-API headers
* include/vulkan/vk_icd.h
* include/vulkan/vk_layer.h
**Describe the bug**
@ -30,3 +36,17 @@ If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.
**Code**
<details>
<summary>code or terminal output</summary>
```cpp
int main()
{
return 0;
}
```
</details>

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

18
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,18 @@
<!-- Please note when contributing what files this repository actually is responsible for.
Vulkan-Headers exists as a publishing mechanism for headers and related material sourced from multiple other repositories. If you have a problem with that material, it should *not* be reported here, but in the appropriate repository:
This repository is responsible for the following files
* BUILD.gn
* BUILD.md
* CMakeLists.txt
* tests/*
* CODE_OF_CONDUCT.md
* LICENSE.txt
* README.md
* Non-API headers
* include/vulkan/vk_icd.h
* include/vulkan/vk_layer.h
-->

41
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,41 @@
# Copyright 2022-2023 LunarG, Inc.
#
# SPDX-License-Identifier: Apache-2.0
name: ci
on:
push:
pull_request:
branches:
- main
env:
CMAKE_GENERATOR: Ninja
permissions:
contents: read
jobs:
cmake:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
cmake-version: [ '3.15', '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 BUILD_TESTS=ON -G Ninja
- run: ctest --output-on-failure
working-directory: build
reuse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v2

8
.gitignore 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
# ~~~
# Python cache
__pycache__
*.pyc

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_2022.json
Copyright: 2022-2023 The Khronos Group Inc.
License: Apache-2.0
Files: registry/validusage.json
Copyright: 2018-2023 The Khronos Group Inc.
License: Apache-2.0
Files: .github/ISSUE_TEMPLATE/bug_report.md .github/pull_request_template.md
Copyright: 2022-2023 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/ohos.gni")
@ -19,8 +9,8 @@ is_ohos = current_os == "ohos"
is_android = current_os == "android"
is_mac = current_os == "ios" || current_os == "tvos" || current_os == "mac"
is_win = current_os == "win" || current_os == "mingw"
is_linux = current_os == "linux"
is_fuchsia = current_os == "fuchsia"
is_apple = current_os == "apple"
config("vulkan_headers_config") {
include_dirs = [ "include" ]
@ -33,10 +23,8 @@ config("vulkan_headers_config") {
if (is_win) {
defines += [ "VK_USE_PLATFORM_WIN32_KHR" ]
}
if (is_linux) {
if (defined(vulkan_use_x11) && vulkan_use_x11) {
defines += [ "VK_USE_PLATFORM_XCB_KHR" ]
}
if (defined(vulkan_use_x11) && vulkan_use_x11) {
defines += [ "VK_USE_PLATFORM_XCB_KHR" ]
}
if (defined(vulkan_use_wayland) && vulkan_use_wayland) {
defines += [ "VK_USE_PLATFORM_WAYLAND_KHR" ]
@ -50,9 +38,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" ]
}
@ -78,8 +72,9 @@ ohos_static_library("vulkan_headers") {
"include/vulkan/vulkan.hpp",
"include/vulkan/vulkan_core.h",
"include/vulkan/vulkan_ohos.h",
"include/vulkan/vulkan_screen.h",
]
public_configs = [ ":vulkan_headers_config" ]
license_file = "//third_party/vulkan-headers/LICENSE.txt"
license_file = "//third_party/vulkan-headers/LICENSES/Apache-2.0.txt"
}

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)
# 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})
@ -55,40 +50,24 @@ endif()
if (PROJECT_IS_TOP_LEVEL)
option(BUILD_TESTS "Build the tests")
if (BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
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 VulkanHeadersTargets INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS Vulkan-Headers EXPORT VulkanHeadersConfig 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

202
LICENSES/Apache-2.0.txt Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.

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.

View File

@ -3,7 +3,7 @@
"Name": "Vulkan",
"License": "Apache-2.0",
"License File": "LICENSE.txt",
"Version Number": "sdk-1.3.250.1",
"Version Number": "v1.3.275",
"Owner": "mengzhaobing@huawei.com",
"Upstream URL": "https://github.com/KhronosGroup/Vulkan-Headers.git",
"Description": "Vulkan header files and API registry"

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

@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H264STD_H_ 1
/*
** Copyright 2015-2023 The Khronos Group Inc.
** Copyright 2015-2024 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-2024 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-2024 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-2024 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-2024 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-2024 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-2024 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-2024 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

4741
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-2024 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-2024 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-2024 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,122 @@ 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 1
#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;
} 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;
} VkPhysicalDeviceShaderEnqueuePropertiesAMDX;
typedef void (VKAPI_PTR *PFN_vkCmdEncodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR* pEncodeInfo);
typedef struct VkExecutionGraphPipelineScratchSizeAMDX {
VkStructureType sType;
void* pNext;
VkDeviceSize size;
} 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, VkDeviceAddress scratch);
typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, const VkDispatchGraphCountInfoAMDX* pCountInfo);
typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, const VkDispatchGraphCountInfoAMDX* pCountInfo);
typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectCountAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, 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);
VkDeviceAddress scratch);
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphAMDX(
VkCommandBuffer commandBuffer,
VkDeviceAddress scratch,
const VkDispatchGraphCountInfoAMDX* pCountInfo);
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectAMDX(
VkCommandBuffer commandBuffer,
VkDeviceAddress scratch,
const VkDispatchGraphCountInfoAMDX* pCountInfo);
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectCountAMDX(
VkCommandBuffer commandBuffer,
VkDeviceAddress scratch,
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-2024 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-2024 The Khronos Group Inc.
//
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
@ -12,6 +12,7 @@
namespace VULKAN_HPP_NAMESPACE
{
//=====================
//=== Format Traits ===
//=====================
@ -362,6 +363,8 @@ namespace VULKAN_HPP_NAMESPACE
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::eA1B5G5R5UnormPack16KHR: return 2;
case VULKAN_HPP_NAMESPACE::Format::eA8UnormKHR: return 1;
default: VULKAN_HPP_ASSERT( false ); return 0;
}
@ -619,6 +622,8 @@ namespace VULKAN_HPP_NAMESPACE
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::eA1B5G5R5UnormPack16KHR: return "16-bit";
case VULKAN_HPP_NAMESPACE::Format::eA8UnormKHR: return "8-bit alpha";
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:
@ -2007,6 +2012,21 @@ namespace VULKAN_HPP_NAMESPACE
case 1: return 16;
default: VULKAN_HPP_ASSERT( false ); return 0;
}
case VULKAN_HPP_NAMESPACE::Format::eA1B5G5R5UnormPack16KHR:
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::eA8UnormKHR:
switch ( component )
{
case 0: return 8;
default: VULKAN_HPP_ASSERT( false ); return 0;
}
default: return 0;
}
@ -2264,6 +2284,8 @@ namespace VULKAN_HPP_NAMESPACE
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::eA1B5G5R5UnormPack16KHR: return 4;
case VULKAN_HPP_NAMESPACE::Format::eA8UnormKHR: return 1;
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:
@ -4284,6 +4306,21 @@ namespace VULKAN_HPP_NAMESPACE
case 1: return "G";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eA1B5G5R5UnormPack16KHR:
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::eA8UnormKHR:
switch ( component )
{
case 0: return "A";
default: VULKAN_HPP_ASSERT( false ); return "";
}
default: return "";
}
@ -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:
@ -6304,6 +6341,21 @@ namespace VULKAN_HPP_NAMESPACE
case 1: return "SINT";
default: VULKAN_HPP_ASSERT( false ); return "";
}
case VULKAN_HPP_NAMESPACE::Format::eA1B5G5R5UnormPack16KHR:
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::eA8UnormKHR:
switch ( component )
{
case 0: return "UNORM";
default: VULKAN_HPP_ASSERT( false ); return "";
}
default: 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::eA1B5G5R5UnormPack16KHR: return 16;
default: return 0;
}
@ -7605,6 +7658,8 @@ namespace VULKAN_HPP_NAMESPACE
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::eA1B5G5R5UnormPack16KHR: return 1;
case VULKAN_HPP_NAMESPACE::Format::eA8UnormKHR: 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-2024 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-2024 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,297 @@
// Copyright 2015-2024 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 ( 201907 <= __cpp_lib_three_way_comparison ) && __has_include( <compare> ) && !defined( VULKAN_HPP_NO_SPACESHIP_OPERATOR )
# define VULKAN_HPP_HAS_SPACESHIP_OPERATOR
#endif
#if ( 201803 <= __cpp_lib_span )
# define VULKAN_HPP_SUPPORT_SPAN
#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
#if ( VK_USE_64_BIT_PTR_DEFINES == 1 )
# if !defined( VULKAN_HPP_TYPESAFE_CONVERSION )
# define VULKAN_HPP_TYPESAFE_CONVERSION
# 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 defined( VULKAN_HPP_TYPESAFE_CONVERSION )
# 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 ) && !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
{
class DispatchLoaderDynamic;
} // 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::defaultDispatchLoaderDynamic
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \
namespace VULKAN_HPP_NAMESPACE \
{ \
VULKAN_HPP_STORAGE_API ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
}
namespace VULKAN_HPP_NAMESPACE
{
extern VULKAN_HPP_STORAGE_API VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic defaultDispatchLoaderDynamic;
} // namespace VULKAN_HPP_NAMESPACE
# else
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::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::DispatchLoaderDynamic
# else
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::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 )
# include <expected>
# 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-2024 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-2024 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-2024 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,6 +48,7 @@ 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;

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-2024 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-2024 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-2024 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-2024 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-2024 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-2024 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-2024 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
#
# Copyright 2021-2023 The Khronos Group Inc.
# Copyright 2021-2024 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

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#
# Copyright 2013-2023 The Khronos Group Inc.
# Copyright 2013-2024 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
@ -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]

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#
# Copyright 2013-2023 The Khronos Group Inc.
# Copyright 2013-2024 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
@ -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."""
@ -1021,6 +1029,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.

View File

@ -1,852 +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 ],
[ 'vulkan_ohos.h', [ 'VK_OHOS_surface',
'VK_OHOS_external_memory',
'VK_OHOS_native_buffer'
], commonSuppressExtensions +
[ 'VK_KHR_format_feature_flags2',
] ],
]
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
# Copyright 2022-2023 The Khronos Group Inc.
# Copyright 2022-2024 The Khronos Group Inc.
# Copyright 2003-2019 Paul McGuire
# SPDX-License-Identifier: MIT
@ -52,23 +52,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 a operator as an asciidoc spec markup equivalent
- op - operator ('+' or ',')"""
return opMarkupAsciidocMap[op]
opMarkupCMap = { '+' : '&&', ',' : '||' }
def opMarkupC(op):
"""Markup a operator as an C language equivalent
- op - operator ('+' or ',')"""
return opMarkupCMap[op]
# Unfortunately global to be used in pyparsing
exprStack = []
def push_first(toks):
@ -121,12 +152,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 +186,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
@ -253,9 +302,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 = str + f'{prefix}{opMarkupAsciidoc(elem)} +\n'
else:
str = str + f'{prefix}{nameMarkup(elem)} +\n'
str = str + f'{prefix}{leafMarkupAsciidoc(elem)} +\n'
return str
@ -270,6 +319,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 +341,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 +385,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

@ -202,83 +202,6 @@
}
}
},
"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
@ -288,17 +211,6 @@
"descriptorBindingInlineUniformBlockUpdateAfterBind": true
}
}
},
"vulkan13requirements_roadmap2022_1_2": {
"extensions": {
"VK_EXT_global_priority": 1,
"VK_EXT_inline_uniform_block": 1
},
"features": {
"VkPhysicalDeviceInlineUniformBlockFeaturesEXT": {
"descriptorBindingInlineUniformBlockUpdateAfterBind": true
}
}
}
},
"profiles": {
@ -320,6 +232,12 @@
}
},
"history": [
{
"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
#
# Copyright 2013-2023 The Khronos Group Inc.
# Copyright 2013-2024 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
@ -376,6 +376,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."""
@ -432,6 +454,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 +508,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."""
@ -683,6 +714,9 @@ class Registry:
enumInfo = EnumInfo(enum)
self.addElementInfo(enum, enumInfo, 'enum', self.enumdict)
sync_pipeline_stage_condition = dict()
sync_access_condition = dict()
self.extensions = self.reg.findall('extensions/extension')
self.extdict = {}
for feature in self.extensions:
@ -730,6 +764,25 @@ class Registry:
format_condition[format_name] += "," + 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] += "," + 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] += "," + 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"',
@ -756,6 +809,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.
@ -974,6 +1047,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)
@ -1167,15 +1241,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 +1434,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 +1484,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 +1521,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 +1721,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 +1757,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
#
# Copyright 2013-2023 The Khronos Group Inc.
# Copyright 2013-2024 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."""
@ -80,10 +80,39 @@ class ConventionsBase(abc.ABC):
self._command_prefix = None
self._type_prefix = None
def formatExtension(self, name):
"""Mark up an extension name as a link the spec."""
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 '`<<{}>>`'.format(name)
def formatExtension(self, name):
"""Mark up an extension name as a link in the spec."""
return '`<<{}>>`'.format(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
def null(self):
@ -260,6 +289,42 @@ 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
@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.
@ -375,6 +440,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
@ -452,3 +527,10 @@ 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++'

View File

@ -1,7 +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-2024 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<registry>
<comment>
Copyright 2021-2023 The Khronos Group Inc.
Copyright 2021-2024 The Khronos Group Inc.
SPDX-License-Identifier: Apache-2.0 OR MIT
</comment>
@ -16,13 +16,19 @@ The current public version of video.xml is maintained in the default branch
<types comment="Video type definitions">
<!-- base types -->
<type name="stdint" category="include">#include &lt;stdint.h&gt;</type>
<type name="stdint" category="include">#if !defined(VK_NO_STDINT_H)
#include &lt;stdint.h&gt;
#endif</type>
<type name="uint32_t" requires="stdint"/>
<type name="uint16_t" requires="stdint"/>
<type name="uint8_t" requires="stdint"/>
<type name="int32_t" requires="stdint"/>
<type name="int8_t" requires="stdint"/>
<type category="include" name="vk_video/vulkan_video_codecs_common.h">#include "vulkan_video_codecs_common.h"</type>
<type category="include" name="vk_video/vulkan_video_codec_h264std.h">#include "vulkan_video_codec_h264std.h"</type>
<type category="include" name="vk_video/vulkan_video_codec_h265std.h">#include "vulkan_video_codec_h265std.h"</type>
<!-- vulkan_video_codecs_common macros -->
<type category="define">#define <name>VK_MAKE_VIDEO_STD_VERSION</name>(major, minor, patch) \
((((uint32_t)(major)) &lt;&lt; 22) | (((uint32_t)(minor)) &lt;&lt; 12) | ((uint32_t)(patch)))</type>
@ -32,16 +38,16 @@ The current public version of video.xml is maintained in the default branch
#define <name>VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0</name> <type>VK_MAKE_VIDEO_STD_VERSION</type>(1, 0, 0)</type>
<!-- vulkan_video_codec_h264std_encode.h macros -->
<type category="define" requires="VK_MAKE_VIDEO_STD_VERSION">// Vulkan 0.9 provisional Vulkan video H.264 encode std specification version number
#define <name>VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_9</name> <type>VK_MAKE_VIDEO_STD_VERSION</type>(0, 9, 9)</type>
<type category="define" requires="VK_MAKE_VIDEO_STD_VERSION">
#define <name>VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_1_0_0</name> <type>VK_MAKE_VIDEO_STD_VERSION</type>(1, 0, 0)</type>
<!-- vulkan_video_codec_h265std_decode.h macros -->
<type category="define" requires="VK_MAKE_VIDEO_STD_VERSION">
#define <name>VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0</name> <type>VK_MAKE_VIDEO_STD_VERSION</type>(1, 0, 0)</type>
<!-- vulkan_video_codec_h265std_encode.h macros -->
<type category="define" requires="VK_MAKE_VIDEO_STD_VERSION">// Vulkan 0.9 provisional Vulkan video H.265 encode std specification version number
#define <name>VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_10</name> <type>VK_MAKE_VIDEO_STD_VERSION</type>(0, 9, 10)</type>
<type category="define" requires="VK_MAKE_VIDEO_STD_VERSION">
#define <name>VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_1_0_0</name> <type>VK_MAKE_VIDEO_STD_VERSION</type>(1, 0, 0)</type>
<!-- vulkan_video_codec_h264std.h enumerated types -->
<type name="StdVideoH264ChromaFormatIdc" category="enum"/>
@ -225,7 +231,7 @@ The current public version of video.xml is maintained in the default branch
<type category="struct" name="StdVideoDecodeH264ReferenceInfoFlags">
<member><type>uint32_t</type> <name>top_field_flag</name> : 1<comment>Reference is used for top field reference.</comment></member>
<member><type>uint32_t</type> <name>bottom_field_flag</name> : 1<comment>Reference is used for bottom field reference.</comment></member>
<member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>: A picture that is marked as "used for long-term reference", derived binary value from clause 8.2.5.1 Sequence of operations for decoded reference picture marking process</comment></member>
<member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>A picture that is marked as "used for long-term reference", derived binary value from clause 8.2.5.1 Sequence of operations for decoded reference picture marking process</comment></member>
<member><type>uint32_t</type> <name>is_non_existing</name> : 1<comment>Must be handled in accordance with 8.2.5.2: Decoding process for gaps in frame_num</comment></member>
</type>
<type category="struct" name="StdVideoDecodeH264ReferenceInfo">
@ -267,21 +273,24 @@ The current public version of video.xml is maintained in the default branch
<type category="struct" name="StdVideoEncodeH264SliceHeaderFlags">
<member><type>uint32_t</type> <name>direct_spatial_mv_pred_flag</name> : 1</member>
<member><type>uint32_t</type> <name>num_ref_idx_active_override_flag</name> : 1</member>
<member><type>uint32_t</type> <name>no_output_of_prior_pics_flag</name> : 1</member>
<member><type>uint32_t</type> <name>adaptive_ref_pic_marking_mode_flag</name> : 1</member>
<member><type>uint32_t</type> <name>no_prior_references_available_flag</name> : 1</member>
<member><type>uint32_t</type> <name>reserved</name> : 30</member>
</type>
<type category="struct" name="StdVideoEncodeH264PictureInfoFlags">
<member><type>uint32_t</type> <name>idr_flag</name> : 1</member>
<member><type>uint32_t</type> <name>is_reference_flag</name> : 1</member>
<member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>: A picture that is marked as "used for long-term reference", derived binary value from clause 8.2.5.1 Sequence of operations for decoded reference picture marking process</comment></member>
<member><type>uint32_t</type> <name>IdrPicFlag</name> : 1</member>
<member><type>uint32_t</type> <name>is_reference</name> : 1<comment>A reference picture, i.e. a picture with nal_ref_idc not equal to 0, as defined in clause 3.136</comment></member>
<member><type>uint32_t</type> <name>no_output_of_prior_pics_flag</name> : 1</member>
<member><type>uint32_t</type> <name>long_term_reference_flag</name> : 1</member>
<member><type>uint32_t</type> <name>adaptive_ref_pic_marking_mode_flag</name> : 1</member>
<member><type>uint32_t</type> <name>reserved</name> : 27</member>
</type>
<type category="struct" name="StdVideoEncodeH264ReferenceInfoFlags">
<member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>: A picture that is marked as "used for long-term reference", derived binary value from clause 8.2.5.1 Sequence of operations for decoded reference picture marking process</comment></member>
<member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>A picture that is marked as "used for long-term reference", derived binary value from clause 8.2.5.1 Sequence of operations for decoded reference picture marking process</comment></member>
<member><type>uint32_t</type> <name>reserved</name> : 31</member>
</type>
<type category="struct" name="StdVideoEncodeH264ReferenceListsInfoFlags">
<member><type>uint32_t</type> <name>ref_pic_list_modification_flag_l0</name> : 1</member>
<member><type>uint32_t</type> <name>ref_pic_list_modification_flag_l1</name> : 1</member>
<member><type>uint32_t</type> <name>reserved</name> : 30</member>
</type>
<type category="struct" name="StdVideoEncodeH264RefListModEntry">
<member><type>StdVideoH264ModificationOfPicNumsIdc</type> <name>modification_of_pic_nums_idc</name></member>
@ -289,7 +298,7 @@ The current public version of video.xml is maintained in the default branch
<member><type>uint16_t</type> <name>long_term_pic_num</name></member>
</type>
<type category="struct" name="StdVideoEncodeH264RefPicMarkingEntry">
<member><type>StdVideoH264MemMgmtControlOp</type> <name>operation</name></member>
<member><type>StdVideoH264MemMgmtControlOp</type> <name>memory_management_control_operation</name></member>
<member><type>uint16_t</type> <name>difference_of_pic_nums_minus1</name></member>
<member><type>uint16_t</type> <name>long_term_pic_num</name></member>
<member><type>uint16_t</type> <name>long_term_frame_idx</name></member>
@ -297,14 +306,14 @@ The current public version of video.xml is maintained in the default branch
</type>
<type category="struct" name="StdVideoEncodeH264ReferenceListsInfo">
<member><type>StdVideoEncodeH264ReferenceListsInfoFlags</type> <name>flags</name></member>
<member><type>uint8_t</type> <name>refPicList0EntryCount</name><comment>num_ref_idx_l0_active_minus1 plus one</comment></member>
<member><type>uint8_t</type> <name>refPicList1EntryCount</name><comment>num_ref_idx_l1_active_minus1 plus one</comment></member>
<member><type>uint8_t</type> <name>num_ref_idx_l0_active_minus1</name></member>
<member><type>uint8_t</type> <name>num_ref_idx_l1_active_minus1</name></member>
<member><type>uint8_t</type> <name>RefPicList0</name>[STD_VIDEO_H264_MAX_NUM_LIST_REF]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures or STD_VIDEO_H264_NO_REFERENCE_PICTURE</comment></member>
<member><type>uint8_t</type> <name>RefPicList1</name>[STD_VIDEO_H264_MAX_NUM_LIST_REF]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures or STD_VIDEO_H264_NO_REFERENCE_PICTURE</comment></member>
<member><type>uint8_t</type> <name>refList0ModOpCount</name></member>
<member><type>uint8_t</type> <name>refList1ModOpCount</name></member>
<member><type>uint8_t</type> <name>refPicMarkingOpCount</name></member>
<member><type>uint8_t</type> <name>reserved1</name>[7]<comment>Reserved for future use and must be initialized with 0.</comment></member>
<member>const <type>uint8_t</type>* <name>pRefPicList0Entries</name><comment>Must be a valid pointer to an array with size refPicList0EntryCount and contains the slotIndex values corresponding to the RefPicList0 as used in VkVideoReferenceSlotInfoKHR structures, 0xff for invalid slotIndex.</comment></member>
<member>const <type>uint8_t</type>* <name>pRefPicList1Entries</name><comment>Must be a valid pointer to an array with size refPicList1EntryCount and contains the slotIndex values corresponding to the RefPicList1 as used in VkVideoReferenceSlotInfoKHR structures, 0xff for invalid slotIndex.</comment></member>
<member>const <type>StdVideoEncodeH264RefListModEntry</type>* <name>pRefList0ModOperations</name><comment>Must be a valid pointer to an array with size refList0ModOpCount if ref_pic_list_modification_flag_l0 is set and contains the RefList0 modification parameters as defined in section 7.4.3.1</comment></member>
<member>const <type>StdVideoEncodeH264RefListModEntry</type>* <name>pRefList1ModOperations</name><comment>Must be a valid pointer to an array with size refList1ModOpCount if ref_pic_list_modification_flag_l1 is set and contains the RefList1 modification parameters as defined in section 7.4.3.1</comment></member>
<member>const <type>StdVideoEncodeH264RefPicMarkingEntry</type>* <name>pRefPicMarkingOperations</name><comment>Must be a valid pointer to an array with size refPicMarkingOpCount and contains the reference picture markings as defined in section 7.4.3.3</comment></member>
@ -313,32 +322,33 @@ The current public version of video.xml is maintained in the default branch
<member><type>StdVideoEncodeH264PictureInfoFlags</type> <name>flags</name></member>
<member><type>uint8_t</type> <name>seq_parameter_set_id</name><comment>Selecting SPS id from the Sequence Parameters Set</comment></member>
<member><type>uint8_t</type> <name>pic_parameter_set_id</name><comment>Selecting PPS from the Picture Parameters for all StdVideoEncodeH264SliceHeader(s)</comment></member>
<member><type>uint16_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
<member><type>StdVideoH264PictureType</type> <name>pictureType</name></member>
<member><type>uint16_t</type> <name>idr_pic_id</name></member>
<member><type>StdVideoH264PictureType</type> <name>primary_pic_type</name></member>
<member><type>uint32_t</type> <name>frame_num</name></member>
<member><type>int32_t</type> <name>PicOrderCnt</name></member>
<member><type>int32_t</type> <name>PicOrderCnt</name><comment>Picture order count, as defined in 8.2</comment></member>
<member><type>uint8_t</type> <name>temporal_id</name><comment>Temporal identifier of the picture, as defined in G.7.3.1.1 / G.7.4.1.1</comment></member>
<member><type>uint8_t</type> <name>reserved1</name>[3]<comment>Reserved for future use and must be initialized with 0.</comment></member>
<member>const <type>StdVideoEncodeH264ReferenceListsInfo</type>* <name>pRefLists</name></member>
</type>
<type category="struct" name="StdVideoEncodeH264ReferenceInfo">
<member><type>StdVideoEncodeH264ReferenceInfoFlags</type> <name>flags</name></member>
<member><type>StdVideoH264PictureType</type> <name>pictureType</name></member>
<member><type>uint32_t</type> <name>FrameNum</name></member>
<member><type>int32_t</type> <name>PicOrderCnt</name></member>
<member><type>StdVideoH264PictureType</type> <name>primary_pic_type</name></member>
<member><type>uint32_t</type> <name>FrameNum</name><comment>Frame number, as defined in 8.2</comment></member>
<member><type>int32_t</type> <name>PicOrderCnt</name><comment>Picture order count, as defined in 8.2</comment></member>
<member><type>uint16_t</type> <name>long_term_pic_num</name></member>
<member><type>uint16_t</type> <name>long_term_frame_idx</name></member>
<member><type>uint8_t</type> <name>temporal_id</name><comment>Temporal identifier of the picture, as defined in G.7.3.1.1 / G.7.4.1.1</comment></member>
</type>
<type category="struct" name="StdVideoEncodeH264SliceHeader">
<member><type>StdVideoEncodeH264SliceHeaderFlags</type> <name>flags</name></member>
<member><type>uint32_t</type> <name>first_mb_in_slice</name></member>
<member><type>StdVideoH264SliceType</type> <name>slice_type</name></member>
<member><type>uint16_t</type> <name>idr_pic_id</name></member>
<member><type>uint8_t</type> <name>num_ref_idx_l0_active_minus1</name></member>
<member><type>uint8_t</type> <name>num_ref_idx_l1_active_minus1</name></member>
<member><type>StdVideoH264CabacInitIdc</type> <name>cabac_init_idc</name></member>
<member><type>StdVideoH264DisableDeblockingFilterIdc</type> <name>disable_deblocking_filter_idc</name></member>
<member><type>int8_t</type> <name>slice_alpha_c0_offset_div2</name></member>
<member><type>int8_t</type> <name>slice_beta_offset_div2</name></member>
<member><type>uint16_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
<member><type>uint32_t</type> <name>reserved2</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
<member><type>int8_t</type> <name>slice_qp_delta</name></member>
<member><type>uint8_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
<member><type>StdVideoH264CabacInitIdc</type> <name>cabac_init_idc</name></member>
<member><type>StdVideoH264DisableDeblockingFilterIdc</type> <name>disable_deblocking_filter_idc</name></member>
<member>const <type>StdVideoEncodeH264WeightTable</type>* <name>pWeightTable</name><comment></comment></member>
</type>
@ -689,9 +699,9 @@ The current public version of video.xml is maintained in the default branch
<member><type>int32_t</type> <name>PicOrderCntVal</name></member>
<member><type>uint16_t</type> <name>NumBitsForSTRefPicSetInSlice</name><comment>number of bits used in st_ref_pic_set() when short_term_ref_pic_set_sps_flag is 0otherwise set to 0.</comment></member>
<member><type>uint16_t</type> <name>reserved</name></member>
<member><type>uint8_t</type> <name>RefPicSetStCurrBefore</name>[<enum>STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE</enum>]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures representing pReferenceSlots in VkVideoDecodeInfoKHR, 0xff for invalid slotIndex</comment></member>
<member><type>uint8_t</type> <name>RefPicSetStCurrAfter</name>[<enum>STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE</enum>]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures representing pReferenceSlots in VkVideoDecodeInfoKHR, 0xff for invalid slotIndex</comment></member>
<member><type>uint8_t</type> <name>RefPicSetLtCurr</name>[<enum>STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE</enum>]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures representing pReferenceSlots in VkVideoDecodeInfoKHR, 0xff for invalid slotIndex</comment></member>
<member><type>uint8_t</type> <name>RefPicSetStCurrBefore</name>[<enum>STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE</enum>]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures representing pReferenceSlots in VkVideoDecodeInfoKHR or STD_VIDEO_H265_NO_REFERENCE_PICTURE</comment></member>
<member><type>uint8_t</type> <name>RefPicSetStCurrAfter</name>[<enum>STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE</enum>]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures representing pReferenceSlots in VkVideoDecodeInfoKHR or STD_VIDEO_H265_NO_REFERENCE_PICTURE</comment></member>
<member><type>uint8_t</type> <name>RefPicSetLtCurr</name>[<enum>STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE</enum>]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures representing pReferenceSlots in VkVideoDecodeInfoKHR or STD_VIDEO_H265_NO_REFERENCE_PICTURE</comment></member>
</type>
<type category="struct" name="StdVideoDecodeH265ReferenceInfoFlags">
<member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>A picture that is marked as "used for long-term reference", derived binary value from clause 8.3.2 Decoding process for reference picture set</comment></member>
@ -704,10 +714,10 @@ The current public version of video.xml is maintained in the default branch
<!-- vulkan_video_codec_h265std_encode.h structs -->
<type category="struct" name="StdVideoEncodeH265WeightTableFlags">
<member><type>uint16_t</type> <name>luma_weight_l0_flag</name><comment>bit 0 - num_ref_idx_l0_active_minus1</comment></member>
<member><type>uint16_t</type> <name>chroma_weight_l0_flag</name><comment>bit 0 - num_ref_idx_l0_active_minus1</comment></member>
<member><type>uint16_t</type> <name>luma_weight_l1_flag</name><comment>bit 0 - num_ref_idx_l1_active_minus1</comment></member>
<member><type>uint16_t</type> <name>chroma_weight_l1_flag</name><comment>bit 0 - num_ref_idx_l1_active_minus1</comment></member>
<member><type>uint16_t</type> <name>luma_weight_l0_flag</name><comment>each bit n represents the nth entry in reference list l0, n &lt;= num_ref_idx_l0_active_minus1</comment></member>
<member><type>uint16_t</type> <name>chroma_weight_l0_flag</name><comment>each bit n represents the nth entry in reference list l0, n &lt;= num_ref_idx_l0_active_minus1</comment></member>
<member><type>uint16_t</type> <name>luma_weight_l1_flag</name><comment>each bit n represents the nth entry in reference list l1, n &lt;= num_ref_idx_l1_active_minus1</comment></member>
<member><type>uint16_t</type> <name>chroma_weight_l1_flag</name><comment>each bit n represents the nth entry in reference list l1, n &lt;= num_ref_idx_l1_active_minus1</comment></member>
</type>
<type category="struct" name="StdVideoEncodeH265WeightTable">
@ -728,7 +738,7 @@ The current public version of video.xml is maintained in the default branch
<member><type>int8_t</type> <name>delta_chroma_offset_l1</name>[<enum>STD_VIDEO_H265_MAX_NUM_LIST_REF</enum>][<enum>STD_VIDEO_H265_MAX_CHROMA_PLANES</enum>]<comment>[i][j]: valid entry range for i is [0, num_ref_idx_l1_active_minus1]; j = 0 for Cb, j = 1 for Cr</comment></member>
</type>
<type category="struct" name="StdVideoEncodeH265SliceSegmentLongTermRefPics">
<type category="struct" name="StdVideoEncodeH265LongTermRefPics">
<member><type>uint8_t</type> <name>num_long_term_sps</name></member>
<member><type>uint8_t</type> <name>num_long_term_pics</name></member>
<member><type>uint8_t</type> <name>lt_idx_sps</name>[<enum>STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS</enum>]</member>
@ -740,11 +750,7 @@ The current public version of video.xml is maintained in the default branch
<type category="struct" name="StdVideoEncodeH265SliceSegmentHeaderFlags">
<member><type>uint32_t</type> <name>first_slice_segment_in_pic_flag</name> : 1</member>
<member><type>uint32_t</type> <name>no_output_of_prior_pics_flag</name> : 1</member>
<member><type>uint32_t</type> <name>dependent_slice_segment_flag</name> : 1</member>
<member><type>uint32_t</type> <name>pic_output_flag</name> : 1</member>
<member><type>uint32_t</type> <name>short_term_ref_pic_set_sps_flag</name> : 1</member>
<member><type>uint32_t</type> <name>slice_temporal_mvp_enable_flag</name> : 1</member>
<member><type>uint32_t</type> <name>slice_sao_luma_flag</name> : 1</member>
<member><type>uint32_t</type> <name>slice_sao_chroma_flag</name> : 1</member>
<member><type>uint32_t</type> <name>num_ref_idx_active_override_flag</name> : 1</member>
@ -755,15 +761,13 @@ The current public version of video.xml is maintained in the default branch
<member><type>uint32_t</type> <name>slice_deblocking_filter_disabled_flag</name> : 1</member>
<member><type>uint32_t</type> <name>collocated_from_l0_flag</name> : 1</member>
<member><type>uint32_t</type> <name>slice_loop_filter_across_slices_enabled_flag</name> : 1</member>
<member><type>uint32_t</type> <name>reserved</name> : 20</member>
</type>
<type category="struct" name="StdVideoEncodeH265SliceSegmentHeader">
<member><type>StdVideoEncodeH265SliceSegmentHeaderFlags</type> <name>flags</name></member>
<member><type>StdVideoH265SliceType</type> <name>slice_type</name></member>
<member><type>uint32_t</type> <name>slice_segment_address</name></member>
<member><type>uint8_t</type> <name>short_term_ref_pic_set_idx</name></member>
<member><type>uint8_t</type> <name>collocated_ref_idx</name></member>
<member><type>uint8_t</type> <name>num_ref_idx_l0_active_minus1</name><comment>[0, 14]</comment></member>
<member><type>uint8_t</type> <name>num_ref_idx_l1_active_minus1</name><comment>[0, 14]</comment></member>
<member><type>uint8_t</type> <name>MaxNumMergeCand</name></member>
<member><type>int8_t</type> <name>slice_cb_qp_offset</name><comment>[-12, 12]</comment></member>
<member><type>int8_t</type> <name>slice_cr_qp_offset</name><comment>[-12, 12]</comment></member>
@ -772,50 +776,61 @@ The current public version of video.xml is maintained in the default branch
<member><type>int8_t</type> <name>slice_act_y_qp_offset</name></member>
<member><type>int8_t</type> <name>slice_act_cb_qp_offset</name></member>
<member><type>int8_t</type> <name>slice_act_cr_qp_offset</name></member>
<member>const <type>StdVideoH265ShortTermRefPicSet</type>*<name>pShortTermRefPicSet</name><comment>Must be a valid pointer if short_term_ref_pic_set_sps_flag is not set</comment></member>
<member>const <type>StdVideoEncodeH265SliceSegmentLongTermRefPics</type>*<name>pLongTermRefPics</name><comment>Must be a valid pointer if StdVideoH265SpsFlags:long_term_ref_pics_present_flag is set</comment></member>
<member><type>int8_t</type> <name>slice_qp_delta</name></member>
<member><type>uint16_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
<member>const <type>StdVideoEncodeH265WeightTable</type>* <name>pWeightTable</name><comment></comment></member>
</type>
<type category="struct" name="StdVideoEncodeH265ReferenceListsInfoFlags">
<member><type>uint32_t</type> <name>ref_pic_list_modification_flag_l0</name> : 1</member>
<member><type>uint32_t</type> <name>ref_pic_list_modification_flag_l1</name> : 1</member>
<member><type>uint32_t</type> <name>reserved</name> : 30</member>
</type>
<type category="struct" name="StdVideoEncodeH265ReferenceListsInfo">
<member><type>StdVideoEncodeH265ReferenceListsInfoFlags</type> <name>flags</name></member>
<member><type>uint8_t</type> <name>num_ref_idx_l0_active_minus1</name></member>
<member><type>uint8_t</type> <name>num_ref_idx_l1_active_minus1</name></member>
<member><type>uint16_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
<member>const <type>uint8_t</type>* <name>pRefPicList0Entries</name><comment>Must be a valid pointer to an array with size num_ref_idx_l0_active_minus1 plus 1 and contains the slotIndex values corresponding to the RefPicList0 as used in VkVideoReferenceSlotInfoKHR structures, 0xff for invalid slotIndex.</comment></member>
<member>const <type>uint8_t</type>* <name>pRefPicList1Entries</name><comment>Must be a valid pointer to an array with size num_ref_idx_l1_active_minus1 plus 1 and contains the slotIndex values corresponding to the RefPicList1 as used in VkVideoReferenceSlotInfoKHR structures, 0xff for invalid slotIndex.</comment></member>
<member>const <type>uint8_t</type>* <name>pRefList0Modifications</name><comment>Must be a valid pointer to an array with size num_ref_idx_l0_active_minus1 plus 1 if ref_pic_list_modification_flag_l0 is set and contains the elements of list_entry_l0.</comment></member>
<member>const <type>uint8_t</type>* <name>pRefList1Modifications</name><comment>Must be a valid pointer to an array with size num_ref_idx_l1_active_minus1 plus 1 if ref_pic_list_modification_flag_l1 is set and contains the elements of list_entry_l1.</comment></member>
<member><type>uint8_t</type> <name>RefPicList0</name>[STD_VIDEO_H265_MAX_NUM_LIST_REF]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures or STD_VIDEO_H265_NO_REFERENCE_PICTURE</comment></member>
<member><type>uint8_t</type> <name>RefPicList1</name>[STD_VIDEO_H265_MAX_NUM_LIST_REF]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures or STD_VIDEO_H265_NO_REFERENCE_PICTURE</comment></member>
<member><type>uint8_t</type> <name>list_entry_l0</name>[STD_VIDEO_H265_MAX_NUM_LIST_REF]</member>
<member><type>uint8_t</type> <name>list_entry_l1</name>[STD_VIDEO_H265_MAX_NUM_LIST_REF]</member>
</type>
<type category="struct" name="StdVideoEncodeH265PictureInfoFlags">
<member><type>uint32_t</type> <name>is_reference_flag</name> : 1</member>
<member><type>uint32_t</type> <name>IrapPicFlag</name> : 1</member>
<member><type>uint32_t</type> <name>long_term_flag</name> : 1</member>
<member><type>uint32_t</type> <name>is_reference</name> : 1<comment>A reference picture, as defined in clause 3.132</comment></member>
<member><type>uint32_t</type> <name>IrapPicFlag</name> : 1<comment>A reference picture, as defined in clause 3.73</comment></member>
<member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>A picture that is marked as "used for long-term reference", derived binary value from clause 8.3.2 Decoding process for reference picture set</comment></member>
<member><type>uint32_t</type> <name>discardable_flag</name> : 1</member>
<member><type>uint32_t</type> <name>cross_layer_bla_flag</name> : 1</member>
<member><type>uint32_t</type> <name>pic_output_flag</name> : 1</member>
<member><type>uint32_t</type> <name>no_output_of_prior_pics_flag</name> : 1</member>
<member><type>uint32_t</type> <name>short_term_ref_pic_set_sps_flag</name> : 1</member>
<member><type>uint32_t</type> <name>slice_temporal_mvp_enabled_flag</name> : 1</member>
<member><type>uint32_t</type> <name>reserved</name> : 23</member>
</type>
<type category="struct" name="StdVideoEncodeH265PictureInfo">
<member><type>StdVideoEncodeH265PictureInfoFlags</type> <name>flags</name></member>
<member><type>StdVideoH265PictureType</type> <name>PictureType</name></member>
<member><type>StdVideoH265PictureType</type> <name>pic_type</name></member>
<member><type>uint8_t</type> <name>sps_video_parameter_set_id</name><comment>Selecting VPS id from the Video Parameters Set</comment></member>
<member><type>uint8_t</type> <name>pps_seq_parameter_set_id</name><comment>Selecting SPS id from the Sequence Parameters Set</comment></member>
<member><type>uint8_t</type> <name>pps_pic_parameter_set_id</name><comment>Selecting PPS id from the Picture Parameters Set</comment></member>
<member><type>uint8_t</type> <name>TemporalId</name></member>
<member><type>int32_t</type> <name>PicOrderCntVal</name></member>
<member><type>uint8_t</type> <name>short_term_ref_pic_set_idx</name></member>
<member><type>int32_t</type> <name>PicOrderCntVal</name><comment>Picture order count derived as specified in 8.3.1</comment></member>
<member><type>uint8_t</type> <name>TemporalId</name><comment>Temporal ID, as defined in 7.4.2.2</comment></member>
<member><type>uint8_t</type> <name>reserved1</name>[7]<comment>Reserved for future use and must be initialized with 0.</comment></member>
<member>const <type>StdVideoEncodeH265ReferenceListsInfo</type>* <name>pRefLists</name></member>
<member>const <type>StdVideoH265ShortTermRefPicSet</type>* <name>pShortTermRefPicSet</name><comment>Must be a valid pointer if short_term_ref_pic_set_sps_flag is not set</comment></member>
<member>const <type>StdVideoEncodeH265LongTermRefPics</type>* <name>pLongTermRefPics</name><comment>Must be a valid pointer if long_term_ref_pics_present_flag is set</comment></member>
</type>
<type category="struct" name="StdVideoEncodeH265ReferenceInfoFlags">
<member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>A picture that is marked as "used for long-term reference", derived binary value from clause 8.3.2 Decoding process for reference picture set</comment></member>
<member><type>uint32_t</type> <name>unused_for_reference</name> : 1<comment>A picture that is marked as "unused for reference", derived binary value from clause 8.3.2 Decoding process for reference picture set</comment></member>
<member><type>uint32_t</type> <name>reserved</name> : 30</member>
</type>
<type category="struct" name="StdVideoEncodeH265ReferenceInfo">
<member><type>StdVideoEncodeH265ReferenceInfoFlags</type> <name>flags</name></member>
<member><type>StdVideoH265PictureType</type> <name>PictureType</name></member>
<member><type>int32_t</type> <name>PicOrderCntVal</name></member>
<member><type>uint8_t</type> <name>TemporalId</name></member>
<member><type>StdVideoH265PictureType</type> <name>pic_type</name></member>
<member><type>int32_t</type> <name>PicOrderCntVal</name><comment>Picture order count derived as specified in 8.3.1</comment></member>
<member><type>uint8_t</type> <name>TemporalId</name><comment>Temporal ID, as defined in 7.4.2.2</comment></member>
</type>
</types>
@ -1028,6 +1043,7 @@ The current public version of video.xml is maintained in the default branch
<extension name="vulkan_video_codecs_common" comment="protect with VULKAN_VIDEO_CODEC_COMMON_H_" supported="vulkan">
<require>
<type name="VK_MAKE_VIDEO_STD_VERSION"/>
<type name="stdint"/>
</require>
</extension>
<extension name="vulkan_video_codec_h264std" comment="protect with VULKAN_VIDEO_CODEC_H264STD_H_" supported="vulkan">
@ -1041,6 +1057,7 @@ The current public version of video.xml is maintained in the default branch
<enum name="STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS" value="64"/>
<enum name="STD_VIDEO_H264_MAX_NUM_LIST_REF" value="32"/>
<enum name="STD_VIDEO_H264_MAX_CHROMA_PLANES" value="2"/>
<enum name="STD_VIDEO_H264_NO_REFERENCE_PICTURE" value="0xFF"/>
<type name="StdVideoH264ChromaFormatIdc"/>
<type name="StdVideoH264ProfileIdc"/>
@ -1087,8 +1104,8 @@ The current public version of video.xml is maintained in the default branch
<require>
<type name="vk_video/vulkan_video_codec_h264std.h"/>
<type name="VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_9"/>
<enum name="VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION" value="VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_9"/>
<type name="VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_1_0_0"/>
<enum name="VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION" value="VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_1_0_0"/>
<enum name="VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_EXTENSION_NAME" value="&quot;VK_STD_vulkan_video_codec_h264_encode&quot;"/>
<type name="StdVideoEncodeH264WeightTableFlags"/>
@ -1097,9 +1114,9 @@ The current public version of video.xml is maintained in the default branch
<type name="StdVideoEncodeH264PictureInfoFlags"/>
<type name="StdVideoEncodeH264ReferenceInfoFlags"/>
<type name="StdVideoEncodeH264ReferenceListsInfoFlags"/>
<type name="StdVideoEncodeH264ReferenceListsInfo"/>
<type name="StdVideoEncodeH264RefListModEntry"/>
<type name="StdVideoEncodeH264RefPicMarkingEntry"/>
<type name="StdVideoEncodeH264ReferenceListsInfo"/>
<type name="StdVideoEncodeH264PictureInfo"/>
<type name="StdVideoEncodeH264ReferenceInfo"/>
<type name="StdVideoEncodeH264SliceHeader"/>
@ -1131,6 +1148,7 @@ The current public version of video.xml is maintained in the default branch
<enum name="STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS" value="32"/>
<enum name="STD_VIDEO_H265_MAX_LONG_TERM_PICS" value="16"/>
<enum name="STD_VIDEO_H265_MAX_DELTA_POC" value="48"/>
<enum name="STD_VIDEO_H265_NO_REFERENCE_PICTURE" value="0xFF"/>
<type name="StdVideoH265ChromaFormatIdc"/>
<type name="StdVideoH265ProfileIdc"/>
@ -1143,12 +1161,17 @@ The current public version of video.xml is maintained in the default branch
<type name="StdVideoH265HrdFlags"/>
<type name="StdVideoH265HrdParameters"/>
<type name="StdVideoH265VpsFlags"/>
<type name="StdVideoH265ProfileTierLevelFlags"/>
<type name="StdVideoH265ProfileTierLevel"/>
<type name="StdVideoH265VideoParameterSet"/>
<type name="StdVideoH265ScalingLists"/>
<type name="StdVideoH265SpsVuiFlags"/>
<type name="StdVideoH265SequenceParameterSetVui"/>
<type name="StdVideoH265PredictorPaletteEntries"/>
<type name="StdVideoH265SpsFlags"/>
<type name="StdVideoH265ShortTermRefPicSetFlags"/>
<type name="StdVideoH265ShortTermRefPicSet"/>
<type name="StdVideoH265LongTermRefPicsSps"/>
<type name="StdVideoH265SequenceParameterSet"/>
<type name="StdVideoH265PpsFlags"/>
<type name="StdVideoH265PictureParameterSet"/>
@ -1174,8 +1197,8 @@ The current public version of video.xml is maintained in the default branch
<require>
<type name="vk_video/vulkan_video_codec_h265std.h"/>
<type name="VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_10"/>
<enum name="VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION" value="VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_10"/>
<type name="VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_1_0_0"/>
<enum name="VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION" value="VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_1_0_0"/>
<enum name="VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_EXTENSION_NAME" value="&quot;VK_STD_vulkan_video_codec_h265_encode&quot;"/>
<type name="StdVideoEncodeH265WeightTableFlags"/>
@ -1185,6 +1208,7 @@ The current public version of video.xml is maintained in the default branch
<type name="StdVideoEncodeH265ReferenceListsInfoFlags"/>
<type name="StdVideoEncodeH265ReferenceListsInfo"/>
<type name="StdVideoEncodeH265PictureInfoFlags"/>
<type name="StdVideoEncodeH265LongTermRefPics"/>
<type name="StdVideoEncodeH265PictureInfo"/>
<type name="StdVideoEncodeH265ReferenceInfoFlags"/>
<type name="StdVideoEncodeH265ReferenceInfo"/>

File diff suppressed because it is too large Load Diff

37
registry/vkconventions.py Normal file → Executable file
View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#
# Copyright 2013-2023 The Khronos Group Inc.
# Copyright 2013-2024 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
@ -50,9 +50,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}, Version SC {version}>>'
else:
return f'<<versions-{version}, 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):
@ -108,6 +120,7 @@ class VulkanConventions(ConventionsBase):
subpats = [
[ r'_H_(26[45])_', r'_H\1_' ],
[ 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' ],
@ -277,3 +290,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'

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
)
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,73 @@
# ~~~
# 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.14.2)
project(API LANGUAGES C)
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 (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()
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)

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;
}