mirror of
https://github.com/KhronosGroup/Vulkan-Headers.git
synced 2025-04-07 22:19:11 +00:00
Compare commits
400 commits
sdk-1.1.85
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
5ceb9ed481 | ||
|
2ac81691ba | ||
|
a523083f72 | ||
|
cb28cd1819 | ||
|
24ce771ec1 | ||
|
cafcda9360 | ||
|
2b1e9e7409 | ||
|
a72b4466b3 | ||
|
fdc7404466 | ||
|
9417d66dcf | ||
|
78c359741d | ||
|
d64e9e156a | ||
|
cacef3039d | ||
|
0f0cfd88d7 | ||
|
952f776f65 | ||
|
234c4b7370 | ||
|
39f924b810 | ||
|
e43027aa41 | ||
|
a03d2f6d57 | ||
|
d4a196d8c8 | ||
|
6a74a7d65c | ||
|
49af1bfe46 | ||
|
9dff1f571c | ||
|
36872f9062 | ||
|
f864bc6dfe | ||
|
cbcad3c058 | ||
|
f2eb740f3f | ||
|
ab1ea9059d | ||
|
e271cfd480 | ||
|
b955ae0edb | ||
|
d91597a82f | ||
|
14345dab23 | ||
|
29f979ee5a | ||
|
c6391a7b8c | ||
|
fbda05468e | ||
|
a6a5dc0d07 | ||
|
d205aff40b | ||
|
595c8d4794 | ||
|
fabe9e2672 | ||
|
b379292b2a | ||
|
fc6c06ac52 | ||
|
5952791798 | ||
|
f41928bd4a | ||
|
78a92e2c7c | ||
|
6c539b2ed2 | ||
|
4b9ea26d48 | ||
|
67dcf5647c | ||
|
190d2cb24e | ||
|
e3c37e6e18 | ||
|
cde27c9456 | ||
|
7dacb97fba | ||
|
a692a9c939 | ||
|
85256c712c | ||
|
8f034f6b48 | ||
|
05fe2cc910 | ||
|
d192041a2f | ||
|
192d051db3 | ||
|
5677bafb82 | ||
|
4bc77c26ff | ||
|
eaa319dade | ||
|
1e7b8a6d03 | ||
|
cfebfc96b2 | ||
|
577baa0503 | ||
|
f030d9dd8c | ||
|
46dc0f6e51 | ||
|
31aa7f634b | ||
|
5ac36269f5 | ||
|
5a5c9a6434 | ||
|
ea45703eff | ||
|
170cde531f | ||
|
217e93c664 | ||
|
80207f9da8 | ||
|
41263fc5aa | ||
|
19a863ccce | ||
|
9d27c893cd | ||
|
7d92fe7b68 | ||
|
b93aa80bbc | ||
|
d9542c985b | ||
|
a32b2b412b | ||
|
af4fb97d7b | ||
|
8ccd414a46 | ||
|
aff5071d4e | ||
|
3f7a5370a3 | ||
|
c26f44cc8a | ||
|
374f9fd975 | ||
|
f4bfcd8852 | ||
|
7b3466a1f4 | ||
|
58ca9534a2 | ||
|
e65ef887fc | ||
|
1e451348f0 | ||
|
07ff4233bc | ||
|
3fb9d9fde5 | ||
|
bbe0f575eb | ||
|
6f0d6550e6 | ||
|
7e69138016 | ||
|
df60f03168 | ||
|
4f51aac14f | ||
|
fff6d143cc | ||
|
2634c969d7 | ||
|
a0c76b4ef7 | ||
|
9085224a1b | ||
|
85c2334e92 | ||
|
b3da20eebd | ||
|
450ead13e1 | ||
|
a3b683653e | ||
|
6dcbe90f9b | ||
|
94bb3c998b | ||
|
cb7b123f2d | ||
|
9c37439a79 | ||
|
6eee20744f | ||
|
bc14fdad60 | ||
|
2565ffa31e | ||
|
485c0395ad | ||
|
179b26a792 | ||
|
482af6d865 | ||
|
6f34ca5a37 | ||
|
ad5f8ee975 | ||
|
60b89abf43 | ||
|
ed857118e2 | ||
|
9b834aa443 | ||
|
b6a29e5ca8 | ||
|
c1a8560c5c | ||
|
cb71b646f1 | ||
|
605dc6d3e7 | ||
|
3df77fb3e4 | ||
|
9e61870ecb | ||
|
bae9700cd9 | ||
|
870a531486 | ||
|
8a397558c4 | ||
|
4c304fac64 | ||
|
95a13d7b71 | ||
|
63af1cf1ee | ||
|
0c34d02861 | ||
|
9b9fd871b0 | ||
|
ee15ae402b | ||
|
fa204df59c | ||
|
65ad768d86 | ||
|
d732b2de30 | ||
|
a3dd2655a3 | ||
|
115820a6e5 | ||
|
6c68315849 | ||
|
bd6443d28f | ||
|
e8b8e06d09 | ||
|
93cb25c6a4 | ||
|
c594930fa4 | ||
|
9f93cbe76a | ||
|
a49166a89a | ||
|
1a43b498b8 | ||
|
74a95000e2 | ||
|
4f1c41662f | ||
|
78448eda6e | ||
|
a841bc8e07 | ||
|
1fa844dba2 | ||
|
6f62a95edb | ||
|
2bb0a23104 | ||
|
08bfe2e226 | ||
|
bbed346ee4 | ||
|
6ea9413be2 | ||
|
460f75b518 | ||
|
50f8b24b85 | ||
|
7ecb09e410 | ||
|
ab48b9b20d | ||
|
b62045d6ba | ||
|
d0f8581c60 | ||
|
bc6beaa960 | ||
|
1a8e782743 | ||
|
5eeb2c4c57 | ||
|
18963a6cc0 | ||
|
24115c70be | ||
|
cbce167390 | ||
|
b232cb2bee | ||
|
fc90b60663 | ||
|
43946b0feb | ||
|
1401f7a3b3 | ||
|
86925421ad | ||
|
00671c64ba | ||
|
63637cb1c6 | ||
|
75a6b83f21 | ||
|
9b48e83ef8 | ||
|
e6cc1b3582 | ||
|
d14ccf951f | ||
|
bf3b3fb14e | ||
|
b75e5a02b6 | ||
|
891c40de1a | ||
|
2826791bed | ||
|
b092b2fccc | ||
|
974db1cede | ||
|
b7a86d3b2b | ||
|
29c0457cc1 | ||
|
f97f29836c | ||
|
6898219141 | ||
|
ef96d229cb | ||
|
e55c3116c1 | ||
|
9cc8473bb9 | ||
|
1661f3e962 | ||
|
91388ba104 | ||
|
52b7c620a5 | ||
|
ff03306bf9 | ||
|
d4c221772c | ||
|
e12a8f8cde | ||
|
98f440ce68 | ||
|
0df9899602 | ||
|
39bcdfe388 | ||
|
5177b119bb | ||
|
88ebcb08cb | ||
|
9f4c61a314 | ||
|
715673702f | ||
|
c896e2f920 | ||
|
2b55157592 | ||
|
ff92049ebd | ||
|
87d2aa9d77 | ||
|
16847a6100 | ||
|
9f73b931f4 | ||
|
2c823b7f27 | ||
|
3be1df310b | ||
|
ec9b96aae5 | ||
|
3ef4c97fd6 | ||
|
245d25ce8c | ||
|
1b4f46a3cc | ||
|
33d4dd987f | ||
|
8ba8294c86 | ||
|
76f00ef6cb | ||
|
23842a31df | ||
|
628eaec640 | ||
|
0c5928795a | ||
|
b6554a7ff3 | ||
|
7ad5775f8a | ||
|
32c07c0c53 | ||
|
384881cc90 | ||
|
2c45218b90 | ||
|
6eb8fc3598 | ||
|
361fe216ef | ||
|
aa18f182eb | ||
|
b32da5329b | ||
|
5c0fa1d68f | ||
|
1dace16d80 | ||
|
0873a22a11 | ||
|
d99496fcb1 | ||
|
52a76fd0a6 | ||
|
724c3ca76b | ||
|
e005e1f817 | ||
|
ea61f32f24 | ||
|
a152371654 | ||
|
83e1a9ed8c | ||
|
8c1c27d5a9 | ||
|
51a326d756 | ||
|
d594f70127 | ||
|
287ce74072 | ||
|
dd99e0f51f | ||
|
bdd11ea20c | ||
|
fa27a13cf7 | ||
|
e500c7c809 | ||
|
31dfaa4c63 | ||
|
c519fd7a3f | ||
|
569280430b | ||
|
4fee3efc18 | ||
|
9e62d02763 | ||
|
c5b7a2fa18 | ||
|
521f91d793 | ||
|
9fe958cdab | ||
|
b8c57b0a09 | ||
|
872fa25bb6 | ||
|
0193e158bc | ||
|
a8964617af | ||
|
37164a5726 | ||
|
ab968ab2fc | ||
|
9d10a96f2d | ||
|
07c4a37bcf | ||
|
7fe877c90a | ||
|
9af411e83f | ||
|
3f437c4a94 | ||
|
074fa3055c | ||
|
f5ac258209 | ||
|
cd913e84a8 | ||
|
e01b006576 | ||
|
e1d8c4931d | ||
|
a8d6ab19d1 | ||
|
89d366355e | ||
|
4fe5828a02 | ||
|
c428484bc8 | ||
|
ac17020766 | ||
|
a6a971aa64 | ||
|
1d99b835ec | ||
|
ec2db85225 | ||
|
9166a0677e | ||
|
684390cedb | ||
|
9efc4a6311 | ||
|
85470b32ad | ||
|
fe9850767d | ||
|
6a163aa97f | ||
|
87aaa16d4c | ||
|
d2308183f2 | ||
|
30e70cbd98 | ||
|
11c6670b4a | ||
|
670ffea9d6 | ||
|
87451c55aa | ||
|
320af06cbd | ||
|
04306fa5d6 | ||
|
f7a5392003 | ||
|
94ff600cc8 | ||
|
e1ba543c67 | ||
|
7f9879b1b1 | ||
|
f0e102e481 | ||
|
ced848d699 | ||
|
834673eaa3 | ||
|
99638d8d7f | ||
|
6eaf979e73 | ||
|
8446db62f1 | ||
|
471a35d21d | ||
|
f075211027 | ||
|
8971273d00 | ||
|
a6d08c75d2 | ||
|
a0f1f5149d | ||
|
83825d55c7 | ||
|
858b13a122 | ||
|
2a164e9680 | ||
|
4c079bf40c | ||
|
fd465722b0 | ||
|
db06fce926 | ||
|
8188e3fbbc | ||
|
f315245756 | ||
|
9d2dfca53b | ||
|
db1a98c6cc | ||
|
09531f2793 | ||
|
9250d5ae8f | ||
|
0c5351f5e9 | ||
|
4c19ae6b95 | ||
|
62becc509a | ||
|
382bf3de06 | ||
|
e01f13e1f7 | ||
|
b4b0f99420 | ||
|
0e78ffd1dc | ||
|
fb7f9c9bcd | ||
|
26341b4bf0 | ||
|
74556a1317 | ||
|
9bd3f561bc | ||
|
7264358702 | ||
|
881bbb347a | ||
|
f63dd5c9d8 | ||
|
0e57fc1cfa | ||
|
2b89fd4e27 | ||
|
2434767315 | ||
|
ba6cbb0478 | ||
|
d42d0747ee | ||
|
52c2645854 | ||
|
f3128cf6ea | ||
|
5bc459e292 | ||
|
7e4c979515 | ||
|
6be1d00866 | ||
|
d287523f48 | ||
|
0dd7c8c652 | ||
|
ba091ba6a9 | ||
|
5b44df19e0 | ||
|
42ad3f90fa | ||
|
5671d014bc | ||
|
9eab96f406 | ||
|
4ee33d2fbd | ||
|
23b2e8e64b | ||
|
6c85427e3e | ||
|
7f6a212a13 | ||
|
fd568d51ed | ||
|
552e49ee96 | ||
|
5ce5b15b54 | ||
|
737f4c1cd9 | ||
|
e3f96a9cca | ||
|
9e747a25a8 | ||
|
b1c3d56330 | ||
|
4d49d5ced5 | ||
|
097a104509 | ||
|
ace557cd9b | ||
|
5f1ceaad4c | ||
|
e0e015e709 | ||
|
c277ce529d | ||
|
171949d26d | ||
|
08cbb5458f | ||
|
87837fcd42 | ||
|
7dbd74f044 | ||
|
71be0a4302 | ||
|
16a43fcfe4 | ||
|
d05c8df88d | ||
|
982f0f84dc | ||
|
2ed3359a52 | ||
|
8e2c4cd554 | ||
|
15e5c4db75 | ||
|
7f02d9bb81 | ||
|
c200cb25db | ||
|
b0d6277a79 | ||
|
f54e45b923 | ||
|
084c2624ee | ||
|
add65b8341 | ||
|
1c8d71f98a | ||
|
4ca8ea3637 | ||
|
114c3546e1 | ||
|
369e6ea7f9 | ||
|
46979500a0 | ||
|
aaca7baef0 | ||
|
b65941cc4b | ||
|
ba4c50ae55 | ||
|
f98909b8bc | ||
|
79ea168fa9 |
91 changed files with 479821 additions and 67034 deletions
|
@ -1,34 +0,0 @@
|
|||
# Configuration for cmake-format (v0.4.1, circa Jul 2018)
|
||||
# https://github.com/cheshirekow/cmake_format
|
||||
|
||||
# How wide to allow formatted cmake files
|
||||
line_width = 132
|
||||
|
||||
# How many spaces to tab for indent
|
||||
tab_size = 4
|
||||
|
||||
# If arglists are longer than this, break them always
|
||||
max_subargs_per_line = 3
|
||||
|
||||
# If true, separate flow control names from their parentheses with a space
|
||||
separate_ctrl_name_with_space = False
|
||||
|
||||
# If true, separate function names from parentheses with a space
|
||||
separate_fn_name_with_space = False
|
||||
|
||||
# If a statement is wrapped to more than one line, than dangle the closing
|
||||
# parenthesis on it's own line
|
||||
dangle_parens = False
|
||||
|
||||
# What character to use for bulleted lists
|
||||
bullet_char = u'*'
|
||||
|
||||
# What character to use as punctuation after numerals in an enumerated list
|
||||
enum_char = u'.'
|
||||
|
||||
# What style line endings to use in the output.
|
||||
line_ending = u'unix'
|
||||
|
||||
# Format command names consistently as 'lower' or 'upper' case
|
||||
command_case = u'lower'
|
||||
|
8
.gitattributes
vendored
8
.gitattributes
vendored
|
@ -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/
|
||||
|
||||
|
|
52
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
52
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is this issue appropriate for the repository?**
|
||||
|
||||
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
|
||||
|
||||
**Describe the bug**
|
||||
|
||||
A clear and concise description of what the bug is. Please refer to specific files that are only in this repository, not copied from Vulkan-Docs or Vulkan-Hpp.
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
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
12
.github/dependabot.yml
vendored
Normal 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
18
.github/pull_request_template.md
vendored
Normal 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
|
||||
|
||||
-->
|
135
.github/workflows/ci.yml
vendored
Normal file
135
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,135 @@
|
|||
# Copyright 2022-2023 LunarG, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
CMAKE_GENERATOR: Ninja
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
cmake-unix:
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, macos-latest ]
|
||||
cmake-version: [ '3.22.1', 'latest']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: lukka/get-cmake@latest
|
||||
with:
|
||||
cmakeVersion: ${{ matrix.cmake-version }}
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
- run: cmake -S . -B build -D VULKAN_HEADERS_ENABLE_TESTS=ON -D VULKAN_HEADERS_ENABLE_INSTALL=ON -G Ninja
|
||||
- run: cmake --build ./build
|
||||
- run: cmake --install build/ --prefix build/install
|
||||
- run: ctest --output-on-failure
|
||||
working-directory: build
|
||||
|
||||
cmake-windows:
|
||||
runs-on: windows-latest
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||
strategy:
|
||||
matrix:
|
||||
cmake-version: [ '3.22.1', 'latest']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: lukka/get-cmake@latest
|
||||
with:
|
||||
cmakeVersion: ${{ matrix.cmake-version }}
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
- run: cmake -S . -B build -D VULKAN_HEADERS_ENABLE_TESTS=ON -D VULKAN_HEADERS_ENABLE_INSTALL=ON -G Ninja
|
||||
- run: cmake --build ./build
|
||||
- run: cmake --install build/ --prefix build/install
|
||||
- run: ctest --output-on-failure
|
||||
working-directory: build
|
||||
|
||||
windows_clang:
|
||||
runs-on: windows-2022
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||
strategy:
|
||||
matrix:
|
||||
compiler: [ clang, clang-cl ]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
- run: |
|
||||
cmake -S . -B build `
|
||||
-D CMAKE_C_COMPILER=${{matrix.compiler}} `
|
||||
-D CMAKE_CXX_COMPILER=${{matrix.compiler}} `
|
||||
-D CMAKE_BUILD_TYPE=Release `
|
||||
-D VULKAN_HEADERS_ENABLE_TESTS=ON `
|
||||
-D VULKAN_HEADERS_ENABLE_INSTALL=ON `
|
||||
-G Ninja
|
||||
- run: cmake --build ./build
|
||||
- run: cmake --install build/ --prefix build/install
|
||||
- run: ctest --output-on-failure
|
||||
working-directory: build
|
||||
|
||||
cmake-unix-modules:
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest ]
|
||||
cmake-version: [ 'latest' ]
|
||||
compiler: [ clang++-18 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: lukka/get-cmake@latest
|
||||
with:
|
||||
cmakeVersion: ${{ matrix.cmake-version }}
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
- run: |
|
||||
cmake -S . -B build \
|
||||
-D VULKAN_HEADERS_ENABLE_TESTS=ON \
|
||||
-D VULKAN_HEADERS_ENABLE_INSTALL=ON \
|
||||
-D VULKAN_HEADERS_ENABLE_MODULE=ON \
|
||||
-D VULKAN_HEADERS_ENABLE_MODULE_STD=OFF \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.compiler }} \
|
||||
-G Ninja
|
||||
- run: cmake --build ./build
|
||||
- run: cmake --install build/ --prefix build/install
|
||||
- run: CXX=${{ matrix.compiler }} ctest --output-on-failure
|
||||
working-directory: build
|
||||
|
||||
cmake-windows-modules:
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ windows-latest ]
|
||||
cmake-version: [ 'latest' ]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: lukka/get-cmake@latest
|
||||
with:
|
||||
cmakeVersion: ${{ matrix.cmake-version }}
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
- run: |
|
||||
cmake -S . -B build `
|
||||
-D VULKAN_HEADERS_ENABLE_TESTS=ON `
|
||||
-D VULKAN_HEADERS_ENABLE_INSTALL=ON `
|
||||
-D VULKAN_HEADERS_ENABLE_MODULE=ON `
|
||||
-D VULKAN_HEADERS_ENABLE_MODULE_STD=OFF `
|
||||
-G Ninja
|
||||
- run: cmake --build ./build
|
||||
- run: cmake --install build/ --prefix build/install
|
||||
- run: ctest --output-on-failure
|
||||
working-directory: build
|
||||
|
||||
reuse:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: REUSE Compliance Check
|
||||
uses: fsfe/reuse-action@v5
|
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -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
15
.reuse/dep5
Normal file
|
@ -0,0 +1,15 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: Vulkan-Headers
|
||||
Source: https://github.com/KhronosGroup/Vulkan-Headers
|
||||
|
||||
Files: registry/profiles/VP_KHR_roadmap.json
|
||||
Copyright: 2022-2024 The Khronos Group Inc.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: registry/validusage.json
|
||||
Copyright: 2018-2024 The Khronos Group Inc.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: .github/ISSUE_TEMPLATE/bug_report.md .github/pull_request_template.md
|
||||
Copyright: 2022-2024 The Khronos Group Inc.
|
||||
License: Apache-2.0
|
74
BUILD.gn
Normal file
74
BUILD.gn
Normal file
|
@ -0,0 +1,74 @@
|
|||
# Copyright 2018-2023 The ANGLE Project Authors.
|
||||
# Copyright 2019-2023 LunarG, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import("//build_overrides/vulkan_headers.gni")
|
||||
|
||||
config("vulkan_headers_config") {
|
||||
include_dirs = [ "include" ]
|
||||
defines = []
|
||||
|
||||
if (is_win) {
|
||||
defines += [ "VK_USE_PLATFORM_WIN32_KHR" ]
|
||||
}
|
||||
if (defined(vulkan_use_x11) && vulkan_use_x11) {
|
||||
defines += [
|
||||
"VK_USE_PLATFORM_XCB_KHR",
|
||||
"VK_USE_PLATFORM_XLIB_KHR",
|
||||
]
|
||||
}
|
||||
if (defined(vulkan_use_wayland) && vulkan_use_wayland) {
|
||||
defines += [ "VK_USE_PLATFORM_WAYLAND_KHR" ]
|
||||
if (defined(vulkan_wayland_include_dirs)) {
|
||||
include_dirs += vulkan_wayland_include_dirs
|
||||
}
|
||||
}
|
||||
if (is_android) {
|
||||
defines += [ "VK_USE_PLATFORM_ANDROID_KHR" ]
|
||||
}
|
||||
if (is_fuchsia) {
|
||||
defines += [ "VK_USE_PLATFORM_FUCHSIA" ]
|
||||
}
|
||||
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" ]
|
||||
}
|
||||
if (is_clang) {
|
||||
cflags = [
|
||||
"-Wno-redundant-parens",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
# Vulkan headers only, no compiled sources.
|
||||
source_set("vulkan_headers") {
|
||||
sources = [
|
||||
"include/vulkan/vk_icd.h",
|
||||
"include/vulkan/vk_layer.h",
|
||||
"include/vulkan/vk_platform.h",
|
||||
"include/vulkan/vulkan.h",
|
||||
"include/vulkan/vulkan.hpp",
|
||||
"include/vulkan/vulkan_core.h",
|
||||
"include/vulkan/vulkan_screen.h",
|
||||
"include/vk_video/vulkan_video_codec_av1std_decode.h",
|
||||
"include/vk_video/vulkan_video_codec_av1std_encode.h",
|
||||
"include/vk_video/vulkan_video_codec_av1std.h",
|
||||
"include/vk_video/vulkan_video_codec_h264std_decode.h",
|
||||
"include/vk_video/vulkan_video_codec_h264std_encode.h",
|
||||
"include/vk_video/vulkan_video_codec_h264std.h",
|
||||
"include/vk_video/vulkan_video_codec_h265std_decode.h",
|
||||
"include/vk_video/vulkan_video_codec_h265std_encode.h",
|
||||
"include/vk_video/vulkan_video_codec_h265std.h",
|
||||
"include/vk_video/vulkan_video_codecs_common.h",
|
||||
]
|
||||
public_configs = [ ":vulkan_headers_config" ]
|
||||
}
|
276
BUILD.md
276
BUILD.md
|
@ -1,270 +1,46 @@
|
|||
<!--
|
||||
Copyright 2018-2023 The Khronos Group Inc.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
# Build Instructions
|
||||
|
||||
Instructions for building this repository on Windows, Linux, and MacOS.
|
||||
Instructions for building this repository.
|
||||
|
||||
## Index
|
||||
```bash
|
||||
git clone https://github.com/KhronosGroup/Vulkan-Headers.git
|
||||
|
||||
1. [Contributing](#contributing-to-the-repository)
|
||||
1. [Repository Content](#repository-content)
|
||||
1. [Repository Set-up](#repository-set-up)
|
||||
1. [Windows Build](#building-on-windows)
|
||||
1. [Linux Build](#building-on-linux)
|
||||
1. [MacOS Build](#building-on-macos)
|
||||
cd Vulkan-Headers/
|
||||
|
||||
## Contributing to the Repository
|
||||
# Configure the project
|
||||
cmake -S . -B build/
|
||||
|
||||
The contents of this repository are sourced primarily from the Khronos Vulkan
|
||||
API specification [repository](https://github.com/KhronosGroup/Vulkan-Docs).
|
||||
Please visit that repository for information on contributing.
|
||||
# Because Vulkan-Headers is header only we don't need to build anything.
|
||||
# Users can install it where they need to.
|
||||
cmake --install build --prefix build/install
|
||||
```
|
||||
|
||||
## Repository Content
|
||||
See the official [CMake documentation](https://cmake.org/cmake/help/latest/index.html) for more information.
|
||||
|
||||
This repository contains the Vulkan header files and the Vulkan API definition
|
||||
(registry) with its related files. This repository does not create libraries
|
||||
or executables.
|
||||
|
||||
However, this repository contains CMake build configuration files to "install"
|
||||
the files from this repository to a specific install directory. For example,
|
||||
you can install the files to a system directory such as `/usr/local` on Linux.
|
||||
|
||||
If you are building other Vulkan-related repositories such as
|
||||
[Vulkan-Loader](https://github.com/KhronosGroup/Vulkan-Loader),
|
||||
you need to build the install target of this repository and provide the
|
||||
resulting install directory to those repositories.
|
||||
|
||||
### Installed Files
|
||||
## Installed Files
|
||||
|
||||
The `install` target installs the following files under the directory
|
||||
indicated by *install_dir*:
|
||||
|
||||
- *install_dir*`/include/vulkan` : The header files found in the
|
||||
`include/vulkan` directory of this repository
|
||||
- *install_dir*`/share/cmake/VulkanHeaders`: The CMake config files needed
|
||||
for find_package support
|
||||
- *install_dir*`/share/vulkan/registry` : The registry files found in the
|
||||
`registry` directory of this repository
|
||||
|
||||
The `uninstall` target can be used to remove the above files from the install
|
||||
directory.
|
||||
## Usage in CMake
|
||||
|
||||
## Repository Set-Up
|
||||
```cmake
|
||||
find_package(VulkanHeaders REQUIRED CONFIG)
|
||||
|
||||
### Download the Repository
|
||||
target_link_libraries(foobar PRIVATE Vulkan::Headers)
|
||||
|
||||
To create your local git repository:
|
||||
|
||||
git clone https://github.com/KhronosGroup/Vulkan-Headers.git
|
||||
|
||||
### Repository Dependencies
|
||||
|
||||
This repository does not depend on any other repositories.
|
||||
|
||||
### Build and Install Directories
|
||||
|
||||
A common convention is to place the build directory in the top directory of
|
||||
the repository with a name of `build` and place the install directory as a
|
||||
child of the build directory with the name `install`. The remainder of these
|
||||
instructions follow this convention, although you can use any name for these
|
||||
directories and place them in any location.
|
||||
|
||||
## Building On Windows
|
||||
|
||||
### Windows Development Environment Requirements
|
||||
|
||||
- Windows
|
||||
- Any Personal Computer version supported by Microsoft
|
||||
- Microsoft [Visual Studio](https://www.visualstudio.com/)
|
||||
- Versions
|
||||
- [2013 (update 4)](https://www.visualstudio.com/vs/older-downloads/)
|
||||
- [2015](https://www.visualstudio.com/vs/older-downloads/)
|
||||
- [2017](https://www.visualstudio.com/vs/downloads/)
|
||||
- The Community Edition of each of the above versions is sufficient, as
|
||||
well as any more capable edition.
|
||||
- [CMake](http://www.cmake.org/download/) (Version 2.8.11 or better)
|
||||
- Use the installer option to add CMake to the system PATH
|
||||
- Git Client Support
|
||||
- [Git for Windows](http://git-scm.com/download/win) is a popular solution
|
||||
for Windows
|
||||
- Some IDEs (e.g., [Visual Studio](https://www.visualstudio.com/),
|
||||
[GitHub Desktop](https://desktop.github.com/)) have integrated
|
||||
Git client support
|
||||
|
||||
### Windows Build - Microsoft Visual Studio
|
||||
|
||||
The general approach is to run CMake to generate the Visual Studio project
|
||||
files. Then either run CMake with the `--build` option to build from the
|
||||
command line or use the Visual Studio IDE to open the generated solution and
|
||||
work with the solution interactively.
|
||||
|
||||
#### Windows Quick Start
|
||||
|
||||
cd Vulkan-Headers
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build . --target install
|
||||
|
||||
See below for the details.
|
||||
|
||||
#### Use `CMake` to Create the Visual Studio Project Files
|
||||
|
||||
Change your current directory to the top of the cloned repository directory,
|
||||
create a build directory and generate the Visual Studio project files:
|
||||
|
||||
cd Vulkan-Headers
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
|
||||
> Note: The `..` parameter tells `cmake` the location of the top of the
|
||||
> repository. If you place your build directory someplace else, you'll need to
|
||||
> specify the location of the repository top differently.
|
||||
|
||||
The CMake configuration files set the default install directory location to
|
||||
`$CMAKE_BINARY_DIR\install`, which is a child of your build directory. In this
|
||||
example, the install directory becomes the `Vulkan-Headers\build\install`
|
||||
directory.
|
||||
|
||||
The project installs the header files to
|
||||
|
||||
Vulkan-Headers\build\install\include\vulkan
|
||||
|
||||
and installs the registry files to
|
||||
|
||||
Vulkan-Headers\build\install\share\vulkan\registry
|
||||
|
||||
You can change the install directory with the `CMAKE_INSTALL_PREFIX` CMake
|
||||
variable.
|
||||
|
||||
For example:
|
||||
|
||||
cd Vulkan-Headers
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/c/Users/dev/install .. # MINGW64 shell
|
||||
|
||||
As it starts generating the project files, `cmake` responds with something
|
||||
like:
|
||||
|
||||
-- Building for: Visual Studio 14 2015
|
||||
|
||||
which is a 32-bit generator.
|
||||
|
||||
Since this repository does not compile anything, there is no need to specify a
|
||||
specific generator such as "Visual Studio 14 2015 Win64", so the default
|
||||
generator should suffice.
|
||||
|
||||
The above steps create a Windows solution file named `Vulkan-Headers.sln` in
|
||||
the build directory.
|
||||
|
||||
At this point, you can build the solution from the command line or open the
|
||||
generated solution with Visual Studio.
|
||||
|
||||
#### Build the Solution From the Command Line
|
||||
|
||||
While still in the build directory:
|
||||
|
||||
cmake --build . --target install
|
||||
|
||||
to build the install target.
|
||||
|
||||
Build the `uninstall` target to remove the files from the install directory.
|
||||
|
||||
cmake --build . --target uninstall
|
||||
|
||||
#### Build the Solution With Visual Studio
|
||||
|
||||
Launch Visual Studio and open the "Vulkan-Headers.sln" solution file in the
|
||||
build directory. Build the `INSTALL` target from the Visual Studio solution
|
||||
explorer.
|
||||
|
||||
Build the `uninstall` target to remove the files from the install directory.
|
||||
|
||||
> Note: Since there are only the `INSTALL` and `uninstall` projects in the
|
||||
> solution, building the solution from the command line may be more efficient
|
||||
> than starting Visual Studio for these simple operations.
|
||||
|
||||
## Building On Linux
|
||||
|
||||
### Linux Development Environment Requirements
|
||||
|
||||
There are no specific Linux distribution or compiler version requirements for
|
||||
building this repository. The required tools are
|
||||
|
||||
- cmake (Version 2.8.11 or better)
|
||||
- git
|
||||
|
||||
### Linux Build
|
||||
|
||||
The general approach is to run CMake to generate make files. Then either run
|
||||
CMake with the `--build` option or `make` to build from the command line.
|
||||
|
||||
#### Linux Quick Start
|
||||
|
||||
cd Vulkan-Headers
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=install ..
|
||||
make install
|
||||
|
||||
See below for the details.
|
||||
|
||||
#### Use CMake to Create the Make Files
|
||||
|
||||
Change your current directory to the top of the cloned repository directory,
|
||||
create a build directory and generate the make files:
|
||||
|
||||
cd Vulkan-Headers
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=install ..
|
||||
|
||||
> Note: The `..` parameter tells `cmake` the location of the top of the
|
||||
> repository. If you place your `build` directory someplace else, you'll need
|
||||
> to specify the location of the repository top differently.
|
||||
|
||||
Set the `CMAKE_INSTALL_PREFIX` variable to the directory to serve as the
|
||||
destination directory for the `install` target.
|
||||
|
||||
The above `cmake` command sets the install directory to
|
||||
`$CMAKE_BINARY_DIR/install`, which is a child of your `build` directory. In
|
||||
this example, the install directory becomes the `Vulkan-Headers/build/install`
|
||||
directory.
|
||||
|
||||
The make file install target installs the header files to
|
||||
|
||||
Vulkan-Headers/build/install/include/vulkan
|
||||
|
||||
and installs the registry files to
|
||||
|
||||
Vulkan-Headers/build/install/share/vulkan/registry
|
||||
|
||||
> Note: For Linux, the default value for `CMAKE_INSTALL_PREFIX` is
|
||||
> `/usr/local`, which would be used if you do not specify
|
||||
> `CMAKE_INSTALL_PREFIX`. In this case, you may need to use `sudo` to install
|
||||
> to system directories later when you run `make install`.
|
||||
|
||||
Note that after generating the make files, running `make`:
|
||||
|
||||
make
|
||||
|
||||
does nothing, since there are no libraries or executables to build.
|
||||
|
||||
To install the header files:
|
||||
|
||||
make install
|
||||
|
||||
or
|
||||
|
||||
cmake --build . --target install
|
||||
|
||||
To uninstall the files from the install directories, you can execute:
|
||||
|
||||
make uninstall
|
||||
|
||||
or
|
||||
|
||||
cmake --build . --target uninstall
|
||||
|
||||
## Building on MacOS
|
||||
|
||||
The instructions for building this repository on MacOS are the same as those
|
||||
for Linux.
|
||||
message(STATUS "Vulkan Headers Version: ${VulkanHeaders_VERSION}")
|
||||
```
|
||||
|
|
150
CMakeLists.txt
150
CMakeLists.txt
|
@ -1,49 +1,125 @@
|
|||
# ~~~
|
||||
# Copyright (c) 2018 Valve Corporation
|
||||
# Copyright (c) 2018 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.22.1)
|
||||
|
||||
# CMake project initialization ---------------------------------------------------------------------------------------------------
|
||||
# This section contains pre-project() initialization, and ends with the project() command.
|
||||
# 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})
|
||||
message(FATAL_ERROR "Couldn't find vulkan_core.h!")
|
||||
endif()
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
file(READ ${vulkan_core_header_file} ver)
|
||||
|
||||
# NONE = this project has no language toolchain requirement.
|
||||
project(Vulkan-Headers NONE)
|
||||
if (ver MATCHES "#define[ ]+VK_HEADER_VERSION_COMPLETE[ ]+VK_MAKE_API_VERSION\\([ ]*[0-9]+,[ ]*([0-9]+),[ ]*([0-9]+),[ ]*VK_HEADER_VERSION[ ]*\\)")
|
||||
set(MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
set(MINOR_VERSION "${CMAKE_MATCH_2}")
|
||||
else()
|
||||
message(FATAL_ERROR "Couldn't get major/minor version")
|
||||
endif()
|
||||
|
||||
# User-interface declarations ----------------------------------------------------------------------------------------------------
|
||||
# This section contains variables that affect development GUIs (e.g. CMake GUI and IDEs), such as option(), folders, and variables
|
||||
# with the CACHE property.
|
||||
if (ver MATCHES "#define[ ]+VK_HEADER_VERSION[ ]+([0-9]+)")
|
||||
set(PATCH_VERSION "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
message(FATAL_ERROR "Couldn't get the patch version")
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
set(VK_VERSION_STRING "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
vlk_get_header_version()
|
||||
|
||||
if(WIN32 AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
# Windows: if install locations not set by user, set install prefix to "<build_dir>\install".
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "default install path" FORCE)
|
||||
project(VULKAN_HEADERS LANGUAGES C CXX VERSION ${VK_VERSION_STRING})
|
||||
|
||||
# options for Vulkan-Headers and the Vulkan-Hpp C++20 module
|
||||
option(VULKAN_HEADERS_ENABLE_TESTS "Test Vulkan-Headers" ${PROJECT_IS_TOP_LEVEL})
|
||||
option(VULKAN_HEADERS_ENABLE_INSTALL "Install Vulkan-Headers" ${PROJECT_IS_TOP_LEVEL})
|
||||
option(VULKAN_HEADERS_ENABLE_MODULE "Enables building of the Vulkan C++20 module; requires minimum CMake version 3.28" OFF)
|
||||
option(VULKAN_HEADERS_ENABLE_MODULE_STD "Enables building of the Vulkan C++20 module with import std; requires minimum CMake version 3.30" OFF)
|
||||
|
||||
# set up Vulkan-Headers
|
||||
add_library(Vulkan-Headers INTERFACE)
|
||||
add_library(Vulkan::Headers ALIAS Vulkan-Headers)
|
||||
target_include_directories(Vulkan-Headers INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
|
||||
|
||||
if (VULKAN_HEADERS_ENABLE_MODULE)
|
||||
# check for compiler support
|
||||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND (MSVC_VERSION GREATER_EQUAL "1941")) OR
|
||||
# clang-cl doesn't currently support modules
|
||||
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
|
||||
AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "16.0"
|
||||
AND (NOT CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC")
|
||||
AND (NOT CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS STREQUAL CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND)) OR
|
||||
(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "14.0")
|
||||
)
|
||||
# check for CMake support
|
||||
if(VULKAN_HEADERS_ENABLE_MODULE_STD AND CMAKE_VERSION VERSION_LESS "3.30")
|
||||
message(FATAL_ERROR "Vulkan-Hpp: C++20 module with import std requires CMake 3.30 or later")
|
||||
elseif (CMAKE_VERSION VERSION_LESS "3.28")
|
||||
message(FATAL_ERROR "Vulkan-Hpp: C++20 module requires CMake 3.28 or later")
|
||||
endif()
|
||||
|
||||
# set up Vulkan-HppModule
|
||||
add_library(Vulkan-HppModule)
|
||||
add_library(Vulkan::HppModule ALIAS Vulkan-HppModule)
|
||||
target_sources(Vulkan-HppModule
|
||||
PUBLIC
|
||||
FILE_SET module
|
||||
TYPE CXX_MODULES
|
||||
FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan/vulkan.cppm")
|
||||
if (VULKAN_HEADERS_ENABLE_MODULE_STD)
|
||||
target_compile_features(Vulkan-HppModule
|
||||
PRIVATE cxx_std_23
|
||||
INTERFACE cxx_std_20) # only C++20 is required to consume this module
|
||||
set_target_properties(Vulkan-HppModule PROPERTIES CXX_MODULE_STD ON)
|
||||
else()
|
||||
target_compile_features(Vulkan-HppModule PUBLIC cxx_std_20)
|
||||
endif()
|
||||
target_link_libraries(Vulkan-HppModule PUBLIC Vulkan::Headers)
|
||||
|
||||
# Clang 16's module support can be broken with extensions enabled
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "16.0")
|
||||
set_target_properties(Vulkan-HppModule PROPERTIES CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
# set up fallback targets to notify about name deprecation
|
||||
add_library(Vulkan-Module INTERFACE)
|
||||
add_library(Vulkan::Module ALIAS Vulkan-Module)
|
||||
target_link_libraries(Vulkan-Module INTERFACE Vulkan::HppModule)
|
||||
set_target_properties(Vulkan-Module PROPERTIES
|
||||
DEPRECATION "The Vulkan-Module and Vulkan::Module targets have been deprecated by the Vulkan-HppModule and Vulkan::HppModule targets respectively and will be removed at a future date.")
|
||||
else()
|
||||
message(FATAL_ERROR "Vulkan-Hpp: C++20 module support is requested but was disabled due to lacking compiler support on this platform")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# --------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/vulkan" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/registry" DESTINATION ${CMAKE_INSTALL_DATADIR}/vulkan)
|
||||
|
||||
# uninstall target
|
||||
if(NOT TARGET uninstall)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE
|
||||
@ONLY)
|
||||
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
if (VULKAN_HEADERS_ENABLE_TESTS)
|
||||
enable_testing() # This is only effective in the top level CMakeLists.txt file.
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
if (VULKAN_HEADERS_ENABLE_INSTALL)
|
||||
include(GNUInstallDirs)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
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 "${CMAKE_INSTALL_DATADIR}/vulkan" USE_SOURCE_PERMISSIONS)
|
||||
|
||||
set_target_properties(Vulkan-Headers PROPERTIES EXPORT_NAME "Headers")
|
||||
install(TARGETS Vulkan-Headers EXPORT VulkanHeadersConfig INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
install(EXPORT VulkanHeadersConfig NAMESPACE "Vulkan::" DESTINATION "share/cmake/VulkanHeaders")
|
||||
|
||||
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
10
CODE_OF_CONDUCT.adoc
Normal 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.
|
40
CONTRIBUTING.md
Normal file
40
CONTRIBUTING.md
Normal file
|
@ -0,0 +1,40 @@
|
|||
<!--
|
||||
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.
|
||||
|
||||
The majority for the Vulkan headers come from [Vulkan-Docs](https://github.com/KhronosGroup/Vulkan-Docs) or [Vulkan-Hpp](https://github.com/KhronosGroup/Vulkan-Hpp)
|
||||
|
||||
### This repository (https://github.com/KhronosGroup/Vulkan-Headers)
|
||||
|
||||
* 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
|
||||
|
||||
### Specification repository (https://github.com/KhronosGroup/Vulkan-Docs)
|
||||
|
||||
* registry/*.py
|
||||
* registry/spec_tools/*.py
|
||||
* registry/profiles/*.json
|
||||
* All files under include/vulkan/ which are *not* listed explicitly as originating from another repository.
|
||||
|
||||
### Vulkan C++ Binding Repository (https://github.com/KhronosGroup/Vulkan-Hpp)
|
||||
|
||||
As of the Vulkan-Docs 1.2.182 spec update, the Vulkan-Hpp headers have been
|
||||
split into multiple files. All of those files are now included in this
|
||||
repository.
|
||||
|
||||
* include/vulkan/*.hpp
|
||||
* include/vulkan/*.cppm
|
18
LICENSE.md
Normal file
18
LICENSE.md
Normal 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
|
170
LICENSE.txt
170
LICENSE.txt
|
@ -1,170 +0,0 @@
|
|||
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:
|
||||
|
||||
You must give any other recipients of the Work or Derivative Works a copy of this
|
||||
License; and
|
||||
You must cause any modified files to carry prominent notices stating that You changed
|
||||
the files; and
|
||||
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
|
||||
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.
|
||||
|
202
LICENSES/Apache-2.0.txt
Normal file
202
LICENSES/Apache-2.0.txt
Normal 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
9
LICENSES/MIT.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2015-2023 The Khronos Group Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
110
Makefile.release
Normal file
110
Makefile.release
Normal file
|
@ -0,0 +1,110 @@
|
|||
# Copyright 2024 The Khronos Group Inc.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Makefile.release - update external files generated in Vulkan spec
|
||||
# repository when a public specification update is done.
|
||||
|
||||
# Needed to get the right version of test, apparently
|
||||
SHELL = /bin/bash
|
||||
|
||||
REVISION = 999
|
||||
|
||||
# Location of other repository clones
|
||||
GIT = ..
|
||||
SPEC = $(GIT)/Vulkan-Docs
|
||||
HPP = $(GIT)/Vulkan-Hpp
|
||||
REGISTRY = $(GIT)/registry/vulkan
|
||||
|
||||
update: version-check create-branch update-files push-branch
|
||||
|
||||
# Working branch for the update, and a test if it exists
|
||||
BRANCH = update-$(REVISION)
|
||||
|
||||
# Switch to new branch which will contain the update
|
||||
create-branch: version-check
|
||||
git switch -q main
|
||||
git pull -q
|
||||
# If branch already exists, do nothing
|
||||
@if test `git branch -l $(BRANCH) | wc -l` == 1 ; then \
|
||||
echo "Branch $(BRANCH) already exists" ; \
|
||||
git switch $(BRANCH) ; \
|
||||
else \
|
||||
echo "Creating branch $(BRANCH)" ; \
|
||||
git switch -c $(BRANCH) ; \
|
||||
fi
|
||||
|
||||
# Update headers and scripts in the new branch
|
||||
update-files: remove-files update-headers update-scripts
|
||||
|
||||
# Vulkan SC Vulkan-Hpp headers not published in the Vulkan-Headers repository
|
||||
SCHPPFILES = \
|
||||
include/vulkan/vulkansc.hpp \
|
||||
include/vulkan/vulkansc.cppm \
|
||||
include/vulkan/vulkansc_*.hpp
|
||||
|
||||
update-headers:
|
||||
if test ! -d $(SPEC)/gen/include/ ; then \
|
||||
echo "No C header file source directory $(SPEC)/gen/include" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
if test ! -d $(HPP)/vulkan ; then \
|
||||
echo "No C++ header file source directory $(HPP)/vulkan" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
cp -r $(SPEC)/gen/include/* include/
|
||||
cp -r $(HPP)/vulkan/* include/vulkan/
|
||||
rm -f $(SCHPPFILES)
|
||||
|
||||
# Top-level scripts / XML to install
|
||||
SCRIPTS = \
|
||||
$(SPEC)/scripts/base_generator.py \
|
||||
$(SPEC)/scripts/cgenerator.py \
|
||||
$(SPEC)/scripts/generator.py \
|
||||
$(SPEC)/scripts/parse_dependency.py \
|
||||
$(SPEC)/scripts/reg.py \
|
||||
$(SPEC)/scripts/stripAPI.py \
|
||||
$(SPEC)/scripts/apiconventions.py \
|
||||
$(SPEC)/scripts/vkconventions.py \
|
||||
$(SPEC)/scripts/vulkan_object.py \
|
||||
$(SPEC)/xml/vk.xml \
|
||||
$(SPEC)/xml/video.xml \
|
||||
$(REGISTRY)/specs/latest/validation/validusage.json
|
||||
|
||||
# Scripts in registry/spec_tools to install
|
||||
SCRIPT_TOOLS = \
|
||||
$(SPEC)/scripts/spec_tools/conventions.py \
|
||||
$(SPEC)/scripts/spec_tools/util.py
|
||||
|
||||
# Profiles to install
|
||||
PROFILES = \
|
||||
$(wildcard $(SPEC)/xml/profiles/*)
|
||||
|
||||
update-scripts:
|
||||
cp $(SCRIPTS) registry/
|
||||
cp $(PROFILES) registry/profiles/
|
||||
cp $(SCRIPT_TOOLS) registry/spec_tools/
|
||||
|
||||
# To ensure updates are caught, old versions of installed files are
|
||||
# removed.
|
||||
|
||||
# Files in include/ to keep
|
||||
HEADERS_KEEP = \
|
||||
include/vulkan/vk_icd.h \
|
||||
include/vulkan/vk_layer.h
|
||||
|
||||
remove-files:
|
||||
rm -rf $(filter-out $(HEADERS_KEEP), $(wildcard include/vulkan/*))
|
||||
rm -rf include/vk_video
|
||||
rm -rf registry
|
||||
mkdir include/vk_video registry registry/profiles registry/spec_tools
|
||||
|
||||
# Once the branch is updated, push it to upstream
|
||||
# This does not actually push it for safety reasons
|
||||
push-branch:
|
||||
@echo Verify that all new files are 'git add'ed and obsolete files removed, then:
|
||||
@echo git commit -m \"Update for Vulkan-Docs 1.3.$(REVISION)\"
|
||||
@echo git push --set-upstream origin $(BRANCH)
|
||||
@echo git switch main
|
||||
|
||||
version-check:
|
||||
@if test $(REVISION) = 999 ; then echo "Must specify explicit REVISION= in make invocation" ; exit 1 ; fi
|
56
README.md
56
README.md
|
@ -1,18 +1,52 @@
|
|||
<!--
|
||||
Copyright 2018-2023 The Khronos Group Inc.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
# Vulkan-Headers
|
||||
|
||||
Vulkan Header files and API registry
|
||||
Vulkan header files and API registry
|
||||
|
||||
## Repository Content
|
||||
This repository contains Vulkan header files, include files for C and C++,
|
||||
and related scripts and tests.
|
||||
|
||||
The contents of this repository are largely obtained from other repositories and are
|
||||
collected, coordinated, and curated here.
|
||||
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.
|
||||
|
||||
The projects for these repositories are:
|
||||
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.
|
||||
|
||||
- [KhronosGroup/Vulkan-Docs](https://github.com/KhronosGroup/Vulkan-Docs)
|
||||
- Core Vulkan headers and Registry
|
||||
- [KhronosGroup/Vulkan-Hpp](https://github.com/KhronosGroup/Vulkan-Hpp)
|
||||
- C++ Bindings for Vulkan
|
||||
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).
|
||||
|
||||
Please visit the appropriate project in the above list for obtaining additional information,
|
||||
asking questions, or opening issues.
|
||||
## Contributing
|
||||
|
||||
See the [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## Building
|
||||
|
||||
See [BUILD.md](BUILD.md)
|
||||
|
||||
## SDK Support
|
||||
|
||||
Vulkan-Headers are shipped as part of the official [Vulkan-SDK](https://www.lunarg.com/vulkan-sdk/)
|
||||
|
||||
## C/C++ Package Manager Support
|
||||
|
||||
`Vulkan-Headers` are also supported by both [conan](https://conan.io/) & [vcpkg](https://learn.microsoft.com/en-us/vcpkg/).
|
||||
|
||||
## Version Tagging Scheme
|
||||
|
||||
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 `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
11
SECURITY.md
Normal 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.
|
|
@ -1,126 +0,0 @@
|
|||
CMake - Cross Platform Makefile Generator
|
||||
Copyright 2000-2018 Kitware, Inc. and Contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of Kitware, Inc. nor the names of Contributors
|
||||
may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
The following individuals and institutions are among the Contributors:
|
||||
|
||||
* Aaron C. Meadows <cmake@shadowguarddev.com>
|
||||
* Adriaan de Groot <groot@kde.org>
|
||||
* Aleksey Avdeev <solo@altlinux.ru>
|
||||
* Alexander Neundorf <neundorf@kde.org>
|
||||
* Alexander Smorkalov <alexander.smorkalov@itseez.com>
|
||||
* Alexey Sokolov <sokolov@google.com>
|
||||
* Alex Turbov <i.zaufi@gmail.com>
|
||||
* Andreas Pakulat <apaku@gmx.de>
|
||||
* Andreas Schneider <asn@cryptomilk.org>
|
||||
* André Rigland Brodtkorb <Andre.Brodtkorb@ifi.uio.no>
|
||||
* Axel Huebl, Helmholtz-Zentrum Dresden - Rossendorf
|
||||
* Benjamin Eikel
|
||||
* Bjoern Ricks <bjoern.ricks@gmail.com>
|
||||
* Brad Hards <bradh@kde.org>
|
||||
* Christopher Harvey
|
||||
* Christoph Grüninger <foss@grueninger.de>
|
||||
* Clement Creusot <creusot@cs.york.ac.uk>
|
||||
* Daniel Blezek <blezek@gmail.com>
|
||||
* Daniel Pfeifer <daniel@pfeifer-mail.de>
|
||||
* Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
|
||||
* Eran Ifrah <eran.ifrah@gmail.com>
|
||||
* Esben Mose Hansen, Ange Optimization ApS
|
||||
* Geoffrey Viola <geoffrey.viola@asirobots.com>
|
||||
* Google Inc
|
||||
* Gregor Jasny
|
||||
* Helio Chissini de Castro <helio@kde.org>
|
||||
* Ilya Lavrenov <ilya.lavrenov@itseez.com>
|
||||
* Insight Software Consortium <insightsoftwareconsortium.org>
|
||||
* Jan Woetzel
|
||||
* Kelly Thompson <kgt@lanl.gov>
|
||||
* Konstantin Podsvirov <konstantin@podsvirov.pro>
|
||||
* Mario Bensi <mbensi@ipsquad.net>
|
||||
* Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||
* Matthaeus G. Chajdas
|
||||
* Matthias Kretz <kretz@kde.org>
|
||||
* Matthias Maennich <matthias@maennich.net>
|
||||
* Michael Stürmer
|
||||
* Miguel A. Figueroa-Villanueva
|
||||
* Mike Jackson
|
||||
* Mike McQuaid <mike@mikemcquaid.com>
|
||||
* Nicolas Bock <nicolasbock@gmail.com>
|
||||
* Nicolas Despres <nicolas.despres@gmail.com>
|
||||
* Nikita Krupen'ko <krnekit@gmail.com>
|
||||
* NVIDIA Corporation <www.nvidia.com>
|
||||
* OpenGamma Ltd. <opengamma.com>
|
||||
* Patrick Stotko <stotko@cs.uni-bonn.de>
|
||||
* Per Øyvind Karlsen <peroyvind@mandriva.org>
|
||||
* Peter Collingbourne <peter@pcc.me.uk>
|
||||
* Petr Gotthard <gotthard@honeywell.com>
|
||||
* Philip Lowman <philip@yhbt.com>
|
||||
* Philippe Proulx <pproulx@efficios.com>
|
||||
* Raffi Enficiaud, Max Planck Society
|
||||
* Raumfeld <raumfeld.com>
|
||||
* Roger Leigh <rleigh@codelibre.net>
|
||||
* Rolf Eike Beer <eike@sf-mail.de>
|
||||
* Roman Donchenko <roman.donchenko@itseez.com>
|
||||
* Roman Kharitonov <roman.kharitonov@itseez.com>
|
||||
* Ruslan Baratov
|
||||
* Sebastian Holtermann <sebholt@xwmw.org>
|
||||
* Stephen Kelly <steveire@gmail.com>
|
||||
* Sylvain Joubert <joubert.sy@gmail.com>
|
||||
* Thomas Sondergaard <ts@medical-insight.com>
|
||||
* Tobias Hunger <tobias.hunger@qt.io>
|
||||
* Todd Gamblin <tgamblin@llnl.gov>
|
||||
* Tristan Carel
|
||||
* University of Dundee
|
||||
* Vadim Zhukov
|
||||
* Will Dicharry <wdicharry@stellarscience.com>
|
||||
|
||||
See version control history for details of individual contributions.
|
||||
|
||||
The above copyright and license notice applies to distributions of
|
||||
CMake in source and binary form. Third-party software packages supplied
|
||||
with CMake under compatible licenses provide their own copyright notices
|
||||
documented in corresponding subdirectories or source files.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
CMake was initially developed by Kitware with the following sponsorship:
|
||||
|
||||
* National Library of Medicine at the National Institutes of Health
|
||||
as part of the Insight Segmentation and Registration Toolkit (ITK).
|
||||
|
||||
* US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
|
||||
Visualization Initiative.
|
||||
|
||||
* National Alliance for Medical Image Computing (NAMIC) is funded by the
|
||||
National Institutes of Health through the NIH Roadmap for Medical Research,
|
||||
Grant U54 EB005149.
|
||||
|
||||
* Kitware, Inc.
|
|
@ -1,21 +0,0 @@
|
|||
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
foreach(file ${files})
|
||||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
||||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
exec_program(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
if(NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
||||
endif(NOT "${rm_retval}" STREQUAL 0)
|
||||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
endforeach(file)
|
394
include/vk_video/vulkan_video_codec_av1std.h
Normal file
394
include/vk_video/vulkan_video_codec_av1std.h
Normal file
|
@ -0,0 +1,394 @@
|
|||
#ifndef VULKAN_VIDEO_CODEC_AV1STD_H_
|
||||
#define VULKAN_VIDEO_CODEC_AV1STD_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// vulkan_video_codec_av1std is a preprocessor guard. Do not pass it to API calls.
|
||||
#define vulkan_video_codec_av1std 1
|
||||
#include "vulkan_video_codecs_common.h"
|
||||
#define STD_VIDEO_AV1_NUM_REF_FRAMES 8
|
||||
#define STD_VIDEO_AV1_REFS_PER_FRAME 7
|
||||
#define STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME 8
|
||||
#define STD_VIDEO_AV1_MAX_TILE_COLS 64
|
||||
#define STD_VIDEO_AV1_MAX_TILE_ROWS 64
|
||||
#define STD_VIDEO_AV1_MAX_SEGMENTS 8
|
||||
#define STD_VIDEO_AV1_SEG_LVL_MAX 8
|
||||
#define STD_VIDEO_AV1_PRIMARY_REF_NONE 7
|
||||
#define STD_VIDEO_AV1_SELECT_INTEGER_MV 2
|
||||
#define STD_VIDEO_AV1_SELECT_SCREEN_CONTENT_TOOLS 2
|
||||
#define STD_VIDEO_AV1_SKIP_MODE_FRAMES 2
|
||||
#define STD_VIDEO_AV1_MAX_LOOP_FILTER_STRENGTHS 4
|
||||
#define STD_VIDEO_AV1_LOOP_FILTER_ADJUSTMENTS 2
|
||||
#define STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS 8
|
||||
#define STD_VIDEO_AV1_MAX_NUM_PLANES 3
|
||||
#define STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS 6
|
||||
#define STD_VIDEO_AV1_MAX_NUM_Y_POINTS 14
|
||||
#define STD_VIDEO_AV1_MAX_NUM_CB_POINTS 10
|
||||
#define STD_VIDEO_AV1_MAX_NUM_CR_POINTS 10
|
||||
#define STD_VIDEO_AV1_MAX_NUM_POS_LUMA 24
|
||||
#define STD_VIDEO_AV1_MAX_NUM_POS_CHROMA 25
|
||||
|
||||
typedef enum StdVideoAV1Profile {
|
||||
STD_VIDEO_AV1_PROFILE_MAIN = 0,
|
||||
STD_VIDEO_AV1_PROFILE_HIGH = 1,
|
||||
STD_VIDEO_AV1_PROFILE_PROFESSIONAL = 2,
|
||||
STD_VIDEO_AV1_PROFILE_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_AV1_PROFILE_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoAV1Profile;
|
||||
|
||||
typedef enum StdVideoAV1Level {
|
||||
STD_VIDEO_AV1_LEVEL_2_0 = 0,
|
||||
STD_VIDEO_AV1_LEVEL_2_1 = 1,
|
||||
STD_VIDEO_AV1_LEVEL_2_2 = 2,
|
||||
STD_VIDEO_AV1_LEVEL_2_3 = 3,
|
||||
STD_VIDEO_AV1_LEVEL_3_0 = 4,
|
||||
STD_VIDEO_AV1_LEVEL_3_1 = 5,
|
||||
STD_VIDEO_AV1_LEVEL_3_2 = 6,
|
||||
STD_VIDEO_AV1_LEVEL_3_3 = 7,
|
||||
STD_VIDEO_AV1_LEVEL_4_0 = 8,
|
||||
STD_VIDEO_AV1_LEVEL_4_1 = 9,
|
||||
STD_VIDEO_AV1_LEVEL_4_2 = 10,
|
||||
STD_VIDEO_AV1_LEVEL_4_3 = 11,
|
||||
STD_VIDEO_AV1_LEVEL_5_0 = 12,
|
||||
STD_VIDEO_AV1_LEVEL_5_1 = 13,
|
||||
STD_VIDEO_AV1_LEVEL_5_2 = 14,
|
||||
STD_VIDEO_AV1_LEVEL_5_3 = 15,
|
||||
STD_VIDEO_AV1_LEVEL_6_0 = 16,
|
||||
STD_VIDEO_AV1_LEVEL_6_1 = 17,
|
||||
STD_VIDEO_AV1_LEVEL_6_2 = 18,
|
||||
STD_VIDEO_AV1_LEVEL_6_3 = 19,
|
||||
STD_VIDEO_AV1_LEVEL_7_0 = 20,
|
||||
STD_VIDEO_AV1_LEVEL_7_1 = 21,
|
||||
STD_VIDEO_AV1_LEVEL_7_2 = 22,
|
||||
STD_VIDEO_AV1_LEVEL_7_3 = 23,
|
||||
STD_VIDEO_AV1_LEVEL_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_AV1_LEVEL_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoAV1Level;
|
||||
|
||||
typedef enum StdVideoAV1FrameType {
|
||||
STD_VIDEO_AV1_FRAME_TYPE_KEY = 0,
|
||||
STD_VIDEO_AV1_FRAME_TYPE_INTER = 1,
|
||||
STD_VIDEO_AV1_FRAME_TYPE_INTRA_ONLY = 2,
|
||||
STD_VIDEO_AV1_FRAME_TYPE_SWITCH = 3,
|
||||
STD_VIDEO_AV1_FRAME_TYPE_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_AV1_FRAME_TYPE_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoAV1FrameType;
|
||||
|
||||
typedef enum StdVideoAV1ReferenceName {
|
||||
STD_VIDEO_AV1_REFERENCE_NAME_INTRA_FRAME = 0,
|
||||
STD_VIDEO_AV1_REFERENCE_NAME_LAST_FRAME = 1,
|
||||
STD_VIDEO_AV1_REFERENCE_NAME_LAST2_FRAME = 2,
|
||||
STD_VIDEO_AV1_REFERENCE_NAME_LAST3_FRAME = 3,
|
||||
STD_VIDEO_AV1_REFERENCE_NAME_GOLDEN_FRAME = 4,
|
||||
STD_VIDEO_AV1_REFERENCE_NAME_BWDREF_FRAME = 5,
|
||||
STD_VIDEO_AV1_REFERENCE_NAME_ALTREF2_FRAME = 6,
|
||||
STD_VIDEO_AV1_REFERENCE_NAME_ALTREF_FRAME = 7,
|
||||
STD_VIDEO_AV1_REFERENCE_NAME_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_AV1_REFERENCE_NAME_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoAV1ReferenceName;
|
||||
|
||||
typedef enum StdVideoAV1InterpolationFilter {
|
||||
STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP = 0,
|
||||
STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH = 1,
|
||||
STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP_SHARP = 2,
|
||||
STD_VIDEO_AV1_INTERPOLATION_FILTER_BILINEAR = 3,
|
||||
STD_VIDEO_AV1_INTERPOLATION_FILTER_SWITCHABLE = 4,
|
||||
STD_VIDEO_AV1_INTERPOLATION_FILTER_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_AV1_INTERPOLATION_FILTER_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoAV1InterpolationFilter;
|
||||
|
||||
typedef enum StdVideoAV1TxMode {
|
||||
STD_VIDEO_AV1_TX_MODE_ONLY_4X4 = 0,
|
||||
STD_VIDEO_AV1_TX_MODE_LARGEST = 1,
|
||||
STD_VIDEO_AV1_TX_MODE_SELECT = 2,
|
||||
STD_VIDEO_AV1_TX_MODE_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_AV1_TX_MODE_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoAV1TxMode;
|
||||
|
||||
typedef enum StdVideoAV1FrameRestorationType {
|
||||
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_NONE = 0,
|
||||
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_WIENER = 1,
|
||||
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SGRPROJ = 2,
|
||||
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SWITCHABLE = 3,
|
||||
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoAV1FrameRestorationType;
|
||||
|
||||
typedef enum StdVideoAV1ColorPrimaries {
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_BT_709 = 1,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_UNSPECIFIED = 2,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_BT_470_M = 4,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_BT_470_B_G = 5,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_BT_601 = 6,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_240 = 7,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_GENERIC_FILM = 8,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_BT_2020 = 9,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_XYZ = 10,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_431 = 11,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_432 = 12,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_EBU_3213 = 22,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_INVALID = 0x7FFFFFFF,
|
||||
// STD_VIDEO_AV1_COLOR_PRIMARIES_BT_UNSPECIFIED is a deprecated alias
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_BT_UNSPECIFIED = STD_VIDEO_AV1_COLOR_PRIMARIES_UNSPECIFIED,
|
||||
STD_VIDEO_AV1_COLOR_PRIMARIES_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoAV1ColorPrimaries;
|
||||
|
||||
typedef enum StdVideoAV1TransferCharacteristics {
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_RESERVED_0 = 0,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_709 = 1,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_UNSPECIFIED = 2,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_RESERVED_3 = 3,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_470_M = 4,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_470_B_G = 5,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_601 = 6,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_240 = 7,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LINEAR = 8,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LOG_100 = 9,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LOG_100_SQRT10 = 10,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_IEC_61966 = 11,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_1361 = 12,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SRGB = 13,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_2020_10_BIT = 14,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_2020_12_BIT = 15,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_2084 = 16,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_428 = 17,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_HLG = 18,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoAV1TransferCharacteristics;
|
||||
|
||||
typedef enum StdVideoAV1MatrixCoefficients {
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_IDENTITY = 0,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_709 = 1,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_UNSPECIFIED = 2,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_RESERVED_3 = 3,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_FCC = 4,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_470_B_G = 5,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_601 = 6,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_240 = 7,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_YCGCO = 8,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_2020_NCL = 9,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_2020_CL = 10,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_2085 = 11,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_CHROMAT_NCL = 12,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_CHROMAT_CL = 13,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_ICTCP = 14,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_AV1_MATRIX_COEFFICIENTS_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoAV1MatrixCoefficients;
|
||||
|
||||
typedef enum StdVideoAV1ChromaSamplePosition {
|
||||
STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_UNKNOWN = 0,
|
||||
STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_VERTICAL = 1,
|
||||
STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_COLOCATED = 2,
|
||||
STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_RESERVED = 3,
|
||||
STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoAV1ChromaSamplePosition;
|
||||
typedef struct StdVideoAV1ColorConfigFlags {
|
||||
uint32_t mono_chrome : 1;
|
||||
uint32_t color_range : 1;
|
||||
uint32_t separate_uv_delta_q : 1;
|
||||
uint32_t color_description_present_flag : 1;
|
||||
uint32_t reserved : 28;
|
||||
} StdVideoAV1ColorConfigFlags;
|
||||
|
||||
typedef struct StdVideoAV1ColorConfig {
|
||||
StdVideoAV1ColorConfigFlags flags;
|
||||
uint8_t BitDepth;
|
||||
uint8_t subsampling_x;
|
||||
uint8_t subsampling_y;
|
||||
uint8_t reserved1;
|
||||
StdVideoAV1ColorPrimaries color_primaries;
|
||||
StdVideoAV1TransferCharacteristics transfer_characteristics;
|
||||
StdVideoAV1MatrixCoefficients matrix_coefficients;
|
||||
StdVideoAV1ChromaSamplePosition chroma_sample_position;
|
||||
} StdVideoAV1ColorConfig;
|
||||
|
||||
typedef struct StdVideoAV1TimingInfoFlags {
|
||||
uint32_t equal_picture_interval : 1;
|
||||
uint32_t reserved : 31;
|
||||
} StdVideoAV1TimingInfoFlags;
|
||||
|
||||
typedef struct StdVideoAV1TimingInfo {
|
||||
StdVideoAV1TimingInfoFlags flags;
|
||||
uint32_t num_units_in_display_tick;
|
||||
uint32_t time_scale;
|
||||
uint32_t num_ticks_per_picture_minus_1;
|
||||
} StdVideoAV1TimingInfo;
|
||||
|
||||
typedef struct StdVideoAV1LoopFilterFlags {
|
||||
uint32_t loop_filter_delta_enabled : 1;
|
||||
uint32_t loop_filter_delta_update : 1;
|
||||
uint32_t reserved : 30;
|
||||
} StdVideoAV1LoopFilterFlags;
|
||||
|
||||
typedef struct StdVideoAV1LoopFilter {
|
||||
StdVideoAV1LoopFilterFlags flags;
|
||||
uint8_t loop_filter_level[STD_VIDEO_AV1_MAX_LOOP_FILTER_STRENGTHS];
|
||||
uint8_t loop_filter_sharpness;
|
||||
uint8_t update_ref_delta;
|
||||
int8_t loop_filter_ref_deltas[STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME];
|
||||
uint8_t update_mode_delta;
|
||||
int8_t loop_filter_mode_deltas[STD_VIDEO_AV1_LOOP_FILTER_ADJUSTMENTS];
|
||||
} StdVideoAV1LoopFilter;
|
||||
|
||||
typedef struct StdVideoAV1QuantizationFlags {
|
||||
uint32_t using_qmatrix : 1;
|
||||
uint32_t diff_uv_delta : 1;
|
||||
uint32_t reserved : 30;
|
||||
} StdVideoAV1QuantizationFlags;
|
||||
|
||||
typedef struct StdVideoAV1Quantization {
|
||||
StdVideoAV1QuantizationFlags flags;
|
||||
uint8_t base_q_idx;
|
||||
int8_t DeltaQYDc;
|
||||
int8_t DeltaQUDc;
|
||||
int8_t DeltaQUAc;
|
||||
int8_t DeltaQVDc;
|
||||
int8_t DeltaQVAc;
|
||||
uint8_t qm_y;
|
||||
uint8_t qm_u;
|
||||
uint8_t qm_v;
|
||||
} StdVideoAV1Quantization;
|
||||
|
||||
typedef struct StdVideoAV1Segmentation {
|
||||
uint8_t FeatureEnabled[STD_VIDEO_AV1_MAX_SEGMENTS];
|
||||
int16_t FeatureData[STD_VIDEO_AV1_MAX_SEGMENTS][STD_VIDEO_AV1_SEG_LVL_MAX];
|
||||
} StdVideoAV1Segmentation;
|
||||
|
||||
typedef struct StdVideoAV1TileInfoFlags {
|
||||
uint32_t uniform_tile_spacing_flag : 1;
|
||||
uint32_t reserved : 31;
|
||||
} StdVideoAV1TileInfoFlags;
|
||||
|
||||
typedef struct StdVideoAV1TileInfo {
|
||||
StdVideoAV1TileInfoFlags flags;
|
||||
uint8_t TileCols;
|
||||
uint8_t TileRows;
|
||||
uint16_t context_update_tile_id;
|
||||
uint8_t tile_size_bytes_minus_1;
|
||||
uint8_t reserved1[7];
|
||||
const uint16_t* pMiColStarts;
|
||||
const uint16_t* pMiRowStarts;
|
||||
const uint16_t* pWidthInSbsMinus1;
|
||||
const uint16_t* pHeightInSbsMinus1;
|
||||
} StdVideoAV1TileInfo;
|
||||
|
||||
typedef struct StdVideoAV1CDEF {
|
||||
uint8_t cdef_damping_minus_3;
|
||||
uint8_t cdef_bits;
|
||||
uint8_t cdef_y_pri_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS];
|
||||
uint8_t cdef_y_sec_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS];
|
||||
uint8_t cdef_uv_pri_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS];
|
||||
uint8_t cdef_uv_sec_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS];
|
||||
} StdVideoAV1CDEF;
|
||||
|
||||
typedef struct StdVideoAV1LoopRestoration {
|
||||
StdVideoAV1FrameRestorationType FrameRestorationType[STD_VIDEO_AV1_MAX_NUM_PLANES];
|
||||
uint16_t LoopRestorationSize[STD_VIDEO_AV1_MAX_NUM_PLANES];
|
||||
} StdVideoAV1LoopRestoration;
|
||||
|
||||
typedef struct StdVideoAV1GlobalMotion {
|
||||
uint8_t GmType[STD_VIDEO_AV1_NUM_REF_FRAMES];
|
||||
int32_t gm_params[STD_VIDEO_AV1_NUM_REF_FRAMES][STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS];
|
||||
} StdVideoAV1GlobalMotion;
|
||||
|
||||
typedef struct StdVideoAV1FilmGrainFlags {
|
||||
uint32_t chroma_scaling_from_luma : 1;
|
||||
uint32_t overlap_flag : 1;
|
||||
uint32_t clip_to_restricted_range : 1;
|
||||
uint32_t update_grain : 1;
|
||||
uint32_t reserved : 28;
|
||||
} StdVideoAV1FilmGrainFlags;
|
||||
|
||||
typedef struct StdVideoAV1FilmGrain {
|
||||
StdVideoAV1FilmGrainFlags flags;
|
||||
uint8_t grain_scaling_minus_8;
|
||||
uint8_t ar_coeff_lag;
|
||||
uint8_t ar_coeff_shift_minus_6;
|
||||
uint8_t grain_scale_shift;
|
||||
uint16_t grain_seed;
|
||||
uint8_t film_grain_params_ref_idx;
|
||||
uint8_t num_y_points;
|
||||
uint8_t point_y_value[STD_VIDEO_AV1_MAX_NUM_Y_POINTS];
|
||||
uint8_t point_y_scaling[STD_VIDEO_AV1_MAX_NUM_Y_POINTS];
|
||||
uint8_t num_cb_points;
|
||||
uint8_t point_cb_value[STD_VIDEO_AV1_MAX_NUM_CB_POINTS];
|
||||
uint8_t point_cb_scaling[STD_VIDEO_AV1_MAX_NUM_CB_POINTS];
|
||||
uint8_t num_cr_points;
|
||||
uint8_t point_cr_value[STD_VIDEO_AV1_MAX_NUM_CR_POINTS];
|
||||
uint8_t point_cr_scaling[STD_VIDEO_AV1_MAX_NUM_CR_POINTS];
|
||||
int8_t ar_coeffs_y_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_LUMA];
|
||||
int8_t ar_coeffs_cb_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_CHROMA];
|
||||
int8_t ar_coeffs_cr_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_CHROMA];
|
||||
uint8_t cb_mult;
|
||||
uint8_t cb_luma_mult;
|
||||
uint16_t cb_offset;
|
||||
uint8_t cr_mult;
|
||||
uint8_t cr_luma_mult;
|
||||
uint16_t cr_offset;
|
||||
} StdVideoAV1FilmGrain;
|
||||
|
||||
typedef struct StdVideoAV1SequenceHeaderFlags {
|
||||
uint32_t still_picture : 1;
|
||||
uint32_t reduced_still_picture_header : 1;
|
||||
uint32_t use_128x128_superblock : 1;
|
||||
uint32_t enable_filter_intra : 1;
|
||||
uint32_t enable_intra_edge_filter : 1;
|
||||
uint32_t enable_interintra_compound : 1;
|
||||
uint32_t enable_masked_compound : 1;
|
||||
uint32_t enable_warped_motion : 1;
|
||||
uint32_t enable_dual_filter : 1;
|
||||
uint32_t enable_order_hint : 1;
|
||||
uint32_t enable_jnt_comp : 1;
|
||||
uint32_t enable_ref_frame_mvs : 1;
|
||||
uint32_t frame_id_numbers_present_flag : 1;
|
||||
uint32_t enable_superres : 1;
|
||||
uint32_t enable_cdef : 1;
|
||||
uint32_t enable_restoration : 1;
|
||||
uint32_t film_grain_params_present : 1;
|
||||
uint32_t timing_info_present_flag : 1;
|
||||
uint32_t initial_display_delay_present_flag : 1;
|
||||
uint32_t reserved : 13;
|
||||
} StdVideoAV1SequenceHeaderFlags;
|
||||
|
||||
typedef struct StdVideoAV1SequenceHeader {
|
||||
StdVideoAV1SequenceHeaderFlags flags;
|
||||
StdVideoAV1Profile seq_profile;
|
||||
uint8_t frame_width_bits_minus_1;
|
||||
uint8_t frame_height_bits_minus_1;
|
||||
uint16_t max_frame_width_minus_1;
|
||||
uint16_t max_frame_height_minus_1;
|
||||
uint8_t delta_frame_id_length_minus_2;
|
||||
uint8_t additional_frame_id_length_minus_1;
|
||||
uint8_t order_hint_bits_minus_1;
|
||||
uint8_t seq_force_integer_mv;
|
||||
uint8_t seq_force_screen_content_tools;
|
||||
uint8_t reserved1[5];
|
||||
const StdVideoAV1ColorConfig* pColorConfig;
|
||||
const StdVideoAV1TimingInfo* pTimingInfo;
|
||||
} StdVideoAV1SequenceHeader;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
109
include/vk_video/vulkan_video_codec_av1std_decode.h
Normal file
109
include/vk_video/vulkan_video_codec_av1std_decode.h
Normal file
|
@ -0,0 +1,109 @@
|
|||
#ifndef VULKAN_VIDEO_CODEC_AV1STD_DECODE_H_
|
||||
#define VULKAN_VIDEO_CODEC_AV1STD_DECODE_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// vulkan_video_codec_av1std_decode is a preprocessor guard. Do not pass it to API calls.
|
||||
#define vulkan_video_codec_av1std_decode 1
|
||||
#include "vulkan_video_codec_av1std.h"
|
||||
|
||||
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0)
|
||||
|
||||
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_API_VERSION_1_0_0
|
||||
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_av1_decode"
|
||||
typedef struct StdVideoDecodeAV1PictureInfoFlags {
|
||||
uint32_t error_resilient_mode : 1;
|
||||
uint32_t disable_cdf_update : 1;
|
||||
uint32_t use_superres : 1;
|
||||
uint32_t render_and_frame_size_different : 1;
|
||||
uint32_t allow_screen_content_tools : 1;
|
||||
uint32_t is_filter_switchable : 1;
|
||||
uint32_t force_integer_mv : 1;
|
||||
uint32_t frame_size_override_flag : 1;
|
||||
uint32_t buffer_removal_time_present_flag : 1;
|
||||
uint32_t allow_intrabc : 1;
|
||||
uint32_t frame_refs_short_signaling : 1;
|
||||
uint32_t allow_high_precision_mv : 1;
|
||||
uint32_t is_motion_mode_switchable : 1;
|
||||
uint32_t use_ref_frame_mvs : 1;
|
||||
uint32_t disable_frame_end_update_cdf : 1;
|
||||
uint32_t allow_warped_motion : 1;
|
||||
uint32_t reduced_tx_set : 1;
|
||||
uint32_t reference_select : 1;
|
||||
uint32_t skip_mode_present : 1;
|
||||
uint32_t delta_q_present : 1;
|
||||
uint32_t delta_lf_present : 1;
|
||||
uint32_t delta_lf_multi : 1;
|
||||
uint32_t segmentation_enabled : 1;
|
||||
uint32_t segmentation_update_map : 1;
|
||||
uint32_t segmentation_temporal_update : 1;
|
||||
uint32_t segmentation_update_data : 1;
|
||||
uint32_t UsesLr : 1;
|
||||
uint32_t usesChromaLr : 1;
|
||||
uint32_t apply_grain : 1;
|
||||
uint32_t reserved : 3;
|
||||
} StdVideoDecodeAV1PictureInfoFlags;
|
||||
|
||||
typedef struct StdVideoDecodeAV1PictureInfo {
|
||||
StdVideoDecodeAV1PictureInfoFlags flags;
|
||||
StdVideoAV1FrameType frame_type;
|
||||
uint32_t current_frame_id;
|
||||
uint8_t OrderHint;
|
||||
uint8_t primary_ref_frame;
|
||||
uint8_t refresh_frame_flags;
|
||||
uint8_t reserved1;
|
||||
StdVideoAV1InterpolationFilter interpolation_filter;
|
||||
StdVideoAV1TxMode TxMode;
|
||||
uint8_t delta_q_res;
|
||||
uint8_t delta_lf_res;
|
||||
uint8_t SkipModeFrame[STD_VIDEO_AV1_SKIP_MODE_FRAMES];
|
||||
uint8_t coded_denom;
|
||||
uint8_t reserved2[3];
|
||||
uint8_t OrderHints[STD_VIDEO_AV1_NUM_REF_FRAMES];
|
||||
uint32_t expectedFrameId[STD_VIDEO_AV1_NUM_REF_FRAMES];
|
||||
const StdVideoAV1TileInfo* pTileInfo;
|
||||
const StdVideoAV1Quantization* pQuantization;
|
||||
const StdVideoAV1Segmentation* pSegmentation;
|
||||
const StdVideoAV1LoopFilter* pLoopFilter;
|
||||
const StdVideoAV1CDEF* pCDEF;
|
||||
const StdVideoAV1LoopRestoration* pLoopRestoration;
|
||||
const StdVideoAV1GlobalMotion* pGlobalMotion;
|
||||
const StdVideoAV1FilmGrain* pFilmGrain;
|
||||
} StdVideoDecodeAV1PictureInfo;
|
||||
|
||||
typedef struct StdVideoDecodeAV1ReferenceInfoFlags {
|
||||
uint32_t disable_frame_end_update_cdf : 1;
|
||||
uint32_t segmentation_enabled : 1;
|
||||
uint32_t reserved : 30;
|
||||
} StdVideoDecodeAV1ReferenceInfoFlags;
|
||||
|
||||
typedef struct StdVideoDecodeAV1ReferenceInfo {
|
||||
StdVideoDecodeAV1ReferenceInfoFlags flags;
|
||||
uint8_t frame_type;
|
||||
uint8_t RefFrameSignBias;
|
||||
uint8_t OrderHint;
|
||||
uint8_t SavedOrderHints[STD_VIDEO_AV1_NUM_REF_FRAMES];
|
||||
} StdVideoDecodeAV1ReferenceInfo;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
143
include/vk_video/vulkan_video_codec_av1std_encode.h
Normal file
143
include/vk_video/vulkan_video_codec_av1std_encode.h
Normal file
|
@ -0,0 +1,143 @@
|
|||
#ifndef VULKAN_VIDEO_CODEC_AV1STD_ENCODE_H_
|
||||
#define VULKAN_VIDEO_CODEC_AV1STD_ENCODE_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// vulkan_video_codec_av1std_encode is a preprocessor guard. Do not pass it to API calls.
|
||||
#define vulkan_video_codec_av1std_encode 1
|
||||
#include "vulkan_video_codec_av1std.h"
|
||||
|
||||
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0)
|
||||
|
||||
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_API_VERSION_1_0_0
|
||||
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_av1_encode"
|
||||
typedef struct StdVideoEncodeAV1DecoderModelInfo {
|
||||
uint8_t buffer_delay_length_minus_1;
|
||||
uint8_t buffer_removal_time_length_minus_1;
|
||||
uint8_t frame_presentation_time_length_minus_1;
|
||||
uint8_t reserved1;
|
||||
uint32_t num_units_in_decoding_tick;
|
||||
} StdVideoEncodeAV1DecoderModelInfo;
|
||||
|
||||
typedef struct StdVideoEncodeAV1ExtensionHeader {
|
||||
uint8_t temporal_id;
|
||||
uint8_t spatial_id;
|
||||
} StdVideoEncodeAV1ExtensionHeader;
|
||||
|
||||
typedef struct StdVideoEncodeAV1OperatingPointInfoFlags {
|
||||
uint32_t decoder_model_present_for_this_op : 1;
|
||||
uint32_t low_delay_mode_flag : 1;
|
||||
uint32_t initial_display_delay_present_for_this_op : 1;
|
||||
uint32_t reserved : 29;
|
||||
} StdVideoEncodeAV1OperatingPointInfoFlags;
|
||||
|
||||
typedef struct StdVideoEncodeAV1OperatingPointInfo {
|
||||
StdVideoEncodeAV1OperatingPointInfoFlags flags;
|
||||
uint16_t operating_point_idc;
|
||||
uint8_t seq_level_idx;
|
||||
uint8_t seq_tier;
|
||||
uint32_t decoder_buffer_delay;
|
||||
uint32_t encoder_buffer_delay;
|
||||
uint8_t initial_display_delay_minus_1;
|
||||
} StdVideoEncodeAV1OperatingPointInfo;
|
||||
|
||||
typedef struct StdVideoEncodeAV1PictureInfoFlags {
|
||||
uint32_t error_resilient_mode : 1;
|
||||
uint32_t disable_cdf_update : 1;
|
||||
uint32_t use_superres : 1;
|
||||
uint32_t render_and_frame_size_different : 1;
|
||||
uint32_t allow_screen_content_tools : 1;
|
||||
uint32_t is_filter_switchable : 1;
|
||||
uint32_t force_integer_mv : 1;
|
||||
uint32_t frame_size_override_flag : 1;
|
||||
uint32_t buffer_removal_time_present_flag : 1;
|
||||
uint32_t allow_intrabc : 1;
|
||||
uint32_t frame_refs_short_signaling : 1;
|
||||
uint32_t allow_high_precision_mv : 1;
|
||||
uint32_t is_motion_mode_switchable : 1;
|
||||
uint32_t use_ref_frame_mvs : 1;
|
||||
uint32_t disable_frame_end_update_cdf : 1;
|
||||
uint32_t allow_warped_motion : 1;
|
||||
uint32_t reduced_tx_set : 1;
|
||||
uint32_t skip_mode_present : 1;
|
||||
uint32_t delta_q_present : 1;
|
||||
uint32_t delta_lf_present : 1;
|
||||
uint32_t delta_lf_multi : 1;
|
||||
uint32_t segmentation_enabled : 1;
|
||||
uint32_t segmentation_update_map : 1;
|
||||
uint32_t segmentation_temporal_update : 1;
|
||||
uint32_t segmentation_update_data : 1;
|
||||
uint32_t UsesLr : 1;
|
||||
uint32_t usesChromaLr : 1;
|
||||
uint32_t show_frame : 1;
|
||||
uint32_t showable_frame : 1;
|
||||
uint32_t reserved : 3;
|
||||
} StdVideoEncodeAV1PictureInfoFlags;
|
||||
|
||||
typedef struct StdVideoEncodeAV1PictureInfo {
|
||||
StdVideoEncodeAV1PictureInfoFlags flags;
|
||||
StdVideoAV1FrameType frame_type;
|
||||
uint32_t frame_presentation_time;
|
||||
uint32_t current_frame_id;
|
||||
uint8_t order_hint;
|
||||
uint8_t primary_ref_frame;
|
||||
uint8_t refresh_frame_flags;
|
||||
uint8_t coded_denom;
|
||||
uint16_t render_width_minus_1;
|
||||
uint16_t render_height_minus_1;
|
||||
StdVideoAV1InterpolationFilter interpolation_filter;
|
||||
StdVideoAV1TxMode TxMode;
|
||||
uint8_t delta_q_res;
|
||||
uint8_t delta_lf_res;
|
||||
uint8_t ref_order_hint[STD_VIDEO_AV1_NUM_REF_FRAMES];
|
||||
int8_t ref_frame_idx[STD_VIDEO_AV1_REFS_PER_FRAME];
|
||||
uint8_t reserved1[3];
|
||||
uint32_t delta_frame_id_minus_1[STD_VIDEO_AV1_REFS_PER_FRAME];
|
||||
const StdVideoAV1TileInfo* pTileInfo;
|
||||
const StdVideoAV1Quantization* pQuantization;
|
||||
const StdVideoAV1Segmentation* pSegmentation;
|
||||
const StdVideoAV1LoopFilter* pLoopFilter;
|
||||
const StdVideoAV1CDEF* pCDEF;
|
||||
const StdVideoAV1LoopRestoration* pLoopRestoration;
|
||||
const StdVideoAV1GlobalMotion* pGlobalMotion;
|
||||
const StdVideoEncodeAV1ExtensionHeader* pExtensionHeader;
|
||||
const uint32_t* pBufferRemovalTimes;
|
||||
} StdVideoEncodeAV1PictureInfo;
|
||||
|
||||
typedef struct StdVideoEncodeAV1ReferenceInfoFlags {
|
||||
uint32_t disable_frame_end_update_cdf : 1;
|
||||
uint32_t segmentation_enabled : 1;
|
||||
uint32_t reserved : 30;
|
||||
} StdVideoEncodeAV1ReferenceInfoFlags;
|
||||
|
||||
typedef struct StdVideoEncodeAV1ReferenceInfo {
|
||||
StdVideoEncodeAV1ReferenceInfoFlags flags;
|
||||
uint32_t RefFrameId;
|
||||
StdVideoAV1FrameType frame_type;
|
||||
uint8_t OrderHint;
|
||||
uint8_t reserved1[3];
|
||||
const StdVideoEncodeAV1ExtensionHeader* pExtensionHeader;
|
||||
} StdVideoEncodeAV1ReferenceInfo;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
312
include/vk_video/vulkan_video_codec_h264std.h
Normal file
312
include/vk_video/vulkan_video_codec_h264std.h
Normal file
|
@ -0,0 +1,312 @@
|
|||
#ifndef VULKAN_VIDEO_CODEC_H264STD_H_
|
||||
#define VULKAN_VIDEO_CODEC_H264STD_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// vulkan_video_codec_h264std is a preprocessor guard. Do not pass it to API calls.
|
||||
#define vulkan_video_codec_h264std 1
|
||||
#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
|
||||
#define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS 6
|
||||
#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,
|
||||
STD_VIDEO_H264_CHROMA_FORMAT_IDC_420 = 1,
|
||||
STD_VIDEO_H264_CHROMA_FORMAT_IDC_422 = 2,
|
||||
STD_VIDEO_H264_CHROMA_FORMAT_IDC_444 = 3,
|
||||
STD_VIDEO_H264_CHROMA_FORMAT_IDC_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_CHROMA_FORMAT_IDC_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264ChromaFormatIdc;
|
||||
|
||||
typedef enum StdVideoH264ProfileIdc {
|
||||
STD_VIDEO_H264_PROFILE_IDC_BASELINE = 66,
|
||||
STD_VIDEO_H264_PROFILE_IDC_MAIN = 77,
|
||||
STD_VIDEO_H264_PROFILE_IDC_HIGH = 100,
|
||||
STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE = 244,
|
||||
STD_VIDEO_H264_PROFILE_IDC_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_PROFILE_IDC_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264ProfileIdc;
|
||||
|
||||
typedef enum StdVideoH264LevelIdc {
|
||||
STD_VIDEO_H264_LEVEL_IDC_1_0 = 0,
|
||||
STD_VIDEO_H264_LEVEL_IDC_1_1 = 1,
|
||||
STD_VIDEO_H264_LEVEL_IDC_1_2 = 2,
|
||||
STD_VIDEO_H264_LEVEL_IDC_1_3 = 3,
|
||||
STD_VIDEO_H264_LEVEL_IDC_2_0 = 4,
|
||||
STD_VIDEO_H264_LEVEL_IDC_2_1 = 5,
|
||||
STD_VIDEO_H264_LEVEL_IDC_2_2 = 6,
|
||||
STD_VIDEO_H264_LEVEL_IDC_3_0 = 7,
|
||||
STD_VIDEO_H264_LEVEL_IDC_3_1 = 8,
|
||||
STD_VIDEO_H264_LEVEL_IDC_3_2 = 9,
|
||||
STD_VIDEO_H264_LEVEL_IDC_4_0 = 10,
|
||||
STD_VIDEO_H264_LEVEL_IDC_4_1 = 11,
|
||||
STD_VIDEO_H264_LEVEL_IDC_4_2 = 12,
|
||||
STD_VIDEO_H264_LEVEL_IDC_5_0 = 13,
|
||||
STD_VIDEO_H264_LEVEL_IDC_5_1 = 14,
|
||||
STD_VIDEO_H264_LEVEL_IDC_5_2 = 15,
|
||||
STD_VIDEO_H264_LEVEL_IDC_6_0 = 16,
|
||||
STD_VIDEO_H264_LEVEL_IDC_6_1 = 17,
|
||||
STD_VIDEO_H264_LEVEL_IDC_6_2 = 18,
|
||||
STD_VIDEO_H264_LEVEL_IDC_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_LEVEL_IDC_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264LevelIdc;
|
||||
|
||||
typedef enum StdVideoH264PocType {
|
||||
STD_VIDEO_H264_POC_TYPE_0 = 0,
|
||||
STD_VIDEO_H264_POC_TYPE_1 = 1,
|
||||
STD_VIDEO_H264_POC_TYPE_2 = 2,
|
||||
STD_VIDEO_H264_POC_TYPE_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_POC_TYPE_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264PocType;
|
||||
|
||||
typedef enum StdVideoH264AspectRatioIdc {
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_UNSPECIFIED = 0,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_SQUARE = 1,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_12_11 = 2,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_10_11 = 3,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_16_11 = 4,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_40_33 = 5,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_24_11 = 6,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_20_11 = 7,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_32_11 = 8,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_80_33 = 9,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_18_11 = 10,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_15_11 = 11,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_64_33 = 12,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_160_99 = 13,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_4_3 = 14,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_3_2 = 15,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_2_1 = 16,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_EXTENDED_SAR = 255,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_ASPECT_RATIO_IDC_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264AspectRatioIdc;
|
||||
|
||||
typedef enum StdVideoH264WeightedBipredIdc {
|
||||
STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_DEFAULT = 0,
|
||||
STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_EXPLICIT = 1,
|
||||
STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_IMPLICIT = 2,
|
||||
STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264WeightedBipredIdc;
|
||||
|
||||
typedef enum StdVideoH264ModificationOfPicNumsIdc {
|
||||
STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_SUBTRACT = 0,
|
||||
STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_ADD = 1,
|
||||
STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_LONG_TERM = 2,
|
||||
STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_END = 3,
|
||||
STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264ModificationOfPicNumsIdc;
|
||||
|
||||
typedef enum StdVideoH264MemMgmtControlOp {
|
||||
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_END = 0,
|
||||
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_SHORT_TERM = 1,
|
||||
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_LONG_TERM = 2,
|
||||
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_LONG_TERM = 3,
|
||||
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_SET_MAX_LONG_TERM_INDEX = 4,
|
||||
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_ALL = 5,
|
||||
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_CURRENT_AS_LONG_TERM = 6,
|
||||
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264MemMgmtControlOp;
|
||||
|
||||
typedef enum StdVideoH264CabacInitIdc {
|
||||
STD_VIDEO_H264_CABAC_INIT_IDC_0 = 0,
|
||||
STD_VIDEO_H264_CABAC_INIT_IDC_1 = 1,
|
||||
STD_VIDEO_H264_CABAC_INIT_IDC_2 = 2,
|
||||
STD_VIDEO_H264_CABAC_INIT_IDC_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_CABAC_INIT_IDC_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264CabacInitIdc;
|
||||
|
||||
typedef enum StdVideoH264DisableDeblockingFilterIdc {
|
||||
STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_DISABLED = 0,
|
||||
STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_ENABLED = 1,
|
||||
STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_PARTIAL = 2,
|
||||
STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264DisableDeblockingFilterIdc;
|
||||
|
||||
typedef enum StdVideoH264SliceType {
|
||||
STD_VIDEO_H264_SLICE_TYPE_P = 0,
|
||||
STD_VIDEO_H264_SLICE_TYPE_B = 1,
|
||||
STD_VIDEO_H264_SLICE_TYPE_I = 2,
|
||||
STD_VIDEO_H264_SLICE_TYPE_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_SLICE_TYPE_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264SliceType;
|
||||
|
||||
typedef enum StdVideoH264PictureType {
|
||||
STD_VIDEO_H264_PICTURE_TYPE_P = 0,
|
||||
STD_VIDEO_H264_PICTURE_TYPE_B = 1,
|
||||
STD_VIDEO_H264_PICTURE_TYPE_I = 2,
|
||||
STD_VIDEO_H264_PICTURE_TYPE_IDR = 5,
|
||||
STD_VIDEO_H264_PICTURE_TYPE_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_PICTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264PictureType;
|
||||
|
||||
typedef enum StdVideoH264NonVclNaluType {
|
||||
STD_VIDEO_H264_NON_VCL_NALU_TYPE_SPS = 0,
|
||||
STD_VIDEO_H264_NON_VCL_NALU_TYPE_PPS = 1,
|
||||
STD_VIDEO_H264_NON_VCL_NALU_TYPE_AUD = 2,
|
||||
STD_VIDEO_H264_NON_VCL_NALU_TYPE_PREFIX = 3,
|
||||
STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_SEQUENCE = 4,
|
||||
STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_STREAM = 5,
|
||||
STD_VIDEO_H264_NON_VCL_NALU_TYPE_PRECODED = 6,
|
||||
STD_VIDEO_H264_NON_VCL_NALU_TYPE_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H264_NON_VCL_NALU_TYPE_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH264NonVclNaluType;
|
||||
typedef struct StdVideoH264SpsVuiFlags {
|
||||
uint32_t aspect_ratio_info_present_flag : 1;
|
||||
uint32_t overscan_info_present_flag : 1;
|
||||
uint32_t overscan_appropriate_flag : 1;
|
||||
uint32_t video_signal_type_present_flag : 1;
|
||||
uint32_t video_full_range_flag : 1;
|
||||
uint32_t color_description_present_flag : 1;
|
||||
uint32_t chroma_loc_info_present_flag : 1;
|
||||
uint32_t timing_info_present_flag : 1;
|
||||
uint32_t fixed_frame_rate_flag : 1;
|
||||
uint32_t bitstream_restriction_flag : 1;
|
||||
uint32_t nal_hrd_parameters_present_flag : 1;
|
||||
uint32_t vcl_hrd_parameters_present_flag : 1;
|
||||
} StdVideoH264SpsVuiFlags;
|
||||
|
||||
typedef struct StdVideoH264HrdParameters {
|
||||
uint8_t cpb_cnt_minus1;
|
||||
uint8_t bit_rate_scale;
|
||||
uint8_t cpb_size_scale;
|
||||
uint8_t reserved1;
|
||||
uint32_t bit_rate_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE];
|
||||
uint32_t cpb_size_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE];
|
||||
uint8_t cbr_flag[STD_VIDEO_H264_CPB_CNT_LIST_SIZE];
|
||||
uint32_t initial_cpb_removal_delay_length_minus1;
|
||||
uint32_t cpb_removal_delay_length_minus1;
|
||||
uint32_t dpb_output_delay_length_minus1;
|
||||
uint32_t time_offset_length;
|
||||
} StdVideoH264HrdParameters;
|
||||
|
||||
typedef struct StdVideoH264SequenceParameterSetVui {
|
||||
StdVideoH264SpsVuiFlags flags;
|
||||
StdVideoH264AspectRatioIdc aspect_ratio_idc;
|
||||
uint16_t sar_width;
|
||||
uint16_t sar_height;
|
||||
uint8_t video_format;
|
||||
uint8_t colour_primaries;
|
||||
uint8_t transfer_characteristics;
|
||||
uint8_t matrix_coefficients;
|
||||
uint32_t num_units_in_tick;
|
||||
uint32_t time_scale;
|
||||
uint8_t max_num_reorder_frames;
|
||||
uint8_t max_dec_frame_buffering;
|
||||
uint8_t chroma_sample_loc_type_top_field;
|
||||
uint8_t chroma_sample_loc_type_bottom_field;
|
||||
uint32_t reserved1;
|
||||
const StdVideoH264HrdParameters* pHrdParameters;
|
||||
} StdVideoH264SequenceParameterSetVui;
|
||||
|
||||
typedef struct StdVideoH264SpsFlags {
|
||||
uint32_t constraint_set0_flag : 1;
|
||||
uint32_t constraint_set1_flag : 1;
|
||||
uint32_t constraint_set2_flag : 1;
|
||||
uint32_t constraint_set3_flag : 1;
|
||||
uint32_t constraint_set4_flag : 1;
|
||||
uint32_t constraint_set5_flag : 1;
|
||||
uint32_t direct_8x8_inference_flag : 1;
|
||||
uint32_t mb_adaptive_frame_field_flag : 1;
|
||||
uint32_t frame_mbs_only_flag : 1;
|
||||
uint32_t delta_pic_order_always_zero_flag : 1;
|
||||
uint32_t separate_colour_plane_flag : 1;
|
||||
uint32_t gaps_in_frame_num_value_allowed_flag : 1;
|
||||
uint32_t qpprime_y_zero_transform_bypass_flag : 1;
|
||||
uint32_t frame_cropping_flag : 1;
|
||||
uint32_t seq_scaling_matrix_present_flag : 1;
|
||||
uint32_t vui_parameters_present_flag : 1;
|
||||
} StdVideoH264SpsFlags;
|
||||
|
||||
typedef struct StdVideoH264ScalingLists {
|
||||
uint16_t scaling_list_present_mask;
|
||||
uint16_t use_default_scaling_matrix_mask;
|
||||
uint8_t ScalingList4x4[STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS];
|
||||
uint8_t ScalingList8x8[STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS];
|
||||
} StdVideoH264ScalingLists;
|
||||
|
||||
typedef struct StdVideoH264SequenceParameterSet {
|
||||
StdVideoH264SpsFlags flags;
|
||||
StdVideoH264ProfileIdc profile_idc;
|
||||
StdVideoH264LevelIdc level_idc;
|
||||
StdVideoH264ChromaFormatIdc chroma_format_idc;
|
||||
uint8_t seq_parameter_set_id;
|
||||
uint8_t bit_depth_luma_minus8;
|
||||
uint8_t bit_depth_chroma_minus8;
|
||||
uint8_t log2_max_frame_num_minus4;
|
||||
StdVideoH264PocType pic_order_cnt_type;
|
||||
int32_t offset_for_non_ref_pic;
|
||||
int32_t offset_for_top_to_bottom_field;
|
||||
uint8_t log2_max_pic_order_cnt_lsb_minus4;
|
||||
uint8_t num_ref_frames_in_pic_order_cnt_cycle;
|
||||
uint8_t max_num_ref_frames;
|
||||
uint8_t reserved1;
|
||||
uint32_t pic_width_in_mbs_minus1;
|
||||
uint32_t pic_height_in_map_units_minus1;
|
||||
uint32_t frame_crop_left_offset;
|
||||
uint32_t frame_crop_right_offset;
|
||||
uint32_t frame_crop_top_offset;
|
||||
uint32_t frame_crop_bottom_offset;
|
||||
uint32_t reserved2;
|
||||
const int32_t* pOffsetForRefFrame;
|
||||
const StdVideoH264ScalingLists* pScalingLists;
|
||||
const StdVideoH264SequenceParameterSetVui* pSequenceParameterSetVui;
|
||||
} StdVideoH264SequenceParameterSet;
|
||||
|
||||
typedef struct StdVideoH264PpsFlags {
|
||||
uint32_t transform_8x8_mode_flag : 1;
|
||||
uint32_t redundant_pic_cnt_present_flag : 1;
|
||||
uint32_t constrained_intra_pred_flag : 1;
|
||||
uint32_t deblocking_filter_control_present_flag : 1;
|
||||
uint32_t weighted_pred_flag : 1;
|
||||
uint32_t bottom_field_pic_order_in_frame_present_flag : 1;
|
||||
uint32_t entropy_coding_mode_flag : 1;
|
||||
uint32_t pic_scaling_matrix_present_flag : 1;
|
||||
} StdVideoH264PpsFlags;
|
||||
|
||||
typedef struct StdVideoH264PictureParameterSet {
|
||||
StdVideoH264PpsFlags flags;
|
||||
uint8_t seq_parameter_set_id;
|
||||
uint8_t pic_parameter_set_id;
|
||||
uint8_t num_ref_idx_l0_default_active_minus1;
|
||||
uint8_t num_ref_idx_l1_default_active_minus1;
|
||||
StdVideoH264WeightedBipredIdc weighted_bipred_idc;
|
||||
int8_t pic_init_qp_minus26;
|
||||
int8_t pic_init_qs_minus26;
|
||||
int8_t chroma_qp_index_offset;
|
||||
int8_t second_chroma_qp_index_offset;
|
||||
const StdVideoH264ScalingLists* pScalingLists;
|
||||
} StdVideoH264PictureParameterSet;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
77
include/vk_video/vulkan_video_codec_h264std_decode.h
Normal file
77
include/vk_video/vulkan_video_codec_h264std_decode.h
Normal file
|
@ -0,0 +1,77 @@
|
|||
#ifndef VULKAN_VIDEO_CODEC_H264STD_DECODE_H_
|
||||
#define VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// vulkan_video_codec_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 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,
|
||||
STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_BOTTOM = 1,
|
||||
STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoDecodeH264FieldOrderCount;
|
||||
typedef struct StdVideoDecodeH264PictureInfoFlags {
|
||||
uint32_t field_pic_flag : 1;
|
||||
uint32_t is_intra : 1;
|
||||
uint32_t IdrPicFlag : 1;
|
||||
uint32_t bottom_field_flag : 1;
|
||||
uint32_t is_reference : 1;
|
||||
uint32_t complementary_field_pair : 1;
|
||||
} StdVideoDecodeH264PictureInfoFlags;
|
||||
|
||||
typedef struct StdVideoDecodeH264PictureInfo {
|
||||
StdVideoDecodeH264PictureInfoFlags flags;
|
||||
uint8_t seq_parameter_set_id;
|
||||
uint8_t pic_parameter_set_id;
|
||||
uint8_t reserved1;
|
||||
uint8_t reserved2;
|
||||
uint16_t frame_num;
|
||||
uint16_t idr_pic_id;
|
||||
int32_t PicOrderCnt[STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE];
|
||||
} StdVideoDecodeH264PictureInfo;
|
||||
|
||||
typedef struct StdVideoDecodeH264ReferenceInfoFlags {
|
||||
uint32_t top_field_flag : 1;
|
||||
uint32_t bottom_field_flag : 1;
|
||||
uint32_t used_for_long_term_reference : 1;
|
||||
uint32_t is_non_existing : 1;
|
||||
} StdVideoDecodeH264ReferenceInfoFlags;
|
||||
|
||||
typedef struct StdVideoDecodeH264ReferenceInfo {
|
||||
StdVideoDecodeH264ReferenceInfoFlags flags;
|
||||
uint16_t FrameNum;
|
||||
uint16_t reserved;
|
||||
int32_t PicOrderCnt[STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE];
|
||||
} StdVideoDecodeH264ReferenceInfo;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
147
include/vk_video/vulkan_video_codec_h264std_encode.h
Normal file
147
include/vk_video/vulkan_video_codec_h264std_encode.h
Normal file
|
@ -0,0 +1,147 @@
|
|||
#ifndef VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_
|
||||
#define VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// vulkan_video_codec_h264std_encode is a preprocessor guard. Do not pass it to API calls.
|
||||
#define vulkan_video_codec_h264std_encode 1
|
||||
#include "vulkan_video_codec_h264std.h"
|
||||
|
||||
#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;
|
||||
uint32_t chroma_weight_l0_flag;
|
||||
uint32_t luma_weight_l1_flag;
|
||||
uint32_t chroma_weight_l1_flag;
|
||||
} StdVideoEncodeH264WeightTableFlags;
|
||||
|
||||
typedef struct StdVideoEncodeH264WeightTable {
|
||||
StdVideoEncodeH264WeightTableFlags flags;
|
||||
uint8_t luma_log2_weight_denom;
|
||||
uint8_t chroma_log2_weight_denom;
|
||||
int8_t luma_weight_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF];
|
||||
int8_t luma_offset_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF];
|
||||
int8_t chroma_weight_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES];
|
||||
int8_t chroma_offset_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES];
|
||||
int8_t luma_weight_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF];
|
||||
int8_t luma_offset_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF];
|
||||
int8_t chroma_weight_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES];
|
||||
int8_t chroma_offset_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES];
|
||||
} StdVideoEncodeH264WeightTable;
|
||||
|
||||
typedef struct StdVideoEncodeH264SliceHeaderFlags {
|
||||
uint32_t direct_spatial_mv_pred_flag : 1;
|
||||
uint32_t num_ref_idx_active_override_flag : 1;
|
||||
uint32_t reserved : 30;
|
||||
} StdVideoEncodeH264SliceHeaderFlags;
|
||||
|
||||
typedef struct StdVideoEncodeH264PictureInfoFlags {
|
||||
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 {
|
||||
StdVideoH264ModificationOfPicNumsIdc modification_of_pic_nums_idc;
|
||||
uint16_t abs_diff_pic_num_minus1;
|
||||
uint16_t long_term_pic_num;
|
||||
} StdVideoEncodeH264RefListModEntry;
|
||||
|
||||
typedef struct StdVideoEncodeH264RefPicMarkingEntry {
|
||||
StdVideoH264MemMgmtControlOp memory_management_control_operation;
|
||||
uint16_t difference_of_pic_nums_minus1;
|
||||
uint16_t long_term_pic_num;
|
||||
uint16_t long_term_frame_idx;
|
||||
uint16_t max_long_term_frame_idx_plus1;
|
||||
} StdVideoEncodeH264RefPicMarkingEntry;
|
||||
|
||||
typedef struct StdVideoEncodeH264ReferenceListsInfo {
|
||||
StdVideoEncodeH264ReferenceListsInfoFlags flags;
|
||||
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 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 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 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;
|
||||
int8_t slice_alpha_c0_offset_div2;
|
||||
int8_t slice_beta_offset_div2;
|
||||
int8_t slice_qp_delta;
|
||||
uint8_t reserved1;
|
||||
StdVideoH264CabacInitIdc cabac_init_idc;
|
||||
StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc;
|
||||
const StdVideoEncodeH264WeightTable* pWeightTable;
|
||||
} StdVideoEncodeH264SliceHeader;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
446
include/vk_video/vulkan_video_codec_h265std.h
Normal file
446
include/vk_video/vulkan_video_codec_h265std.h
Normal file
|
@ -0,0 +1,446 @@
|
|||
#ifndef VULKAN_VIDEO_CODEC_H265STD_H_
|
||||
#define VULKAN_VIDEO_CODEC_H265STD_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// vulkan_video_codec_h265std is a preprocessor guard. Do not pass it to API calls.
|
||||
#define vulkan_video_codec_h265std 1
|
||||
#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
|
||||
#define STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS 64
|
||||
#define STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS 6
|
||||
#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_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,
|
||||
STD_VIDEO_H265_CHROMA_FORMAT_IDC_420 = 1,
|
||||
STD_VIDEO_H265_CHROMA_FORMAT_IDC_422 = 2,
|
||||
STD_VIDEO_H265_CHROMA_FORMAT_IDC_444 = 3,
|
||||
STD_VIDEO_H265_CHROMA_FORMAT_IDC_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H265_CHROMA_FORMAT_IDC_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH265ChromaFormatIdc;
|
||||
|
||||
typedef enum StdVideoH265ProfileIdc {
|
||||
STD_VIDEO_H265_PROFILE_IDC_MAIN = 1,
|
||||
STD_VIDEO_H265_PROFILE_IDC_MAIN_10 = 2,
|
||||
STD_VIDEO_H265_PROFILE_IDC_MAIN_STILL_PICTURE = 3,
|
||||
STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS = 4,
|
||||
STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS = 9,
|
||||
STD_VIDEO_H265_PROFILE_IDC_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H265_PROFILE_IDC_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH265ProfileIdc;
|
||||
|
||||
typedef enum StdVideoH265LevelIdc {
|
||||
STD_VIDEO_H265_LEVEL_IDC_1_0 = 0,
|
||||
STD_VIDEO_H265_LEVEL_IDC_2_0 = 1,
|
||||
STD_VIDEO_H265_LEVEL_IDC_2_1 = 2,
|
||||
STD_VIDEO_H265_LEVEL_IDC_3_0 = 3,
|
||||
STD_VIDEO_H265_LEVEL_IDC_3_1 = 4,
|
||||
STD_VIDEO_H265_LEVEL_IDC_4_0 = 5,
|
||||
STD_VIDEO_H265_LEVEL_IDC_4_1 = 6,
|
||||
STD_VIDEO_H265_LEVEL_IDC_5_0 = 7,
|
||||
STD_VIDEO_H265_LEVEL_IDC_5_1 = 8,
|
||||
STD_VIDEO_H265_LEVEL_IDC_5_2 = 9,
|
||||
STD_VIDEO_H265_LEVEL_IDC_6_0 = 10,
|
||||
STD_VIDEO_H265_LEVEL_IDC_6_1 = 11,
|
||||
STD_VIDEO_H265_LEVEL_IDC_6_2 = 12,
|
||||
STD_VIDEO_H265_LEVEL_IDC_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H265_LEVEL_IDC_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH265LevelIdc;
|
||||
|
||||
typedef enum StdVideoH265SliceType {
|
||||
STD_VIDEO_H265_SLICE_TYPE_B = 0,
|
||||
STD_VIDEO_H265_SLICE_TYPE_P = 1,
|
||||
STD_VIDEO_H265_SLICE_TYPE_I = 2,
|
||||
STD_VIDEO_H265_SLICE_TYPE_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H265_SLICE_TYPE_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH265SliceType;
|
||||
|
||||
typedef enum StdVideoH265PictureType {
|
||||
STD_VIDEO_H265_PICTURE_TYPE_P = 0,
|
||||
STD_VIDEO_H265_PICTURE_TYPE_B = 1,
|
||||
STD_VIDEO_H265_PICTURE_TYPE_I = 2,
|
||||
STD_VIDEO_H265_PICTURE_TYPE_IDR = 3,
|
||||
STD_VIDEO_H265_PICTURE_TYPE_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H265_PICTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH265PictureType;
|
||||
|
||||
typedef enum StdVideoH265AspectRatioIdc {
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_UNSPECIFIED = 0,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_SQUARE = 1,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_12_11 = 2,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_10_11 = 3,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_16_11 = 4,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_40_33 = 5,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_24_11 = 6,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_20_11 = 7,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_32_11 = 8,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_80_33 = 9,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_18_11 = 10,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_15_11 = 11,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_64_33 = 12,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_160_99 = 13,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_4_3 = 14,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_3_2 = 15,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_2_1 = 16,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_EXTENDED_SAR = 255,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_INVALID = 0x7FFFFFFF,
|
||||
STD_VIDEO_H265_ASPECT_RATIO_IDC_MAX_ENUM = 0x7FFFFFFF
|
||||
} StdVideoH265AspectRatioIdc;
|
||||
typedef struct StdVideoH265DecPicBufMgr {
|
||||
uint32_t max_latency_increase_plus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE];
|
||||
uint8_t max_dec_pic_buffering_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE];
|
||||
uint8_t max_num_reorder_pics[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE];
|
||||
} StdVideoH265DecPicBufMgr;
|
||||
|
||||
typedef struct StdVideoH265SubLayerHrdParameters {
|
||||
uint32_t bit_rate_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE];
|
||||
uint32_t cpb_size_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE];
|
||||
uint32_t cpb_size_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE];
|
||||
uint32_t bit_rate_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE];
|
||||
uint32_t cbr_flag;
|
||||
} StdVideoH265SubLayerHrdParameters;
|
||||
|
||||
typedef struct StdVideoH265HrdFlags {
|
||||
uint32_t nal_hrd_parameters_present_flag : 1;
|
||||
uint32_t vcl_hrd_parameters_present_flag : 1;
|
||||
uint32_t sub_pic_hrd_params_present_flag : 1;
|
||||
uint32_t sub_pic_cpb_params_in_pic_timing_sei_flag : 1;
|
||||
uint32_t fixed_pic_rate_general_flag : 8;
|
||||
uint32_t fixed_pic_rate_within_cvs_flag : 8;
|
||||
uint32_t low_delay_hrd_flag : 8;
|
||||
} StdVideoH265HrdFlags;
|
||||
|
||||
typedef struct StdVideoH265HrdParameters {
|
||||
StdVideoH265HrdFlags flags;
|
||||
uint8_t tick_divisor_minus2;
|
||||
uint8_t du_cpb_removal_delay_increment_length_minus1;
|
||||
uint8_t dpb_output_delay_du_length_minus1;
|
||||
uint8_t bit_rate_scale;
|
||||
uint8_t cpb_size_scale;
|
||||
uint8_t cpb_size_du_scale;
|
||||
uint8_t initial_cpb_removal_delay_length_minus1;
|
||||
uint8_t au_cpb_removal_delay_length_minus1;
|
||||
uint8_t dpb_output_delay_length_minus1;
|
||||
uint8_t cpb_cnt_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE];
|
||||
uint16_t elemental_duration_in_tc_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE];
|
||||
uint16_t reserved[3];
|
||||
const StdVideoH265SubLayerHrdParameters* pSubLayerHrdParametersNal;
|
||||
const StdVideoH265SubLayerHrdParameters* pSubLayerHrdParametersVcl;
|
||||
} StdVideoH265HrdParameters;
|
||||
|
||||
typedef struct StdVideoH265VpsFlags {
|
||||
uint32_t vps_temporal_id_nesting_flag : 1;
|
||||
uint32_t vps_sub_layer_ordering_info_present_flag : 1;
|
||||
uint32_t vps_timing_info_present_flag : 1;
|
||||
uint32_t vps_poc_proportional_to_timing_flag : 1;
|
||||
} StdVideoH265VpsFlags;
|
||||
|
||||
typedef struct StdVideoH265ProfileTierLevelFlags {
|
||||
uint32_t general_tier_flag : 1;
|
||||
uint32_t general_progressive_source_flag : 1;
|
||||
uint32_t general_interlaced_source_flag : 1;
|
||||
uint32_t general_non_packed_constraint_flag : 1;
|
||||
uint32_t general_frame_only_constraint_flag : 1;
|
||||
} StdVideoH265ProfileTierLevelFlags;
|
||||
|
||||
typedef struct StdVideoH265ProfileTierLevel {
|
||||
StdVideoH265ProfileTierLevelFlags flags;
|
||||
StdVideoH265ProfileIdc general_profile_idc;
|
||||
StdVideoH265LevelIdc general_level_idc;
|
||||
} StdVideoH265ProfileTierLevel;
|
||||
|
||||
typedef struct StdVideoH265VideoParameterSet {
|
||||
StdVideoH265VpsFlags flags;
|
||||
uint8_t vps_video_parameter_set_id;
|
||||
uint8_t vps_max_sub_layers_minus1;
|
||||
uint8_t reserved1;
|
||||
uint8_t reserved2;
|
||||
uint32_t vps_num_units_in_tick;
|
||||
uint32_t vps_time_scale;
|
||||
uint32_t vps_num_ticks_poc_diff_one_minus1;
|
||||
uint32_t reserved3;
|
||||
const StdVideoH265DecPicBufMgr* pDecPicBufMgr;
|
||||
const StdVideoH265HrdParameters* pHrdParameters;
|
||||
const StdVideoH265ProfileTierLevel* pProfileTierLevel;
|
||||
} StdVideoH265VideoParameterSet;
|
||||
|
||||
typedef struct StdVideoH265ScalingLists {
|
||||
uint8_t ScalingList4x4[STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS];
|
||||
uint8_t ScalingList8x8[STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS];
|
||||
uint8_t ScalingList16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS];
|
||||
uint8_t ScalingList32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS];
|
||||
uint8_t ScalingListDCCoef16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS];
|
||||
uint8_t ScalingListDCCoef32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS];
|
||||
} StdVideoH265ScalingLists;
|
||||
|
||||
typedef struct StdVideoH265SpsVuiFlags {
|
||||
uint32_t aspect_ratio_info_present_flag : 1;
|
||||
uint32_t overscan_info_present_flag : 1;
|
||||
uint32_t overscan_appropriate_flag : 1;
|
||||
uint32_t video_signal_type_present_flag : 1;
|
||||
uint32_t video_full_range_flag : 1;
|
||||
uint32_t colour_description_present_flag : 1;
|
||||
uint32_t chroma_loc_info_present_flag : 1;
|
||||
uint32_t neutral_chroma_indication_flag : 1;
|
||||
uint32_t field_seq_flag : 1;
|
||||
uint32_t frame_field_info_present_flag : 1;
|
||||
uint32_t default_display_window_flag : 1;
|
||||
uint32_t vui_timing_info_present_flag : 1;
|
||||
uint32_t vui_poc_proportional_to_timing_flag : 1;
|
||||
uint32_t vui_hrd_parameters_present_flag : 1;
|
||||
uint32_t bitstream_restriction_flag : 1;
|
||||
uint32_t tiles_fixed_structure_flag : 1;
|
||||
uint32_t motion_vectors_over_pic_boundaries_flag : 1;
|
||||
uint32_t restricted_ref_pic_lists_flag : 1;
|
||||
} StdVideoH265SpsVuiFlags;
|
||||
|
||||
typedef struct StdVideoH265SequenceParameterSetVui {
|
||||
StdVideoH265SpsVuiFlags flags;
|
||||
StdVideoH265AspectRatioIdc aspect_ratio_idc;
|
||||
uint16_t sar_width;
|
||||
uint16_t sar_height;
|
||||
uint8_t video_format;
|
||||
uint8_t colour_primaries;
|
||||
uint8_t transfer_characteristics;
|
||||
uint8_t matrix_coeffs;
|
||||
uint8_t chroma_sample_loc_type_top_field;
|
||||
uint8_t chroma_sample_loc_type_bottom_field;
|
||||
uint8_t reserved1;
|
||||
uint8_t reserved2;
|
||||
uint16_t def_disp_win_left_offset;
|
||||
uint16_t def_disp_win_right_offset;
|
||||
uint16_t def_disp_win_top_offset;
|
||||
uint16_t def_disp_win_bottom_offset;
|
||||
uint32_t vui_num_units_in_tick;
|
||||
uint32_t vui_time_scale;
|
||||
uint32_t vui_num_ticks_poc_diff_one_minus1;
|
||||
uint16_t min_spatial_segmentation_idc;
|
||||
uint16_t reserved3;
|
||||
uint8_t max_bytes_per_pic_denom;
|
||||
uint8_t max_bits_per_min_cu_denom;
|
||||
uint8_t log2_max_mv_length_horizontal;
|
||||
uint8_t log2_max_mv_length_vertical;
|
||||
const StdVideoH265HrdParameters* pHrdParameters;
|
||||
} StdVideoH265SequenceParameterSetVui;
|
||||
|
||||
typedef struct StdVideoH265PredictorPaletteEntries {
|
||||
uint16_t PredictorPaletteEntries[STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE][STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE];
|
||||
} StdVideoH265PredictorPaletteEntries;
|
||||
|
||||
typedef struct StdVideoH265SpsFlags {
|
||||
uint32_t sps_temporal_id_nesting_flag : 1;
|
||||
uint32_t separate_colour_plane_flag : 1;
|
||||
uint32_t conformance_window_flag : 1;
|
||||
uint32_t sps_sub_layer_ordering_info_present_flag : 1;
|
||||
uint32_t scaling_list_enabled_flag : 1;
|
||||
uint32_t sps_scaling_list_data_present_flag : 1;
|
||||
uint32_t amp_enabled_flag : 1;
|
||||
uint32_t sample_adaptive_offset_enabled_flag : 1;
|
||||
uint32_t pcm_enabled_flag : 1;
|
||||
uint32_t pcm_loop_filter_disabled_flag : 1;
|
||||
uint32_t long_term_ref_pics_present_flag : 1;
|
||||
uint32_t sps_temporal_mvp_enabled_flag : 1;
|
||||
uint32_t strong_intra_smoothing_enabled_flag : 1;
|
||||
uint32_t vui_parameters_present_flag : 1;
|
||||
uint32_t sps_extension_present_flag : 1;
|
||||
uint32_t sps_range_extension_flag : 1;
|
||||
uint32_t transform_skip_rotation_enabled_flag : 1;
|
||||
uint32_t transform_skip_context_enabled_flag : 1;
|
||||
uint32_t implicit_rdpcm_enabled_flag : 1;
|
||||
uint32_t explicit_rdpcm_enabled_flag : 1;
|
||||
uint32_t extended_precision_processing_flag : 1;
|
||||
uint32_t intra_smoothing_disabled_flag : 1;
|
||||
uint32_t high_precision_offsets_enabled_flag : 1;
|
||||
uint32_t persistent_rice_adaptation_enabled_flag : 1;
|
||||
uint32_t cabac_bypass_alignment_enabled_flag : 1;
|
||||
uint32_t sps_scc_extension_flag : 1;
|
||||
uint32_t sps_curr_pic_ref_enabled_flag : 1;
|
||||
uint32_t palette_mode_enabled_flag : 1;
|
||||
uint32_t sps_palette_predictor_initializers_present_flag : 1;
|
||||
uint32_t intra_boundary_filtering_disabled_flag : 1;
|
||||
} StdVideoH265SpsFlags;
|
||||
|
||||
typedef struct StdVideoH265ShortTermRefPicSetFlags {
|
||||
uint32_t inter_ref_pic_set_prediction_flag : 1;
|
||||
uint32_t delta_rps_sign : 1;
|
||||
} StdVideoH265ShortTermRefPicSetFlags;
|
||||
|
||||
typedef struct StdVideoH265ShortTermRefPicSet {
|
||||
StdVideoH265ShortTermRefPicSetFlags flags;
|
||||
uint32_t delta_idx_minus1;
|
||||
uint16_t use_delta_flag;
|
||||
uint16_t abs_delta_rps_minus1;
|
||||
uint16_t used_by_curr_pic_flag;
|
||||
uint16_t used_by_curr_pic_s0_flag;
|
||||
uint16_t used_by_curr_pic_s1_flag;
|
||||
uint16_t reserved1;
|
||||
uint8_t reserved2;
|
||||
uint8_t reserved3;
|
||||
uint8_t num_negative_pics;
|
||||
uint8_t num_positive_pics;
|
||||
uint16_t delta_poc_s0_minus1[STD_VIDEO_H265_MAX_DPB_SIZE];
|
||||
uint16_t delta_poc_s1_minus1[STD_VIDEO_H265_MAX_DPB_SIZE];
|
||||
} StdVideoH265ShortTermRefPicSet;
|
||||
|
||||
typedef struct StdVideoH265LongTermRefPicsSps {
|
||||
uint32_t used_by_curr_pic_lt_sps_flag;
|
||||
uint32_t lt_ref_pic_poc_lsb_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS];
|
||||
} StdVideoH265LongTermRefPicsSps;
|
||||
|
||||
typedef struct StdVideoH265SequenceParameterSet {
|
||||
StdVideoH265SpsFlags flags;
|
||||
StdVideoH265ChromaFormatIdc chroma_format_idc;
|
||||
uint32_t pic_width_in_luma_samples;
|
||||
uint32_t pic_height_in_luma_samples;
|
||||
uint8_t sps_video_parameter_set_id;
|
||||
uint8_t sps_max_sub_layers_minus1;
|
||||
uint8_t sps_seq_parameter_set_id;
|
||||
uint8_t bit_depth_luma_minus8;
|
||||
uint8_t bit_depth_chroma_minus8;
|
||||
uint8_t log2_max_pic_order_cnt_lsb_minus4;
|
||||
uint8_t log2_min_luma_coding_block_size_minus3;
|
||||
uint8_t log2_diff_max_min_luma_coding_block_size;
|
||||
uint8_t log2_min_luma_transform_block_size_minus2;
|
||||
uint8_t log2_diff_max_min_luma_transform_block_size;
|
||||
uint8_t max_transform_hierarchy_depth_inter;
|
||||
uint8_t max_transform_hierarchy_depth_intra;
|
||||
uint8_t num_short_term_ref_pic_sets;
|
||||
uint8_t num_long_term_ref_pics_sps;
|
||||
uint8_t pcm_sample_bit_depth_luma_minus1;
|
||||
uint8_t pcm_sample_bit_depth_chroma_minus1;
|
||||
uint8_t log2_min_pcm_luma_coding_block_size_minus3;
|
||||
uint8_t log2_diff_max_min_pcm_luma_coding_block_size;
|
||||
uint8_t reserved1;
|
||||
uint8_t reserved2;
|
||||
uint8_t palette_max_size;
|
||||
uint8_t delta_palette_max_predictor_size;
|
||||
uint8_t motion_vector_resolution_control_idc;
|
||||
uint8_t sps_num_palette_predictor_initializers_minus1;
|
||||
uint32_t conf_win_left_offset;
|
||||
uint32_t conf_win_right_offset;
|
||||
uint32_t conf_win_top_offset;
|
||||
uint32_t conf_win_bottom_offset;
|
||||
const StdVideoH265ProfileTierLevel* pProfileTierLevel;
|
||||
const StdVideoH265DecPicBufMgr* pDecPicBufMgr;
|
||||
const StdVideoH265ScalingLists* pScalingLists;
|
||||
const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSet;
|
||||
const StdVideoH265LongTermRefPicsSps* pLongTermRefPicsSps;
|
||||
const StdVideoH265SequenceParameterSetVui* pSequenceParameterSetVui;
|
||||
const StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntries;
|
||||
} StdVideoH265SequenceParameterSet;
|
||||
|
||||
typedef struct StdVideoH265PpsFlags {
|
||||
uint32_t dependent_slice_segments_enabled_flag : 1;
|
||||
uint32_t output_flag_present_flag : 1;
|
||||
uint32_t sign_data_hiding_enabled_flag : 1;
|
||||
uint32_t cabac_init_present_flag : 1;
|
||||
uint32_t constrained_intra_pred_flag : 1;
|
||||
uint32_t transform_skip_enabled_flag : 1;
|
||||
uint32_t cu_qp_delta_enabled_flag : 1;
|
||||
uint32_t pps_slice_chroma_qp_offsets_present_flag : 1;
|
||||
uint32_t weighted_pred_flag : 1;
|
||||
uint32_t weighted_bipred_flag : 1;
|
||||
uint32_t transquant_bypass_enabled_flag : 1;
|
||||
uint32_t tiles_enabled_flag : 1;
|
||||
uint32_t entropy_coding_sync_enabled_flag : 1;
|
||||
uint32_t uniform_spacing_flag : 1;
|
||||
uint32_t loop_filter_across_tiles_enabled_flag : 1;
|
||||
uint32_t pps_loop_filter_across_slices_enabled_flag : 1;
|
||||
uint32_t deblocking_filter_control_present_flag : 1;
|
||||
uint32_t deblocking_filter_override_enabled_flag : 1;
|
||||
uint32_t pps_deblocking_filter_disabled_flag : 1;
|
||||
uint32_t pps_scaling_list_data_present_flag : 1;
|
||||
uint32_t lists_modification_present_flag : 1;
|
||||
uint32_t slice_segment_header_extension_present_flag : 1;
|
||||
uint32_t pps_extension_present_flag : 1;
|
||||
uint32_t cross_component_prediction_enabled_flag : 1;
|
||||
uint32_t chroma_qp_offset_list_enabled_flag : 1;
|
||||
uint32_t pps_curr_pic_ref_enabled_flag : 1;
|
||||
uint32_t residual_adaptive_colour_transform_enabled_flag : 1;
|
||||
uint32_t pps_slice_act_qp_offsets_present_flag : 1;
|
||||
uint32_t pps_palette_predictor_initializers_present_flag : 1;
|
||||
uint32_t monochrome_palette_flag : 1;
|
||||
uint32_t pps_range_extension_flag : 1;
|
||||
} StdVideoH265PpsFlags;
|
||||
|
||||
typedef struct StdVideoH265PictureParameterSet {
|
||||
StdVideoH265PpsFlags flags;
|
||||
uint8_t pps_pic_parameter_set_id;
|
||||
uint8_t pps_seq_parameter_set_id;
|
||||
uint8_t sps_video_parameter_set_id;
|
||||
uint8_t num_extra_slice_header_bits;
|
||||
uint8_t num_ref_idx_l0_default_active_minus1;
|
||||
uint8_t num_ref_idx_l1_default_active_minus1;
|
||||
int8_t init_qp_minus26;
|
||||
uint8_t diff_cu_qp_delta_depth;
|
||||
int8_t pps_cb_qp_offset;
|
||||
int8_t pps_cr_qp_offset;
|
||||
int8_t pps_beta_offset_div2;
|
||||
int8_t pps_tc_offset_div2;
|
||||
uint8_t log2_parallel_merge_level_minus2;
|
||||
uint8_t log2_max_transform_skip_block_size_minus2;
|
||||
uint8_t diff_cu_chroma_qp_offset_depth;
|
||||
uint8_t chroma_qp_offset_list_len_minus1;
|
||||
int8_t cb_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE];
|
||||
int8_t cr_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE];
|
||||
uint8_t log2_sao_offset_scale_luma;
|
||||
uint8_t log2_sao_offset_scale_chroma;
|
||||
int8_t pps_act_y_qp_offset_plus5;
|
||||
int8_t pps_act_cb_qp_offset_plus5;
|
||||
int8_t pps_act_cr_qp_offset_plus3;
|
||||
uint8_t pps_num_palette_predictor_initializers;
|
||||
uint8_t luma_bit_depth_entry_minus8;
|
||||
uint8_t chroma_bit_depth_entry_minus8;
|
||||
uint8_t num_tile_columns_minus1;
|
||||
uint8_t num_tile_rows_minus1;
|
||||
uint8_t reserved1;
|
||||
uint8_t reserved2;
|
||||
uint16_t column_width_minus1[STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE];
|
||||
uint16_t row_height_minus1[STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE];
|
||||
uint32_t reserved3;
|
||||
const StdVideoH265ScalingLists* pScalingLists;
|
||||
const StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntries;
|
||||
} StdVideoH265PictureParameterSet;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
67
include/vk_video/vulkan_video_codec_h265std_decode.h
Normal file
67
include/vk_video/vulkan_video_codec_h265std_decode.h
Normal file
|
@ -0,0 +1,67 @@
|
|||
#ifndef VULKAN_VIDEO_CODEC_H265STD_DECODE_H_
|
||||
#define VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// vulkan_video_codec_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 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;
|
||||
uint32_t IsReference : 1;
|
||||
uint32_t short_term_ref_pic_set_sps_flag : 1;
|
||||
} StdVideoDecodeH265PictureInfoFlags;
|
||||
|
||||
typedef struct StdVideoDecodeH265PictureInfo {
|
||||
StdVideoDecodeH265PictureInfoFlags flags;
|
||||
uint8_t sps_video_parameter_set_id;
|
||||
uint8_t pps_seq_parameter_set_id;
|
||||
uint8_t pps_pic_parameter_set_id;
|
||||
uint8_t NumDeltaPocsOfRefRpsIdx;
|
||||
int32_t PicOrderCntVal;
|
||||
uint16_t NumBitsForSTRefPicSetInSlice;
|
||||
uint16_t reserved;
|
||||
uint8_t RefPicSetStCurrBefore[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE];
|
||||
uint8_t RefPicSetStCurrAfter[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE];
|
||||
uint8_t RefPicSetLtCurr[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE];
|
||||
} StdVideoDecodeH265PictureInfo;
|
||||
|
||||
typedef struct StdVideoDecodeH265ReferenceInfoFlags {
|
||||
uint32_t used_for_long_term_reference : 1;
|
||||
uint32_t unused_for_reference : 1;
|
||||
} StdVideoDecodeH265ReferenceInfoFlags;
|
||||
|
||||
typedef struct StdVideoDecodeH265ReferenceInfo {
|
||||
StdVideoDecodeH265ReferenceInfoFlags flags;
|
||||
int32_t PicOrderCntVal;
|
||||
} StdVideoDecodeH265ReferenceInfo;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
157
include/vk_video/vulkan_video_codec_h265std_encode.h
Normal file
157
include/vk_video/vulkan_video_codec_h265std_encode.h
Normal file
|
@ -0,0 +1,157 @@
|
|||
#ifndef VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_
|
||||
#define VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// vulkan_video_codec_h265std_encode is a preprocessor guard. Do not pass it to API calls.
|
||||
#define vulkan_video_codec_h265std_encode 1
|
||||
#include "vulkan_video_codec_h265std.h"
|
||||
|
||||
#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;
|
||||
uint16_t chroma_weight_l0_flag;
|
||||
uint16_t luma_weight_l1_flag;
|
||||
uint16_t chroma_weight_l1_flag;
|
||||
} StdVideoEncodeH265WeightTableFlags;
|
||||
|
||||
typedef struct StdVideoEncodeH265WeightTable {
|
||||
StdVideoEncodeH265WeightTableFlags flags;
|
||||
uint8_t luma_log2_weight_denom;
|
||||
int8_t delta_chroma_log2_weight_denom;
|
||||
int8_t delta_luma_weight_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF];
|
||||
int8_t luma_offset_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF];
|
||||
int8_t delta_chroma_weight_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES];
|
||||
int8_t delta_chroma_offset_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES];
|
||||
int8_t delta_luma_weight_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF];
|
||||
int8_t luma_offset_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF];
|
||||
int8_t delta_chroma_weight_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES];
|
||||
int8_t delta_chroma_offset_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES];
|
||||
} StdVideoEncodeH265WeightTable;
|
||||
|
||||
typedef struct StdVideoEncodeH265SliceSegmentHeaderFlags {
|
||||
uint32_t first_slice_segment_in_pic_flag : 1;
|
||||
uint32_t dependent_slice_segment_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;
|
||||
uint32_t mvd_l1_zero_flag : 1;
|
||||
uint32_t cabac_init_flag : 1;
|
||||
uint32_t cu_chroma_qp_offset_enabled_flag : 1;
|
||||
uint32_t deblocking_filter_override_flag : 1;
|
||||
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 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];
|
||||
uint8_t poc_lsb_lt[STD_VIDEO_H265_MAX_LONG_TERM_PICS];
|
||||
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];
|
||||
} StdVideoEncodeH265LongTermRefPics;
|
||||
|
||||
typedef struct StdVideoEncodeH265PictureInfo {
|
||||
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 pic_type;
|
||||
int32_t PicOrderCntVal;
|
||||
uint8_t TemporalId;
|
||||
} StdVideoEncodeH265ReferenceInfo;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
36
include/vk_video/vulkan_video_codecs_common.h
Normal file
36
include/vk_video/vulkan_video_codecs_common.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
#ifndef VULKAN_VIDEO_CODECS_COMMON_H_
|
||||
#define VULKAN_VIDEO_CODECS_COMMON_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// vulkan_video_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)))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,27 +1,11 @@
|
|||
//
|
||||
// File: vk_icd.h
|
||||
//
|
||||
/*
|
||||
* Copyright (c) 2015-2016 The Khronos Group Inc.
|
||||
* Copyright (c) 2015-2016 Valve Corporation
|
||||
* Copyright (c) 2015-2016 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.
|
||||
* Copyright 2015-2023 The Khronos Group Inc.
|
||||
* Copyright 2015-2023 Valve Corporation
|
||||
* Copyright 2015-2023 LunarG, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef VKICD_H
|
||||
#define VKICD_H
|
||||
#pragma once
|
||||
|
||||
#include "vulkan.h"
|
||||
#include <stdbool.h>
|
||||
|
@ -33,7 +17,7 @@
|
|||
// Version 2 - Add Loader/ICD Interface version negotiation
|
||||
// via vk_icdNegotiateLoaderICDInterfaceVersion.
|
||||
// Version 3 - Add ICD creation/destruction of KHR_surface objects.
|
||||
// Version 4 - Add unknown physical device extension qyering via
|
||||
// Version 4 - Add unknown physical device extension querying via
|
||||
// vk_icdGetPhysicalDeviceProcAddr.
|
||||
// Version 5 - Tells ICDs that the loader is now paying attention to the
|
||||
// application version of Vulkan passed into the ApplicationInfo
|
||||
|
@ -41,17 +25,55 @@
|
|||
// that if the loader is older, it should automatically fail a
|
||||
// call for any API version > 1.0. Otherwise, the loader will
|
||||
// manually determine if it can support the expected version.
|
||||
#define CURRENT_LOADER_ICD_INTERFACE_VERSION 5
|
||||
// Version 6 - Add support for vk_icdEnumerateAdapterPhysicalDevices.
|
||||
// Version 7 - If an ICD supports any of the following functions, they must be
|
||||
// queryable with vk_icdGetInstanceProcAddr:
|
||||
// vk_icdNegotiateLoaderICDInterfaceVersion
|
||||
// vk_icdGetPhysicalDeviceProcAddr
|
||||
// vk_icdEnumerateAdapterPhysicalDevices (Windows only)
|
||||
// In addition, these functions no longer need to be exported directly.
|
||||
// This version allows drivers provided through the extension
|
||||
// VK_LUNARG_direct_driver_loading be able to support the entire
|
||||
// Driver-Loader interface.
|
||||
|
||||
#define CURRENT_LOADER_ICD_INTERFACE_VERSION 7
|
||||
#define MIN_SUPPORTED_LOADER_ICD_INTERFACE_VERSION 0
|
||||
#define MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION 4
|
||||
typedef VkResult(VKAPI_PTR *PFN_vkNegotiateLoaderICDInterfaceVersion)(uint32_t *pVersion);
|
||||
|
||||
// Old typedefs that don't follow a proper naming convention but are preserved for compatibility
|
||||
typedef VkResult(VKAPI_PTR *PFN_vkNegotiateLoaderICDInterfaceVersion)(uint32_t *pVersion);
|
||||
// This is defined in vk_layer.h which will be found by the loader, but if an ICD is building against this
|
||||
// file directly, it won't be found.
|
||||
#ifndef PFN_GetPhysicalDeviceProcAddr
|
||||
typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char *pName);
|
||||
#endif
|
||||
|
||||
// Typedefs for loader/ICD interface
|
||||
typedef VkResult (VKAPI_PTR *PFN_vk_icdNegotiateLoaderICDInterfaceVersion)(uint32_t* pVersion);
|
||||
typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vk_icdGetInstanceProcAddr)(VkInstance instance, const char* pName);
|
||||
typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vk_icdGetPhysicalDeviceProcAddr)(VkInstance instance, const char* pName);
|
||||
#if defined(VK_USE_PLATFORM_WIN32_KHR)
|
||||
typedef VkResult (VKAPI_PTR *PFN_vk_icdEnumerateAdapterPhysicalDevices)(VkInstance instance, LUID adapterLUID,
|
||||
uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
|
||||
#endif
|
||||
|
||||
// Prototypes for loader/ICD interface
|
||||
#if !defined(VK_NO_PROTOTYPES)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pVersion);
|
||||
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(VkInstance instance, const char* pName);
|
||||
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetPhysicalDeviceProcAddr(VkInstance instance, const char* pName);
|
||||
#if defined(VK_USE_PLATFORM_WIN32_KHR)
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vk_icdEnumerateAdapterPhysicalDevices(VkInstance instance, LUID adapterLUID,
|
||||
uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The ICD must reserve space for a pointer for the loader's dispatch
|
||||
* table, at the start of <each object>.
|
||||
|
@ -88,7 +110,14 @@ typedef enum {
|
|||
VK_ICD_WSI_PLATFORM_ANDROID,
|
||||
VK_ICD_WSI_PLATFORM_MACOS,
|
||||
VK_ICD_WSI_PLATFORM_IOS,
|
||||
VK_ICD_WSI_PLATFORM_DISPLAY
|
||||
VK_ICD_WSI_PLATFORM_DISPLAY,
|
||||
VK_ICD_WSI_PLATFORM_HEADLESS,
|
||||
VK_ICD_WSI_PLATFORM_METAL,
|
||||
VK_ICD_WSI_PLATFORM_DIRECTFB,
|
||||
VK_ICD_WSI_PLATFORM_VI,
|
||||
VK_ICD_WSI_PLATFORM_GGP,
|
||||
VK_ICD_WSI_PLATFORM_SCREEN,
|
||||
VK_ICD_WSI_PLATFORM_FUCHSIA,
|
||||
} VkIcdWsiPlatform;
|
||||
|
||||
typedef struct {
|
||||
|
@ -135,6 +164,14 @@ typedef struct {
|
|||
} VkIcdSurfaceXlib;
|
||||
#endif // VK_USE_PLATFORM_XLIB_KHR
|
||||
|
||||
#ifdef VK_USE_PLATFORM_DIRECTFB_EXT
|
||||
typedef struct {
|
||||
VkIcdSurfaceBase base;
|
||||
IDirectFB *dfb;
|
||||
IDirectFBSurface *surface;
|
||||
} VkIcdSurfaceDirectFB;
|
||||
#endif // VK_USE_PLATFORM_DIRECTFB_EXT
|
||||
|
||||
#ifdef VK_USE_PLATFORM_ANDROID_KHR
|
||||
typedef struct {
|
||||
VkIcdSurfaceBase base;
|
||||
|
@ -156,6 +193,13 @@ typedef struct {
|
|||
} VkIcdSurfaceIOS;
|
||||
#endif // VK_USE_PLATFORM_IOS_MVK
|
||||
|
||||
#ifdef VK_USE_PLATFORM_GGP
|
||||
typedef struct {
|
||||
VkIcdSurfaceBase base;
|
||||
GgpStreamDescriptor streamDescriptor;
|
||||
} VkIcdSurfaceGgp;
|
||||
#endif // VK_USE_PLATFORM_GGP
|
||||
|
||||
typedef struct {
|
||||
VkIcdSurfaceBase base;
|
||||
VkDisplayModeKHR displayMode;
|
||||
|
@ -167,4 +211,34 @@ typedef struct {
|
|||
VkExtent2D imageExtent;
|
||||
} VkIcdSurfaceDisplay;
|
||||
|
||||
#endif // VKICD_H
|
||||
typedef struct {
|
||||
VkIcdSurfaceBase base;
|
||||
} VkIcdSurfaceHeadless;
|
||||
|
||||
#ifdef VK_USE_PLATFORM_METAL_EXT
|
||||
typedef struct {
|
||||
VkIcdSurfaceBase base;
|
||||
const CAMetalLayer *pLayer;
|
||||
} VkIcdSurfaceMetal;
|
||||
#endif // VK_USE_PLATFORM_METAL_EXT
|
||||
|
||||
#ifdef VK_USE_PLATFORM_VI_NN
|
||||
typedef struct {
|
||||
VkIcdSurfaceBase base;
|
||||
void *window;
|
||||
} VkIcdSurfaceVi;
|
||||
#endif // VK_USE_PLATFORM_VI_NN
|
||||
|
||||
#ifdef VK_USE_PLATFORM_SCREEN_QNX
|
||||
typedef struct {
|
||||
VkIcdSurfaceBase base;
|
||||
struct _screen_context *context;
|
||||
struct _screen_window *window;
|
||||
} VkIcdSurfaceScreen;
|
||||
#endif // VK_USE_PLATFORM_SCREEN_QNX
|
||||
|
||||
#ifdef VK_USE_PLATFORM_FUCHSIA
|
||||
typedef struct {
|
||||
VkIcdSurfaceBase base;
|
||||
} VkIcdSurfaceImagePipe;
|
||||
#endif // VK_USE_PLATFORM_FUCHSIA
|
||||
|
|
|
@ -1,39 +1,18 @@
|
|||
//
|
||||
// File: vk_layer.h
|
||||
//
|
||||
/*
|
||||
* Copyright (c) 2015-2017 The Khronos Group Inc.
|
||||
* Copyright (c) 2015-2017 Valve Corporation
|
||||
* Copyright (c) 2015-2017 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.
|
||||
* 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
|
||||
|
||||
/* Need to define dispatch table
|
||||
* Core struct can then have ptr to dispatch table at the top
|
||||
* Along with object ptrs for current and next OBJ
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "vulkan.h"
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
#define VK_LAYER_EXPORT __attribute__((visibility("default")))
|
||||
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
|
||||
#define VK_LAYER_EXPORT __attribute__((visibility("default")))
|
||||
#else
|
||||
#define VK_LAYER_EXPORT
|
||||
#endif
|
||||
#include "vulkan_core.h"
|
||||
|
||||
#define MAX_NUM_UNKNOWN_EXTS 250
|
||||
|
||||
|
@ -82,7 +61,9 @@ typedef VkResult(VKAPI_PTR *PFN_PhysDevExt)(VkPhysicalDevice phys_device);
|
|||
*/
|
||||
typedef enum VkLayerFunction_ {
|
||||
VK_LAYER_LINK_INFO = 0,
|
||||
VK_LOADER_DATA_CALLBACK = 1
|
||||
VK_LOADER_DATA_CALLBACK = 1,
|
||||
VK_LOADER_LAYER_CREATE_DEVICE_CALLBACK = 2,
|
||||
VK_LOADER_FEATURES = 3,
|
||||
} VkLayerFunction;
|
||||
|
||||
typedef struct VkLayerInstanceLink_ {
|
||||
|
@ -107,6 +88,14 @@ typedef VkResult (VKAPI_PTR *PFN_vkSetInstanceLoaderData)(VkInstance instance,
|
|||
void *object);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkSetDeviceLoaderData)(VkDevice device,
|
||||
void *object);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkLayerCreateDevice)(VkInstance instance, VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, PFN_vkGetInstanceProcAddr layerGIPA, PFN_vkGetDeviceProcAddr *nextGDPA);
|
||||
typedef void (VKAPI_PTR *PFN_vkLayerDestroyDevice)(VkDevice physicalDevice, const VkAllocationCallbacks *pAllocator, PFN_vkDestroyDevice destroyFunction);
|
||||
|
||||
typedef enum VkLoaderFeastureFlagBits {
|
||||
VK_LOADER_FEATURE_PHYSICAL_DEVICE_SORTING = 0x00000001,
|
||||
} VkLoaderFlagBits;
|
||||
typedef VkFlags VkLoaderFeatureFlags;
|
||||
|
||||
typedef struct {
|
||||
VkStructureType sType; // VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO
|
||||
|
@ -115,6 +104,11 @@ typedef struct {
|
|||
union {
|
||||
VkLayerInstanceLink *pLayerInfo;
|
||||
PFN_vkSetInstanceLoaderData pfnSetInstanceLoaderData;
|
||||
struct {
|
||||
PFN_vkLayerCreateDevice pfnLayerCreateDevice;
|
||||
PFN_vkLayerDestroyDevice pfnLayerDestroyDevice;
|
||||
} layerDevice;
|
||||
VkLoaderFeatureFlags loaderFeatures;
|
||||
} u;
|
||||
} VkLayerInstanceCreateInfo;
|
||||
|
||||
|
|
|
@ -2,19 +2,9 @@
|
|||
// File: vk_platform.h
|
||||
//
|
||||
/*
|
||||
** Copyright (c) 2014-2017 The Khronos Group Inc.
|
||||
** Copyright 2014-2025 The Khronos Group 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
|
||||
*/
|
||||
|
||||
|
||||
|
@ -52,7 +42,7 @@ extern "C"
|
|||
#define VKAPI_CALL __stdcall
|
||||
#define VKAPI_PTR VKAPI_CALL
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
|
||||
#error "Vulkan isn't supported for the 'armeabi' NDK ABI"
|
||||
#error "Vulkan is not supported for the 'armeabi' NDK ABI"
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
|
||||
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
|
||||
// calling convention, i.e. float parameters are passed in registers. This
|
||||
|
@ -68,7 +58,9 @@ extern "C"
|
|||
#define VKAPI_PTR
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#if !defined(VK_NO_STDDEF_H)
|
||||
#include <stddef.h>
|
||||
#endif // !defined(VK_NO_STDDEF_H)
|
||||
|
||||
#if !defined(VK_NO_STDINT_H)
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
//
|
||||
// File: vk_sdk_platform.h
|
||||
//
|
||||
/*
|
||||
* Copyright (c) 2015-2016 The Khronos Group Inc.
|
||||
* Copyright (c) 2015-2016 Valve Corporation
|
||||
* Copyright (c) 2015-2016 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.
|
||||
*/
|
||||
|
||||
#ifndef VK_SDK_PLATFORM_H
|
||||
#define VK_SDK_PLATFORM_H
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define NOMINMAX
|
||||
#ifndef __cplusplus
|
||||
#undef inline
|
||||
#define inline __inline
|
||||
#endif // __cplusplus
|
||||
|
||||
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/)
|
||||
// C99:
|
||||
// Microsoft didn't implement C99 in Visual Studio; but started adding it with
|
||||
// VS2013. However, VS2013 still didn't have snprintf(). The following is a
|
||||
// work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the
|
||||
// "CMakeLists.txt" file).
|
||||
// NOTE: This is fixed in Visual Studio 2015.
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
#define strdup _strdup
|
||||
|
||||
#endif // _WIN32
|
||||
|
||||
// Check for noexcept support using clang, with fallback to Windows or GCC version numbers
|
||||
#ifndef NOEXCEPT
|
||||
#if defined(__clang__)
|
||||
#if __has_feature(cxx_noexcept)
|
||||
#define HAS_NOEXCEPT
|
||||
#endif
|
||||
#else
|
||||
#if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46
|
||||
#define HAS_NOEXCEPT
|
||||
#else
|
||||
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS
|
||||
#define HAS_NOEXCEPT
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAS_NOEXCEPT
|
||||
#define NOEXCEPT noexcept
|
||||
#else
|
||||
#define NOEXCEPT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // VK_SDK_PLATFORM_H
|
8607
include/vulkan/vulkan.cppm
Normal file
8607
include/vulkan/vulkan.cppm
Normal file
File diff suppressed because it is too large
Load diff
|
@ -2,19 +2,9 @@
|
|||
#define VULKAN_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2025 The Khronos Group 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
|
||||
*/
|
||||
|
||||
#include "vk_platform.h"
|
||||
|
@ -24,6 +14,10 @@
|
|||
#include "vulkan_android.h"
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_FUCHSIA
|
||||
#include <zircon/types.h>
|
||||
#include "vulkan_fuchsia.h"
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_IOS_MVK
|
||||
#include "vulkan_ios.h"
|
||||
|
@ -34,20 +28,16 @@
|
|||
#include "vulkan_macos.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_MIR_KHR
|
||||
#include <mir_toolkit/client_types.h>
|
||||
#include "vulkan_mir.h"
|
||||
#ifdef VK_USE_PLATFORM_METAL_EXT
|
||||
#include "vulkan_metal.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_VI_NN
|
||||
#include "vulkan_vi.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||
#include <wayland-client.h>
|
||||
#include "vulkan_wayland.h"
|
||||
#endif
|
||||
|
||||
|
@ -70,10 +60,40 @@
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_DIRECTFB_EXT
|
||||
#include <directfb.h>
|
||||
#include "vulkan_directfb.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
#include "vulkan_xlib_xrandr.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_GGP
|
||||
#include <ggp_c/vulkan_types.h>
|
||||
#include "vulkan_ggp.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_SCREEN_QNX
|
||||
#include <screen/screen.h>
|
||||
#include "vulkan_screen.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_SCI
|
||||
#include <nvscisync.h>
|
||||
#include <nvscibuf.h>
|
||||
#include "vulkan_sci.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_ENABLE_BETA_EXTENSIONS
|
||||
#include "vulkan_beta.h"
|
||||
#endif
|
||||
|
||||
#endif // VULKAN_H_
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,24 +1,10 @@
|
|||
#ifndef VULKAN_ANDROID_H_
|
||||
#define VULKAN_ANDROID_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2025 The Khronos Group 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
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -27,14 +13,18 @@ extern "C" {
|
|||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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
|
||||
#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface"
|
||||
|
||||
typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkAndroidSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -42,7 +32,6 @@ typedef struct VkAndroidSurfaceCreateInfoKHR {
|
|||
struct ANativeWindow* window;
|
||||
} VkAndroidSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
|
@ -53,12 +42,12 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
|
|||
VkSurfaceKHR* pSurface);
|
||||
#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 3
|
||||
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 5
|
||||
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer"
|
||||
|
||||
typedef struct VkAndroidHardwareBufferUsageANDROID {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
|
@ -103,6 +92,18 @@ typedef struct VkExternalFormatANDROID {
|
|||
uint64_t externalFormat;
|
||||
} VkExternalFormatANDROID;
|
||||
|
||||
typedef struct VkAndroidHardwareBufferFormatProperties2ANDROID {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkFormat format;
|
||||
uint64_t externalFormat;
|
||||
VkFormatFeatureFlags2 formatFeatures;
|
||||
VkComponentMapping samplerYcbcrConversionComponents;
|
||||
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
|
||||
VkSamplerYcbcrRange suggestedYcbcrRange;
|
||||
VkChromaLocation suggestedXChromaOffset;
|
||||
VkChromaLocation suggestedYChromaOffset;
|
||||
} VkAndroidHardwareBufferFormatProperties2ANDROID;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);
|
||||
|
@ -119,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
|
||||
|
|
226
include/vulkan/vulkan_beta.h
Normal file
226
include/vulkan/vulkan_beta.h
Normal file
|
@ -0,0 +1,226 @@
|
|||
#ifndef VULKAN_BETA_H_
|
||||
#define VULKAN_BETA_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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"
|
||||
typedef struct VkPhysicalDevicePortabilitySubsetFeaturesKHR {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkBool32 constantAlphaColorBlendFactors;
|
||||
VkBool32 events;
|
||||
VkBool32 imageViewFormatReinterpretation;
|
||||
VkBool32 imageViewFormatSwizzle;
|
||||
VkBool32 imageView2DOn3DImage;
|
||||
VkBool32 multisampleArrayImage;
|
||||
VkBool32 mutableComparisonSamplers;
|
||||
VkBool32 pointPolygons;
|
||||
VkBool32 samplerMipLodBias;
|
||||
VkBool32 separateStencilMaskRef;
|
||||
VkBool32 shaderSampleRateInterpolationFunctions;
|
||||
VkBool32 tessellationIsolines;
|
||||
VkBool32 tessellationPointMode;
|
||||
VkBool32 triangleFans;
|
||||
VkBool32 vertexAttributeAccessBeyondStride;
|
||||
} VkPhysicalDevicePortabilitySubsetFeaturesKHR;
|
||||
|
||||
typedef struct VkPhysicalDevicePortabilitySubsetPropertiesKHR {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint32_t minVertexInputBindingStrideAlignment;
|
||||
} VkPhysicalDevicePortabilitySubsetPropertiesKHR;
|
||||
|
||||
|
||||
|
||||
// VK_AMDX_shader_enqueue is a preprocessor guard. Do not pass it to API calls.
|
||||
#define VK_AMDX_shader_enqueue 1
|
||||
#define VK_AMDX_SHADER_ENQUEUE_SPEC_VERSION 2
|
||||
#define VK_AMDX_SHADER_ENQUEUE_EXTENSION_NAME "VK_AMDX_shader_enqueue"
|
||||
#define VK_SHADER_INDEX_UNUSED_AMDX (~0U)
|
||||
typedef struct VkPhysicalDeviceShaderEnqueueFeaturesAMDX {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkBool32 shaderEnqueue;
|
||||
VkBool32 shaderMeshEnqueue;
|
||||
} VkPhysicalDeviceShaderEnqueueFeaturesAMDX;
|
||||
|
||||
typedef struct VkPhysicalDeviceShaderEnqueuePropertiesAMDX {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint32_t maxExecutionGraphDepth;
|
||||
uint32_t maxExecutionGraphShaderOutputNodes;
|
||||
uint32_t maxExecutionGraphShaderPayloadSize;
|
||||
uint32_t maxExecutionGraphShaderPayloadCount;
|
||||
uint32_t executionGraphDispatchAddressAlignment;
|
||||
uint32_t maxExecutionGraphWorkgroupCount[3];
|
||||
uint32_t maxExecutionGraphWorkgroups;
|
||||
} VkPhysicalDeviceShaderEnqueuePropertiesAMDX;
|
||||
|
||||
typedef struct VkExecutionGraphPipelineScratchSizeAMDX {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkDeviceSize minSize;
|
||||
VkDeviceSize maxSize;
|
||||
VkDeviceSize sizeGranularity;
|
||||
} VkExecutionGraphPipelineScratchSizeAMDX;
|
||||
|
||||
typedef struct VkExecutionGraphPipelineCreateInfoAMDX {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkPipelineCreateFlags flags;
|
||||
uint32_t stageCount;
|
||||
const VkPipelineShaderStageCreateInfo* pStages;
|
||||
const VkPipelineLibraryCreateInfoKHR* pLibraryInfo;
|
||||
VkPipelineLayout layout;
|
||||
VkPipeline basePipelineHandle;
|
||||
int32_t basePipelineIndex;
|
||||
} VkExecutionGraphPipelineCreateInfoAMDX;
|
||||
|
||||
typedef union VkDeviceOrHostAddressConstAMDX {
|
||||
VkDeviceAddress deviceAddress;
|
||||
const void* hostAddress;
|
||||
} VkDeviceOrHostAddressConstAMDX;
|
||||
|
||||
typedef struct VkDispatchGraphInfoAMDX {
|
||||
uint32_t nodeIndex;
|
||||
uint32_t payloadCount;
|
||||
VkDeviceOrHostAddressConstAMDX payloads;
|
||||
uint64_t payloadStride;
|
||||
} VkDispatchGraphInfoAMDX;
|
||||
|
||||
typedef struct VkDispatchGraphCountInfoAMDX {
|
||||
uint32_t count;
|
||||
VkDeviceOrHostAddressConstAMDX infos;
|
||||
uint64_t stride;
|
||||
} VkDispatchGraphCountInfoAMDX;
|
||||
|
||||
typedef struct VkPipelineShaderStageNodeCreateInfoAMDX {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
const char* pName;
|
||||
uint32_t index;
|
||||
} VkPipelineShaderStageNodeCreateInfoAMDX;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateExecutionGraphPipelinesAMDX)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineScratchSizeAMDX)(VkDevice device, VkPipeline executionGraph, VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineNodeIndexAMDX)(VkDevice device, VkPipeline executionGraph, const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo, uint32_t* pNodeIndex);
|
||||
typedef void (VKAPI_PTR *PFN_vkCmdInitializeGraphScratchMemoryAMDX)(VkCommandBuffer commandBuffer, VkPipeline executionGraph, VkDeviceAddress scratch, VkDeviceSize scratchSize);
|
||||
typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceSize scratchSize, const VkDispatchGraphCountInfoAMDX* pCountInfo);
|
||||
typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceSize scratchSize, const VkDispatchGraphCountInfoAMDX* pCountInfo);
|
||||
typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectCountAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceSize scratchSize, VkDeviceAddress countInfo);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR 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,
|
||||
VkPipeline executionGraph,
|
||||
VkDeviceAddress scratch,
|
||||
VkDeviceSize scratchSize);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphAMDX(
|
||||
VkCommandBuffer commandBuffer,
|
||||
VkDeviceAddress scratch,
|
||||
VkDeviceSize scratchSize,
|
||||
const VkDispatchGraphCountInfoAMDX* pCountInfo);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectAMDX(
|
||||
VkCommandBuffer commandBuffer,
|
||||
VkDeviceAddress scratch,
|
||||
VkDeviceSize scratchSize,
|
||||
const VkDispatchGraphCountInfoAMDX* pCountInfo);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectCountAMDX(
|
||||
VkCommandBuffer commandBuffer,
|
||||
VkDeviceAddress scratch,
|
||||
VkDeviceSize scratchSize,
|
||||
VkDeviceAddress countInfo);
|
||||
#endif
|
||||
|
||||
|
||||
// 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 2
|
||||
#define VK_NV_DISPLACEMENT_MICROMAP_EXTENSION_NAME "VK_NV_displacement_micromap"
|
||||
|
||||
typedef enum VkDisplacementMicromapFormatNV {
|
||||
VK_DISPLACEMENT_MICROMAP_FORMAT_64_TRIANGLES_64_BYTES_NV = 1,
|
||||
VK_DISPLACEMENT_MICROMAP_FORMAT_256_TRIANGLES_128_BYTES_NV = 2,
|
||||
VK_DISPLACEMENT_MICROMAP_FORMAT_1024_TRIANGLES_128_BYTES_NV = 3,
|
||||
VK_DISPLACEMENT_MICROMAP_FORMAT_MAX_ENUM_NV = 0x7FFFFFFF
|
||||
} VkDisplacementMicromapFormatNV;
|
||||
typedef struct VkPhysicalDeviceDisplacementMicromapFeaturesNV {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkBool32 displacementMicromap;
|
||||
} VkPhysicalDeviceDisplacementMicromapFeaturesNV;
|
||||
|
||||
typedef struct VkPhysicalDeviceDisplacementMicromapPropertiesNV {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint32_t maxDisplacementMicromapSubdivisionLevel;
|
||||
} VkPhysicalDeviceDisplacementMicromapPropertiesNV;
|
||||
|
||||
typedef struct VkAccelerationStructureTrianglesDisplacementMicromapNV {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkFormat displacementBiasAndScaleFormat;
|
||||
VkFormat displacementVectorFormat;
|
||||
VkDeviceOrHostAddressConstKHR displacementBiasAndScaleBuffer;
|
||||
VkDeviceSize displacementBiasAndScaleStride;
|
||||
VkDeviceOrHostAddressConstKHR displacementVectorBuffer;
|
||||
VkDeviceSize displacementVectorStride;
|
||||
VkDeviceOrHostAddressConstKHR displacedMicromapPrimitiveFlags;
|
||||
VkDeviceSize displacedMicromapPrimitiveFlagsStride;
|
||||
VkIndexType indexType;
|
||||
VkDeviceOrHostAddressConstKHR indexBuffer;
|
||||
VkDeviceSize indexStride;
|
||||
uint32_t baseTriangle;
|
||||
uint32_t usageCountsCount;
|
||||
const VkMicromapUsageEXT* pUsageCounts;
|
||||
const VkMicromapUsageEXT* const* ppUsageCounts;
|
||||
VkMicromapEXT micromap;
|
||||
} VkAccelerationStructureTrianglesDisplacementMicromapNV;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load diff
55
include/vulkan/vulkan_directfb.h
Normal file
55
include/vulkan/vulkan_directfb.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
#ifndef VULKAN_DIRECTFB_H_
|
||||
#define VULKAN_DIRECTFB_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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"
|
||||
typedef VkFlags VkDirectFBSurfaceCreateFlagsEXT;
|
||||
typedef struct VkDirectFBSurfaceCreateInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkDirectFBSurfaceCreateFlagsEXT flags;
|
||||
IDirectFB* dfb;
|
||||
IDirectFBSurface* surface;
|
||||
} VkDirectFBSurfaceCreateInfoEXT;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateDirectFBSurfaceEXT)(VkInstance instance, const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB* dfb);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateDirectFBSurfaceEXT(
|
||||
VkInstance instance,
|
||||
const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceDirectFBPresentationSupportEXT(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
IDirectFB* dfb);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
8903
include/vulkan/vulkan_enums.hpp
Normal file
8903
include/vulkan/vulkan_enums.hpp
Normal file
File diff suppressed because it is too large
Load diff
3594
include/vulkan/vulkan_extension_inspection.hpp
Normal file
3594
include/vulkan/vulkan_extension_inspection.hpp
Normal file
File diff suppressed because it is too large
Load diff
7669
include/vulkan/vulkan_format_traits.hpp
Normal file
7669
include/vulkan/vulkan_format_traits.hpp
Normal file
File diff suppressed because it is too large
Load diff
262
include/vulkan/vulkan_fuchsia.h
Normal file
262
include/vulkan/vulkan_fuchsia.h
Normal file
|
@ -0,0 +1,262 @@
|
|||
#ifndef VULKAN_FUCHSIA_H_
|
||||
#define VULKAN_FUCHSIA_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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"
|
||||
typedef VkFlags VkImagePipeSurfaceCreateFlagsFUCHSIA;
|
||||
typedef struct VkImagePipeSurfaceCreateInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkImagePipeSurfaceCreateFlagsFUCHSIA flags;
|
||||
zx_handle_t imagePipeHandle;
|
||||
} VkImagePipeSurfaceCreateInfoFUCHSIA;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateImagePipeSurfaceFUCHSIA)(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA(
|
||||
VkInstance instance,
|
||||
const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
#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"
|
||||
typedef struct VkImportMemoryZirconHandleInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkExternalMemoryHandleTypeFlagBits handleType;
|
||||
zx_handle_t handle;
|
||||
} VkImportMemoryZirconHandleInfoFUCHSIA;
|
||||
|
||||
typedef struct VkMemoryZirconHandlePropertiesFUCHSIA {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint32_t memoryTypeBits;
|
||||
} VkMemoryZirconHandlePropertiesFUCHSIA;
|
||||
|
||||
typedef struct VkMemoryGetZirconHandleInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkDeviceMemory memory;
|
||||
VkExternalMemoryHandleTypeFlagBits handleType;
|
||||
} VkMemoryGetZirconHandleInfoFUCHSIA;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryZirconHandleFUCHSIA)(VkDevice device, const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle, VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandleFUCHSIA(
|
||||
VkDevice device,
|
||||
const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
|
||||
zx_handle_t* pZirconHandle);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandlePropertiesFUCHSIA(
|
||||
VkDevice device,
|
||||
VkExternalMemoryHandleTypeFlagBits handleType,
|
||||
zx_handle_t zirconHandle,
|
||||
VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties);
|
||||
#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"
|
||||
typedef struct VkImportSemaphoreZirconHandleInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkSemaphore semaphore;
|
||||
VkSemaphoreImportFlags flags;
|
||||
VkExternalSemaphoreHandleTypeFlagBits handleType;
|
||||
zx_handle_t zirconHandle;
|
||||
} VkImportSemaphoreZirconHandleInfoFUCHSIA;
|
||||
|
||||
typedef struct VkSemaphoreGetZirconHandleInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkSemaphore semaphore;
|
||||
VkExternalSemaphoreHandleTypeFlagBits handleType;
|
||||
} VkSemaphoreGetZirconHandleInfoFUCHSIA;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreZirconHandleFUCHSIA)(VkDevice device, const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreZirconHandleFUCHSIA)(VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreZirconHandleFUCHSIA(
|
||||
VkDevice device,
|
||||
const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreZirconHandleFUCHSIA(
|
||||
VkDevice device,
|
||||
const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
|
||||
zx_handle_t* pZirconHandle);
|
||||
#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
|
||||
#define VK_FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME "VK_FUCHSIA_buffer_collection"
|
||||
typedef VkFlags VkImageFormatConstraintsFlagsFUCHSIA;
|
||||
|
||||
typedef enum VkImageConstraintsInfoFlagBitsFUCHSIA {
|
||||
VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA = 0x00000001,
|
||||
VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA = 0x00000002,
|
||||
VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA = 0x00000004,
|
||||
VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA = 0x00000008,
|
||||
VK_IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA = 0x00000010,
|
||||
VK_IMAGE_CONSTRAINTS_INFO_FLAG_BITS_MAX_ENUM_FUCHSIA = 0x7FFFFFFF
|
||||
} VkImageConstraintsInfoFlagBitsFUCHSIA;
|
||||
typedef VkFlags VkImageConstraintsInfoFlagsFUCHSIA;
|
||||
typedef struct VkBufferCollectionCreateInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
zx_handle_t collectionToken;
|
||||
} VkBufferCollectionCreateInfoFUCHSIA;
|
||||
|
||||
typedef struct VkImportMemoryBufferCollectionFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkBufferCollectionFUCHSIA collection;
|
||||
uint32_t index;
|
||||
} VkImportMemoryBufferCollectionFUCHSIA;
|
||||
|
||||
typedef struct VkBufferCollectionImageCreateInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkBufferCollectionFUCHSIA collection;
|
||||
uint32_t index;
|
||||
} VkBufferCollectionImageCreateInfoFUCHSIA;
|
||||
|
||||
typedef struct VkBufferCollectionConstraintsInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t minBufferCount;
|
||||
uint32_t maxBufferCount;
|
||||
uint32_t minBufferCountForCamping;
|
||||
uint32_t minBufferCountForDedicatedSlack;
|
||||
uint32_t minBufferCountForSharedSlack;
|
||||
} VkBufferCollectionConstraintsInfoFUCHSIA;
|
||||
|
||||
typedef struct VkBufferConstraintsInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkBufferCreateInfo createInfo;
|
||||
VkFormatFeatureFlags requiredFormatFeatures;
|
||||
VkBufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints;
|
||||
} VkBufferConstraintsInfoFUCHSIA;
|
||||
|
||||
typedef struct VkBufferCollectionBufferCreateInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkBufferCollectionFUCHSIA collection;
|
||||
uint32_t index;
|
||||
} VkBufferCollectionBufferCreateInfoFUCHSIA;
|
||||
|
||||
typedef struct VkSysmemColorSpaceFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t colorSpace;
|
||||
} VkSysmemColorSpaceFUCHSIA;
|
||||
|
||||
typedef struct VkBufferCollectionPropertiesFUCHSIA {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint32_t memoryTypeBits;
|
||||
uint32_t bufferCount;
|
||||
uint32_t createInfoIndex;
|
||||
uint64_t sysmemPixelFormat;
|
||||
VkFormatFeatureFlags formatFeatures;
|
||||
VkSysmemColorSpaceFUCHSIA sysmemColorSpaceIndex;
|
||||
VkComponentMapping samplerYcbcrConversionComponents;
|
||||
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
|
||||
VkSamplerYcbcrRange suggestedYcbcrRange;
|
||||
VkChromaLocation suggestedXChromaOffset;
|
||||
VkChromaLocation suggestedYChromaOffset;
|
||||
} VkBufferCollectionPropertiesFUCHSIA;
|
||||
|
||||
typedef struct VkImageFormatConstraintsInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkImageCreateInfo imageCreateInfo;
|
||||
VkFormatFeatureFlags requiredFormatFeatures;
|
||||
VkImageFormatConstraintsFlagsFUCHSIA flags;
|
||||
uint64_t sysmemPixelFormat;
|
||||
uint32_t colorSpaceCount;
|
||||
const VkSysmemColorSpaceFUCHSIA* pColorSpaces;
|
||||
} VkImageFormatConstraintsInfoFUCHSIA;
|
||||
|
||||
typedef struct VkImageConstraintsInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t formatConstraintsCount;
|
||||
const VkImageFormatConstraintsInfoFUCHSIA* pFormatConstraints;
|
||||
VkBufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints;
|
||||
VkImageConstraintsInfoFlagsFUCHSIA flags;
|
||||
} VkImageConstraintsInfoFUCHSIA;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateBufferCollectionFUCHSIA)(VkDevice device, const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferCollectionFUCHSIA* pCollection);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkSetBufferCollectionImageConstraintsFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo);
|
||||
typedef void (VKAPI_PTR *PFN_vkDestroyBufferCollectionFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, const VkAllocationCallbacks* pAllocator);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetBufferCollectionPropertiesFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, VkBufferCollectionPropertiesFUCHSIA* pProperties);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferCollectionFUCHSIA(
|
||||
VkDevice device,
|
||||
const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkBufferCollectionFUCHSIA* pCollection);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkSetBufferCollectionImageConstraintsFUCHSIA(
|
||||
VkDevice device,
|
||||
VkBufferCollectionFUCHSIA collection,
|
||||
const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkSetBufferCollectionBufferConstraintsFUCHSIA(
|
||||
VkDevice device,
|
||||
VkBufferCollectionFUCHSIA collection,
|
||||
const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL vkDestroyBufferCollectionFUCHSIA(
|
||||
VkDevice device,
|
||||
VkBufferCollectionFUCHSIA collection,
|
||||
const VkAllocationCallbacks* pAllocator);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetBufferCollectionPropertiesFUCHSIA(
|
||||
VkDevice device,
|
||||
VkBufferCollectionFUCHSIA collection,
|
||||
VkBufferCollectionPropertiesFUCHSIA* pProperties);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
31763
include/vulkan/vulkan_funcs.hpp
Normal file
31763
include/vulkan/vulkan_funcs.hpp
Normal file
File diff suppressed because it is too large
Load diff
60
include/vulkan/vulkan_ggp.h
Normal file
60
include/vulkan/vulkan_ggp.h
Normal file
|
@ -0,0 +1,60 @@
|
|||
#ifndef VULKAN_GGP_H_
|
||||
#define VULKAN_GGP_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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"
|
||||
typedef VkFlags VkStreamDescriptorSurfaceCreateFlagsGGP;
|
||||
typedef struct VkStreamDescriptorSurfaceCreateInfoGGP {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkStreamDescriptorSurfaceCreateFlagsGGP flags;
|
||||
GgpStreamDescriptor streamDescriptor;
|
||||
} VkStreamDescriptorSurfaceCreateInfoGGP;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateStreamDescriptorSurfaceGGP)(VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateStreamDescriptorSurfaceGGP(
|
||||
VkInstance instance,
|
||||
const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
#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"
|
||||
typedef struct VkPresentFrameTokenGGP {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
GgpFrameToken frameToken;
|
||||
} VkPresentFrameTokenGGP;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
20721
include/vulkan/vulkan_handles.hpp
Normal file
20721
include/vulkan/vulkan_handles.hpp
Normal file
File diff suppressed because it is too large
Load diff
18951
include/vulkan/vulkan_hash.hpp
Normal file
18951
include/vulkan/vulkan_hash.hpp
Normal file
File diff suppressed because it is too large
Load diff
326
include/vulkan/vulkan_hpp_macros.hpp
Normal file
326
include/vulkan/vulkan_hpp_macros.hpp
Normal file
|
@ -0,0 +1,326 @@
|
|||
// Copyright 2015-2025 The Khronos Group Inc.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
//
|
||||
|
||||
// This header is generated from the Khronos Vulkan XML API Registry.
|
||||
|
||||
#ifndef VULKAN_HPP_MACROS_HPP
|
||||
#define VULKAN_HPP_MACROS_HPP
|
||||
|
||||
#if defined( _MSVC_LANG )
|
||||
# define VULKAN_HPP_CPLUSPLUS _MSVC_LANG
|
||||
#else
|
||||
# define VULKAN_HPP_CPLUSPLUS __cplusplus
|
||||
#endif
|
||||
|
||||
#if 202002L < VULKAN_HPP_CPLUSPLUS
|
||||
# define VULKAN_HPP_CPP_VERSION 23
|
||||
#elif 201703L < VULKAN_HPP_CPLUSPLUS
|
||||
# define VULKAN_HPP_CPP_VERSION 20
|
||||
#elif 201402L < VULKAN_HPP_CPLUSPLUS
|
||||
# define VULKAN_HPP_CPP_VERSION 17
|
||||
#elif 201103L < VULKAN_HPP_CPLUSPLUS
|
||||
# define VULKAN_HPP_CPP_VERSION 14
|
||||
#elif 199711L < VULKAN_HPP_CPLUSPLUS
|
||||
# define VULKAN_HPP_CPP_VERSION 11
|
||||
#else
|
||||
# error "vulkan.hpp needs at least c++ standard version 11"
|
||||
#endif
|
||||
|
||||
// include headers holding feature-test macros
|
||||
#if 20 <= VULKAN_HPP_CPP_VERSION
|
||||
# include <version>
|
||||
#else
|
||||
# include <ciso646>
|
||||
#endif
|
||||
|
||||
#if defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
|
||||
# if !defined( VULKAN_HPP_NO_SMART_HANDLE )
|
||||
# define VULKAN_HPP_NO_SMART_HANDLE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined( VULKAN_HPP_NO_CONSTRUCTORS )
|
||||
# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS )
|
||||
# define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS
|
||||
# endif
|
||||
# if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS )
|
||||
# define VULKAN_HPP_NO_UNION_CONSTRUCTORS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined( VULKAN_HPP_NO_SETTERS )
|
||||
# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS )
|
||||
# define VULKAN_HPP_NO_STRUCT_SETTERS
|
||||
# endif
|
||||
# if !defined( VULKAN_HPP_NO_UNION_SETTERS )
|
||||
# define VULKAN_HPP_NO_UNION_SETTERS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_ASSERT )
|
||||
# define VULKAN_HPP_ASSERT assert
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_ASSERT_ON_RESULT )
|
||||
# define VULKAN_HPP_ASSERT_ON_RESULT VULKAN_HPP_ASSERT
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_STATIC_ASSERT )
|
||||
# define VULKAN_HPP_STATIC_ASSERT static_assert
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL )
|
||||
# define VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL 1
|
||||
#endif
|
||||
|
||||
#if !defined( __has_include )
|
||||
# define __has_include( x ) false
|
||||
#endif
|
||||
|
||||
#if ( 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
|
||||
|
||||
#if defined( __cpp_lib_modules ) && !defined( VULKAN_HPP_STD_MODULE ) && defined( VULKAN_HPP_ENABLE_STD_MODULE )
|
||||
# define VULKAN_HPP_STD_MODULE std.compat
|
||||
#endif
|
||||
|
||||
#ifndef VK_USE_64_BIT_PTR_DEFINES
|
||||
# if defined( __LP64__ ) || defined( _WIN64 ) || ( defined( __x86_64__ ) && !defined( __ILP32__ ) ) || defined( _M_X64 ) || defined( __ia64 ) || \
|
||||
defined( _M_IA64 ) || defined( __aarch64__ ) || defined( __powerpc64__ ) || ( defined( __riscv ) && __riscv_xlen == 64 )
|
||||
# define VK_USE_64_BIT_PTR_DEFINES 1
|
||||
# else
|
||||
# define VK_USE_64_BIT_PTR_DEFINES 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// 32-bit vulkan is not typesafe for non-dispatchable handles, so don't allow copy constructors on this platform by default.
|
||||
// To enable this feature on 32-bit platforms please #define VULKAN_HPP_TYPESAFE_CONVERSION 1
|
||||
// To disable this feature on 64-bit platforms please #define VULKAN_HPP_TYPESAFE_CONVERSION 0
|
||||
#if ( VK_USE_64_BIT_PTR_DEFINES == 1 )
|
||||
# if !defined( VULKAN_HPP_TYPESAFE_CONVERSION )
|
||||
# define VULKAN_HPP_TYPESAFE_CONVERSION 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined( __GNUC__ )
|
||||
# define GCC_VERSION ( __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ )
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_HAS_UNRESTRICTED_UNIONS )
|
||||
# if defined( __clang__ )
|
||||
# if __has_feature( cxx_unrestricted_unions )
|
||||
# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
|
||||
# endif
|
||||
# elif defined( __GNUC__ )
|
||||
# if 40600 <= GCC_VERSION
|
||||
# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
|
||||
# endif
|
||||
# elif defined( _MSC_VER )
|
||||
# if 1900 <= _MSC_VER
|
||||
# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_INLINE )
|
||||
# if defined( __clang__ )
|
||||
# if __has_attribute( always_inline )
|
||||
# define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__
|
||||
# else
|
||||
# define VULKAN_HPP_INLINE inline
|
||||
# endif
|
||||
# elif defined( __GNUC__ )
|
||||
# define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__
|
||||
# elif defined( _MSC_VER )
|
||||
# define VULKAN_HPP_INLINE inline
|
||||
# else
|
||||
# define VULKAN_HPP_INLINE inline
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if ( VULKAN_HPP_TYPESAFE_CONVERSION == 1 )
|
||||
# define VULKAN_HPP_TYPESAFE_EXPLICIT
|
||||
#else
|
||||
# define VULKAN_HPP_TYPESAFE_EXPLICIT explicit
|
||||
#endif
|
||||
|
||||
#if defined( __cpp_constexpr )
|
||||
# define VULKAN_HPP_CONSTEXPR constexpr
|
||||
# if 201304 <= __cpp_constexpr
|
||||
# define VULKAN_HPP_CONSTEXPR_14 constexpr
|
||||
# else
|
||||
# define VULKAN_HPP_CONSTEXPR_14
|
||||
# endif
|
||||
# if ( 201907 <= __cpp_constexpr ) && ( !defined( __GNUC__ ) || ( 110400 < GCC_VERSION ) )
|
||||
# define VULKAN_HPP_CONSTEXPR_20 constexpr
|
||||
# else
|
||||
# define VULKAN_HPP_CONSTEXPR_20
|
||||
# endif
|
||||
# define VULKAN_HPP_CONST_OR_CONSTEXPR constexpr
|
||||
#else
|
||||
# define VULKAN_HPP_CONSTEXPR
|
||||
# define VULKAN_HPP_CONSTEXPR_14
|
||||
# define VULKAN_HPP_CONST_OR_CONSTEXPR const
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_CONSTEXPR_INLINE )
|
||||
# if 201606L <= __cpp_inline_variables
|
||||
# define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR inline
|
||||
# else
|
||||
# define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_NOEXCEPT )
|
||||
# if defined( _MSC_VER ) && ( _MSC_VER <= 1800 )
|
||||
# define VULKAN_HPP_NOEXCEPT
|
||||
# else
|
||||
# define VULKAN_HPP_NOEXCEPT noexcept
|
||||
# define VULKAN_HPP_HAS_NOEXCEPT 1
|
||||
# if defined( VULKAN_HPP_NO_EXCEPTIONS )
|
||||
# define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS noexcept
|
||||
# else
|
||||
# define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if 14 <= VULKAN_HPP_CPP_VERSION
|
||||
# define VULKAN_HPP_DEPRECATED( msg ) [[deprecated( msg )]]
|
||||
#else
|
||||
# define VULKAN_HPP_DEPRECATED( msg )
|
||||
#endif
|
||||
|
||||
#if 17 <= VULKAN_HPP_CPP_VERSION
|
||||
# define VULKAN_HPP_DEPRECATED_17( msg ) [[deprecated( msg )]]
|
||||
#else
|
||||
# define VULKAN_HPP_DEPRECATED_17( msg )
|
||||
#endif
|
||||
|
||||
#if ( 17 <= VULKAN_HPP_CPP_VERSION ) && !defined( VULKAN_HPP_NO_NODISCARD_WARNINGS )
|
||||
# define VULKAN_HPP_NODISCARD [[nodiscard]]
|
||||
# if defined( VULKAN_HPP_NO_EXCEPTIONS )
|
||||
# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS [[nodiscard]]
|
||||
# else
|
||||
# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS
|
||||
# endif
|
||||
#else
|
||||
# define VULKAN_HPP_NODISCARD
|
||||
# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_NAMESPACE )
|
||||
# define VULKAN_HPP_NAMESPACE vk
|
||||
#endif
|
||||
|
||||
#define VULKAN_HPP_STRINGIFY2( text ) #text
|
||||
#define VULKAN_HPP_STRINGIFY( text ) VULKAN_HPP_STRINGIFY2( text )
|
||||
#define VULKAN_HPP_NAMESPACE_STRING VULKAN_HPP_STRINGIFY( VULKAN_HPP_NAMESPACE )
|
||||
|
||||
#if !defined( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC )
|
||||
# if defined( VK_NO_PROTOTYPES )
|
||||
# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1
|
||||
# else
|
||||
# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_STORAGE_API )
|
||||
# if defined( VULKAN_HPP_STORAGE_SHARED )
|
||||
# if defined( _MSC_VER )
|
||||
# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT )
|
||||
# define VULKAN_HPP_STORAGE_API __declspec( dllexport )
|
||||
# else
|
||||
# define VULKAN_HPP_STORAGE_API __declspec( dllimport )
|
||||
# endif
|
||||
# elif defined( __clang__ ) || defined( __GNUC__ )
|
||||
# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT )
|
||||
# define VULKAN_HPP_STORAGE_API __attribute__( ( visibility( "default" ) ) )
|
||||
# else
|
||||
# define VULKAN_HPP_STORAGE_API
|
||||
# endif
|
||||
# else
|
||||
# define VULKAN_HPP_STORAGE_API
|
||||
# pragma warning Unknown import / export semantics
|
||||
# endif
|
||||
# else
|
||||
# define VULKAN_HPP_STORAGE_API
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace VULKAN_HPP_NAMESPACE
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
class DispatchLoaderDynamic;
|
||||
|
||||
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
|
||||
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
|
||||
extern VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic;
|
||||
# endif
|
||||
#endif
|
||||
} // namespace detail
|
||||
} // namespace VULKAN_HPP_NAMESPACE
|
||||
|
||||
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
|
||||
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::defaultDispatchLoaderDynamic
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \
|
||||
namespace VULKAN_HPP_NAMESPACE \
|
||||
{ \
|
||||
namespace detail \
|
||||
{ \
|
||||
VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
|
||||
} \
|
||||
}
|
||||
# else
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::getDispatchLoaderStatic()
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER_TYPE )
|
||||
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderDynamic
|
||||
# else
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined( VULKAN_HPP_NO_DEFAULT_DISPATCHER )
|
||||
# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT
|
||||
# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT
|
||||
#else
|
||||
# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT = {}
|
||||
# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT = nullptr
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT = VULKAN_HPP_DEFAULT_DISPATCHER
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_EXPECTED ) && ( 23 <= VULKAN_HPP_CPP_VERSION ) && defined( __cpp_lib_expected )
|
||||
# if !( defined( VULKAN_HPP_ENABLE_STD_MODULE ) && defined( VULKAN_HPP_STD_MODULE ) )
|
||||
# include <expected>
|
||||
# endif
|
||||
# define VULKAN_HPP_EXPECTED std::expected
|
||||
# define VULKAN_HPP_UNEXPECTED std::unexpected
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_RAII_NAMESPACE )
|
||||
# define VULKAN_HPP_RAII_NAMESPACE raii
|
||||
#endif
|
||||
|
||||
#if defined( VULKAN_HPP_NO_EXCEPTIONS ) && defined( VULKAN_HPP_EXPECTED )
|
||||
# define VULKAN_HPP_RAII_NO_EXCEPTIONS
|
||||
# define VULKAN_HPP_RAII_CREATE_NOEXCEPT noexcept
|
||||
#else
|
||||
# define VULKAN_HPP_RAII_CREATE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,24 +1,10 @@
|
|||
#ifndef VULKAN_IOS_H_
|
||||
#define VULKAN_IOS_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2025 The Khronos Group 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
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -27,12 +13,17 @@ extern "C" {
|
|||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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 2
|
||||
#define VK_MVK_IOS_SURFACE_SPEC_VERSION 3
|
||||
#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface"
|
||||
|
||||
typedef VkFlags VkIOSSurfaceCreateFlagsMVK;
|
||||
|
||||
typedef struct VkIOSSurfaceCreateInfoMVK {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -40,7 +31,6 @@ typedef struct VkIOSSurfaceCreateInfoMVK {
|
|||
const void* pView;
|
||||
} VkIOSSurfaceCreateInfoMVK;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
|
|
|
@ -1,24 +1,10 @@
|
|||
#ifndef VULKAN_MACOS_H_
|
||||
#define VULKAN_MACOS_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2025 The Khronos Group 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
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -27,12 +13,17 @@ extern "C" {
|
|||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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 2
|
||||
#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 3
|
||||
#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface"
|
||||
|
||||
typedef VkFlags VkMacOSSurfaceCreateFlagsMVK;
|
||||
|
||||
typedef struct VkMacOSSurfaceCreateInfoMVK {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -40,7 +31,6 @@ typedef struct VkMacOSSurfaceCreateInfoMVK {
|
|||
const void* pView;
|
||||
} VkMacOSSurfaceCreateInfoMVK;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
|
|
236
include/vulkan/vulkan_metal.h
Normal file
236
include/vulkan/vulkan_metal.h
Normal file
|
@ -0,0 +1,236 @@
|
|||
#ifndef VULKAN_METAL_H_
|
||||
#define VULKAN_METAL_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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;
|
||||
#else
|
||||
typedef void CAMetalLayer;
|
||||
#endif
|
||||
|
||||
#define VK_EXT_METAL_SURFACE_SPEC_VERSION 1
|
||||
#define VK_EXT_METAL_SURFACE_EXTENSION_NAME "VK_EXT_metal_surface"
|
||||
typedef VkFlags VkMetalSurfaceCreateFlagsEXT;
|
||||
typedef struct VkMetalSurfaceCreateInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkMetalSurfaceCreateFlagsEXT flags;
|
||||
const CAMetalLayer* pLayer;
|
||||
} VkMetalSurfaceCreateInfoEXT;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateMetalSurfaceEXT)(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT(
|
||||
VkInstance instance,
|
||||
const VkMetalSurfaceCreateInfoEXT* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
#endif
|
||||
|
||||
|
||||
// VK_EXT_metal_objects is a preprocessor guard. Do not pass it to API calls.
|
||||
#define VK_EXT_metal_objects 1
|
||||
#ifdef __OBJC__
|
||||
@protocol MTLDevice;
|
||||
typedef __unsafe_unretained id<MTLDevice> MTLDevice_id;
|
||||
#else
|
||||
typedef void* MTLDevice_id;
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
@protocol MTLCommandQueue;
|
||||
typedef __unsafe_unretained id<MTLCommandQueue> MTLCommandQueue_id;
|
||||
#else
|
||||
typedef void* MTLCommandQueue_id;
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
@protocol MTLBuffer;
|
||||
typedef __unsafe_unretained id<MTLBuffer> MTLBuffer_id;
|
||||
#else
|
||||
typedef void* MTLBuffer_id;
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
@protocol MTLTexture;
|
||||
typedef __unsafe_unretained id<MTLTexture> MTLTexture_id;
|
||||
#else
|
||||
typedef void* MTLTexture_id;
|
||||
#endif
|
||||
|
||||
typedef struct __IOSurface* IOSurfaceRef;
|
||||
#ifdef __OBJC__
|
||||
@protocol MTLSharedEvent;
|
||||
typedef __unsafe_unretained id<MTLSharedEvent> MTLSharedEvent_id;
|
||||
#else
|
||||
typedef void* MTLSharedEvent_id;
|
||||
#endif
|
||||
|
||||
#define VK_EXT_METAL_OBJECTS_SPEC_VERSION 2
|
||||
#define VK_EXT_METAL_OBJECTS_EXTENSION_NAME "VK_EXT_metal_objects"
|
||||
|
||||
typedef enum VkExportMetalObjectTypeFlagBitsEXT {
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT = 0x00000001,
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT = 0x00000002,
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT = 0x00000004,
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT = 0x00000008,
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT = 0x00000010,
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT = 0x00000020,
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
|
||||
} VkExportMetalObjectTypeFlagBitsEXT;
|
||||
typedef VkFlags VkExportMetalObjectTypeFlagsEXT;
|
||||
typedef struct VkExportMetalObjectCreateInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkExportMetalObjectTypeFlagBitsEXT exportObjectType;
|
||||
} VkExportMetalObjectCreateInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalObjectsInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
} VkExportMetalObjectsInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalDeviceInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
MTLDevice_id mtlDevice;
|
||||
} VkExportMetalDeviceInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalCommandQueueInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkQueue queue;
|
||||
MTLCommandQueue_id mtlCommandQueue;
|
||||
} VkExportMetalCommandQueueInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalBufferInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkDeviceMemory memory;
|
||||
MTLBuffer_id mtlBuffer;
|
||||
} VkExportMetalBufferInfoEXT;
|
||||
|
||||
typedef struct VkImportMetalBufferInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
MTLBuffer_id mtlBuffer;
|
||||
} VkImportMetalBufferInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalTextureInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkImage image;
|
||||
VkImageView imageView;
|
||||
VkBufferView bufferView;
|
||||
VkImageAspectFlagBits plane;
|
||||
MTLTexture_id mtlTexture;
|
||||
} VkExportMetalTextureInfoEXT;
|
||||
|
||||
typedef struct VkImportMetalTextureInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkImageAspectFlagBits plane;
|
||||
MTLTexture_id mtlTexture;
|
||||
} VkImportMetalTextureInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalIOSurfaceInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkImage image;
|
||||
IOSurfaceRef ioSurface;
|
||||
} VkExportMetalIOSurfaceInfoEXT;
|
||||
|
||||
typedef struct VkImportMetalIOSurfaceInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
IOSurfaceRef ioSurface;
|
||||
} VkImportMetalIOSurfaceInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalSharedEventInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkSemaphore semaphore;
|
||||
VkEvent event;
|
||||
MTLSharedEvent_id mtlSharedEvent;
|
||||
} VkExportMetalSharedEventInfoEXT;
|
||||
|
||||
typedef struct VkImportMetalSharedEventInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
MTLSharedEvent_id mtlSharedEvent;
|
||||
} VkImportMetalSharedEventInfoEXT;
|
||||
|
||||
typedef void (VKAPI_PTR *PFN_vkExportMetalObjectsEXT)(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR void VKAPI_CALL vkExportMetalObjectsEXT(
|
||||
VkDevice device,
|
||||
VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
|
||||
#endif
|
||||
|
||||
|
||||
// VK_EXT_external_memory_metal is a preprocessor guard. Do not pass it to API calls.
|
||||
#define VK_EXT_external_memory_metal 1
|
||||
#define VK_EXT_EXTERNAL_MEMORY_METAL_SPEC_VERSION 1
|
||||
#define VK_EXT_EXTERNAL_MEMORY_METAL_EXTENSION_NAME "VK_EXT_external_memory_metal"
|
||||
typedef struct VkImportMemoryMetalHandleInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkExternalMemoryHandleTypeFlagBits handleType;
|
||||
void* handle;
|
||||
} VkImportMemoryMetalHandleInfoEXT;
|
||||
|
||||
typedef struct VkMemoryMetalHandlePropertiesEXT {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint32_t memoryTypeBits;
|
||||
} VkMemoryMetalHandlePropertiesEXT;
|
||||
|
||||
typedef struct VkMemoryGetMetalHandleInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkDeviceMemory memory;
|
||||
VkExternalMemoryHandleTypeFlagBits handleType;
|
||||
} VkMemoryGetMetalHandleInfoEXT;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryMetalHandleEXT)(VkDevice device, const VkMemoryGetMetalHandleInfoEXT* pGetMetalHandleInfo, void** pHandle);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryMetalHandlePropertiesEXT)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHandle, VkMemoryMetalHandlePropertiesEXT* pMemoryMetalHandleProperties);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryMetalHandleEXT(
|
||||
VkDevice device,
|
||||
const VkMemoryGetMetalHandleInfoEXT* pGetMetalHandleInfo,
|
||||
void** pHandle);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryMetalHandlePropertiesEXT(
|
||||
VkDevice device,
|
||||
VkExternalMemoryHandleTypeFlagBits handleType,
|
||||
const void* pHandle,
|
||||
VkMemoryMetalHandlePropertiesEXT* pMemoryMetalHandleProperties);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,65 +0,0 @@
|
|||
#ifndef VULKAN_MIR_H_
|
||||
#define VULKAN_MIR_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_KHR_mir_surface 1
|
||||
#define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
|
||||
#define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface"
|
||||
|
||||
typedef VkFlags VkMirSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkMirSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkMirSurfaceCreateFlagsKHR flags;
|
||||
MirConnection* connection;
|
||||
MirSurface* mirSurface;
|
||||
} VkMirSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR(
|
||||
VkInstance instance,
|
||||
const VkMirSurfaceCreateInfoKHR* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
MirConnection* connection);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
27542
include/vulkan/vulkan_raii.hpp
Normal file
27542
include/vulkan/vulkan_raii.hpp
Normal file
File diff suppressed because it is too large
Load diff
108
include/vulkan/vulkan_screen.h
Normal file
108
include/vulkan/vulkan_screen.h
Normal file
|
@ -0,0 +1,108 @@
|
|||
#ifndef VULKAN_SCREEN_H_
|
||||
#define VULKAN_SCREEN_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2025 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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"
|
||||
typedef VkFlags VkScreenSurfaceCreateFlagsQNX;
|
||||
typedef struct VkScreenSurfaceCreateInfoQNX {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkScreenSurfaceCreateFlagsQNX flags;
|
||||
struct _screen_context* context;
|
||||
struct _screen_window* window;
|
||||
} VkScreenSurfaceCreateInfoQNX;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateScreenSurfaceQNX)(VkInstance instance, const VkScreenSurfaceCreateInfoQNX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct _screen_window* window);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateScreenSurfaceQNX(
|
||||
VkInstance instance,
|
||||
const VkScreenSurfaceCreateInfoQNX* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceScreenPresentationSupportQNX(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
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
|
||||
|
||||
#endif
|
1175
include/vulkan/vulkan_shared.hpp
Normal file
1175
include/vulkan/vulkan_shared.hpp
Normal file
File diff suppressed because it is too large
Load diff
8639
include/vulkan/vulkan_static_assertions.hpp
Normal file
8639
include/vulkan/vulkan_static_assertions.hpp
Normal file
File diff suppressed because it is too large
Load diff
156972
include/vulkan/vulkan_structs.hpp
Normal file
156972
include/vulkan/vulkan_structs.hpp
Normal file
File diff suppressed because it is too large
Load diff
10064
include/vulkan/vulkan_to_string.hpp
Normal file
10064
include/vulkan/vulkan_to_string.hpp
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,24 +1,10 @@
|
|||
#ifndef VULKAN_VI_H_
|
||||
#define VULKAN_VI_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2025 The Khronos Group 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
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -27,12 +13,17 @@ extern "C" {
|
|||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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"
|
||||
|
||||
typedef VkFlags VkViSurfaceCreateFlagsNN;
|
||||
|
||||
typedef struct VkViSurfaceCreateInfoNN {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -40,7 +31,6 @@ typedef struct VkViSurfaceCreateInfoNN {
|
|||
void* window;
|
||||
} VkViSurfaceCreateInfoNN;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
|
|
4937
include/vulkan/vulkan_video.hpp
Normal file
4937
include/vulkan/vulkan_video.hpp
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,24 +1,10 @@
|
|||
#ifndef VULKAN_WAYLAND_H_
|
||||
#define VULKAN_WAYLAND_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2025 The Khronos Group 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
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -27,12 +13,17 @@ extern "C" {
|
|||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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"
|
||||
|
||||
typedef VkFlags VkWaylandSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkWaylandSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -41,7 +32,6 @@ typedef struct VkWaylandSurfaceCreateInfoKHR {
|
|||
struct wl_surface* surface;
|
||||
} VkWaylandSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display);
|
||||
|
||||
|
|
|
@ -1,24 +1,10 @@
|
|||
#ifndef VULKAN_WIN32_H_
|
||||
#define VULKAN_WIN32_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2025 The Khronos Group 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
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -27,12 +13,17 @@ extern "C" {
|
|||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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"
|
||||
|
||||
typedef VkFlags VkWin32SurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkWin32SurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -41,7 +32,6 @@ typedef struct VkWin32SurfaceCreateInfoKHR {
|
|||
HWND hwnd;
|
||||
} VkWin32SurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex);
|
||||
|
||||
|
@ -57,10 +47,11 @@ VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(
|
|||
uint32_t queueFamilyIndex);
|
||||
#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"
|
||||
|
||||
typedef struct VkImportMemoryWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -90,7 +81,6 @@ typedef struct VkMemoryGetWin32HandleInfoKHR {
|
|||
VkExternalMemoryHandleTypeFlagBits handleType;
|
||||
} VkMemoryGetWin32HandleInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
|
||||
|
||||
|
@ -107,10 +97,11 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(
|
|||
VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
|
||||
#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"
|
||||
|
||||
typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -125,10 +116,10 @@ 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"
|
||||
|
||||
typedef struct VkImportSemaphoreWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -163,7 +154,6 @@ typedef struct VkSemaphoreGetWin32HandleInfoKHR {
|
|||
VkExternalSemaphoreHandleTypeFlagBits handleType;
|
||||
} VkSemaphoreGetWin32HandleInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
|
||||
|
||||
|
@ -178,10 +168,11 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR(
|
|||
HANDLE* pHandle);
|
||||
#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"
|
||||
|
||||
typedef struct VkImportFenceWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -207,7 +198,6 @@ typedef struct VkFenceGetWin32HandleInfoKHR {
|
|||
VkExternalFenceHandleTypeFlagBits handleType;
|
||||
} VkFenceGetWin32HandleInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
|
||||
|
||||
|
@ -222,10 +212,11 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR(
|
|||
HANDLE* pHandle);
|
||||
#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"
|
||||
|
||||
typedef struct VkImportMemoryWin32HandleInfoNV {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -240,7 +231,6 @@ typedef struct VkExportMemoryWin32HandleInfoNV {
|
|||
DWORD dwAccess;
|
||||
} VkExportMemoryWin32HandleInfoNV;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
|
@ -251,10 +241,11 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(
|
|||
HANDLE* pHandle);
|
||||
#endif
|
||||
|
||||
#define VK_NV_win32_keyed_mutex 1
|
||||
#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
|
||||
#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
|
||||
|
||||
// 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"
|
||||
typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -269,6 +260,81 @@ 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"
|
||||
|
||||
typedef enum VkFullScreenExclusiveEXT {
|
||||
VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT = 0,
|
||||
VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT = 1,
|
||||
VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT = 2,
|
||||
VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT = 3,
|
||||
VK_FULL_SCREEN_EXCLUSIVE_MAX_ENUM_EXT = 0x7FFFFFFF
|
||||
} VkFullScreenExclusiveEXT;
|
||||
typedef struct VkSurfaceFullScreenExclusiveInfoEXT {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkFullScreenExclusiveEXT fullScreenExclusive;
|
||||
} VkSurfaceFullScreenExclusiveInfoEXT;
|
||||
|
||||
typedef struct VkSurfaceCapabilitiesFullScreenExclusiveEXT {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkBool32 fullScreenExclusiveSupported;
|
||||
} VkSurfaceCapabilitiesFullScreenExclusiveEXT;
|
||||
|
||||
typedef struct VkSurfaceFullScreenExclusiveWin32InfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
HMONITOR hmonitor;
|
||||
} VkSurfaceFullScreenExclusiveWin32InfoEXT;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkAcquireFullScreenExclusiveModeEXT)(VkDevice device, VkSwapchainKHR swapchain);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkReleaseFullScreenExclusiveModeEXT)(VkDevice device, VkSwapchainKHR swapchain);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModes2EXT)(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModes2EXT(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
|
||||
uint32_t* pPresentModeCount,
|
||||
VkPresentModeKHR* pPresentModes);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireFullScreenExclusiveModeEXT(
|
||||
VkDevice device,
|
||||
VkSwapchainKHR swapchain);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkReleaseFullScreenExclusiveModeEXT(
|
||||
VkDevice device,
|
||||
VkSwapchainKHR swapchain);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModes2EXT(
|
||||
VkDevice device,
|
||||
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
|
||||
VkDeviceGroupPresentModeFlagsKHR* pModes);
|
||||
#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"
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkAcquireWinrtDisplayNV)(VkPhysicalDevice physicalDevice, VkDisplayKHR display);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetWinrtDisplayNV)(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId, VkDisplayKHR* pDisplay);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireWinrtDisplayNV(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkDisplayKHR display);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetWinrtDisplayNV(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t deviceRelativeId,
|
||||
VkDisplayKHR* pDisplay);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,24 +1,10 @@
|
|||
#ifndef VULKAN_XCB_H_
|
||||
#define VULKAN_XCB_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2025 The Khronos Group 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
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -27,12 +13,17 @@ extern "C" {
|
|||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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"
|
||||
|
||||
typedef VkFlags VkXcbSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkXcbSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -41,7 +32,6 @@ typedef struct VkXcbSurfaceCreateInfoKHR {
|
|||
xcb_window_t window;
|
||||
} VkXcbSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id);
|
||||
|
||||
|
|
|
@ -1,24 +1,10 @@
|
|||
#ifndef VULKAN_XLIB_H_
|
||||
#define VULKAN_XLIB_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2025 The Khronos Group 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
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -27,12 +13,17 @@ extern "C" {
|
|||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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"
|
||||
|
||||
typedef VkFlags VkXlibSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkXlibSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
|
@ -41,7 +32,6 @@ typedef struct VkXlibSurfaceCreateInfoKHR {
|
|||
Window window;
|
||||
} VkXlibSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID);
|
||||
|
||||
|
|
|
@ -1,24 +1,10 @@
|
|||
#ifndef VULKAN_XLIB_XRANDR_H_
|
||||
#define VULKAN_XLIB_XRANDR_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2025 The Khronos Group 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
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -27,10 +13,16 @@ extern "C" {
|
|||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// 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"
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay);
|
||||
|
||||
|
|
21
registry/apiconventions.py
Normal file
21
registry/apiconventions.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env python3 -i
|
||||
#
|
||||
# Copyright 2021-2025 The Khronos Group Inc.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Generic alias for working group-specific API conventions interface.
|
||||
|
||||
# This import should be changed at the repository / working group level to
|
||||
# specify the correct API's conventions.
|
||||
|
||||
|
||||
import os
|
||||
|
||||
defaultAPI = 'vulkan'
|
||||
|
||||
VulkanAPI = os.getenv('VULKAN_API', default=defaultAPI)
|
||||
|
||||
if VulkanAPI == 'vulkansc':
|
||||
from vkconventions import VulkanSCConventions as APIConventions
|
||||
else:
|
||||
from vkconventions import VulkanConventions as APIConventions
|
803
registry/base_generator.py
Normal file
803
registry/base_generator.py
Normal file
|
@ -0,0 +1,803 @@
|
|||
#!/usr/bin/env python3 -i
|
||||
#
|
||||
# Copyright 2023-2025 The Khronos Group Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import pickle
|
||||
import os
|
||||
import tempfile
|
||||
from vulkan_object import (VulkanObject,
|
||||
Extension, Version, Handle, Param, Queues, CommandScope, Command,
|
||||
EnumField, Enum, Flag, Bitmask, Member, Struct,
|
||||
FormatComponent, FormatPlane, Format,
|
||||
SyncSupport, SyncEquivalent, SyncStage, SyncAccess, SyncPipelineStage, SyncPipeline,
|
||||
SpirvEnables, Spirv)
|
||||
|
||||
# These live in the Vulkan-Docs repo, but are pulled in via the
|
||||
# Vulkan-Headers/registry folder
|
||||
from generator import OutputGenerator, GeneratorOptions, write
|
||||
from vkconventions import VulkanConventions
|
||||
|
||||
# An API style convention object
|
||||
vulkanConventions = VulkanConventions()
|
||||
|
||||
# Helpers to keep things cleaner
|
||||
def splitIfGet(elem, name):
|
||||
return elem.get(name).split(',') if elem.get(name) is not None and elem.get(name) != '' else None
|
||||
|
||||
def textIfFind(elem, name):
|
||||
return elem.find(name).text if elem.find(name) is not None else None
|
||||
|
||||
def intIfGet(elem, name):
|
||||
return None if elem.get(name) is None else int(elem.get(name), 0)
|
||||
|
||||
def boolGet(elem, name) -> bool:
|
||||
return elem.get(name) is not None and elem.get(name) == "true"
|
||||
|
||||
def getQueues(elem) -> Queues:
|
||||
queues = 0
|
||||
queues_list = splitIfGet(elem, 'queues')
|
||||
if queues_list is not None:
|
||||
queues |= Queues.TRANSFER if 'transfer' in queues_list else 0
|
||||
queues |= Queues.GRAPHICS if 'graphics' in queues_list else 0
|
||||
queues |= Queues.COMPUTE if 'compute' in queues_list else 0
|
||||
queues |= Queues.PROTECTED if 'protected' in queues_list else 0
|
||||
queues |= Queues.SPARSE_BINDING if 'sparse_binding' in queues_list else 0
|
||||
queues |= Queues.OPTICAL_FLOW if 'opticalflow' in queues_list else 0
|
||||
queues |= Queues.DECODE if 'decode' in queues_list else 0
|
||||
queues |= Queues.ENCODE if 'encode' in queues_list else 0
|
||||
return queues
|
||||
|
||||
# Shared object used by Sync elements that do not have ones
|
||||
maxSyncSupport = SyncSupport(None, None, True)
|
||||
maxSyncEquivalent = SyncEquivalent(None, None, True)
|
||||
|
||||
# Helpers to set GeneratorOptions options globally
|
||||
def SetOutputFileName(fileName: str) -> None:
|
||||
global globalFileName
|
||||
globalFileName = fileName
|
||||
|
||||
def SetOutputDirectory(directory: str) -> None:
|
||||
global globalDirectory
|
||||
globalDirectory = directory
|
||||
|
||||
def SetTargetApiName(apiname: str) -> None:
|
||||
global globalApiName
|
||||
globalApiName = apiname
|
||||
|
||||
def SetMergedApiNames(names: str) -> None:
|
||||
global mergedApiNames
|
||||
mergedApiNames = names
|
||||
|
||||
cachingEnabled = False
|
||||
def EnableCaching() -> None:
|
||||
global cachingEnabled
|
||||
cachingEnabled = True
|
||||
|
||||
# This class is a container for any source code, data, or other behavior that is necessary to
|
||||
# customize the generator script for a specific target API variant (e.g. Vulkan SC). As such,
|
||||
# all of these API-specific interfaces and their use in the generator script are part of the
|
||||
# contract between this repository and its downstream users. Changing or removing any of these
|
||||
# interfaces or their use in the generator script will have downstream effects and thus
|
||||
# should be avoided unless absolutely necessary.
|
||||
class APISpecific:
|
||||
# Version object factory method
|
||||
@staticmethod
|
||||
def createApiVersion(targetApiName: str, name: str) -> Version:
|
||||
match targetApiName:
|
||||
|
||||
# Vulkan SC specific API version creation
|
||||
case 'vulkansc':
|
||||
nameApi = name.replace('VK_', 'VK_API_')
|
||||
nameApi = nameApi.replace('VKSC_', 'VKSC_API_')
|
||||
nameString = f'"{name}"'
|
||||
return Version(name, nameString, nameApi)
|
||||
|
||||
# Vulkan specific API version creation
|
||||
case 'vulkan':
|
||||
nameApi = name.replace('VK_', 'VK_API_')
|
||||
nameString = f'"{name}"'
|
||||
return Version(name, nameString, nameApi)
|
||||
|
||||
|
||||
# This Generator Option is used across all generators.
|
||||
# After years of use, it has shown that most the options are unified across each generator (file)
|
||||
# as it is easier to modify things per-file that need the difference
|
||||
class BaseGeneratorOptions(GeneratorOptions):
|
||||
def __init__(self,
|
||||
customFileName = None,
|
||||
customDirectory = None,
|
||||
customApiName = None):
|
||||
GeneratorOptions.__init__(self,
|
||||
conventions = vulkanConventions,
|
||||
filename = customFileName if customFileName else globalFileName,
|
||||
directory = customDirectory if customDirectory else globalDirectory,
|
||||
apiname = customApiName if customApiName else globalApiName,
|
||||
mergeApiNames = mergedApiNames,
|
||||
defaultExtensions = customApiName if customApiName else globalApiName,
|
||||
emitExtensions = '.*',
|
||||
emitSpirv = '.*',
|
||||
emitFormats = '.*')
|
||||
# These are used by the generator.py script
|
||||
self.apicall = 'VKAPI_ATTR '
|
||||
self.apientry = 'VKAPI_CALL '
|
||||
self.apientryp = 'VKAPI_PTR *'
|
||||
self.alignFuncParam = 48
|
||||
|
||||
#
|
||||
# This object handles all the parsing from reg.py generator scripts in the Vulkan-Headers
|
||||
# It will grab all the data and form it into a single object the rest of the generators will use
|
||||
class BaseGenerator(OutputGenerator):
|
||||
def __init__(self):
|
||||
OutputGenerator.__init__(self, None, None, None)
|
||||
self.vk = VulkanObject()
|
||||
self.targetApiName = globalApiName
|
||||
|
||||
# reg.py has a `self.featureName` but this is nicer because
|
||||
# it will be either the Version or Extension object
|
||||
self.currentExtension = None
|
||||
self.currentVersion = None
|
||||
|
||||
# Will map alias to promoted name
|
||||
# ex. ['VK_FILTER_CUBIC_IMG' : 'VK_FILTER_CUBIC_EXT']
|
||||
# When generating any code, there is no reason so use the old name
|
||||
self.enumAliasMap = dict()
|
||||
self.enumFieldAliasMap = dict()
|
||||
self.bitmaskAliasMap = dict()
|
||||
self.flagAliasMap = dict()
|
||||
self.structAliasMap = dict()
|
||||
self.handleAliasMap = dict()
|
||||
|
||||
def write(self, data):
|
||||
# Prevents having to check before writing
|
||||
if data is not None and data != "":
|
||||
write(data, file=self.outFile)
|
||||
|
||||
|
||||
def beginFile(self, genOpts):
|
||||
OutputGenerator.beginFile(self, genOpts)
|
||||
self.filename = genOpts.filename
|
||||
|
||||
# No gen*() command to get these, so do it manually
|
||||
for platform in self.registry.tree.findall('platforms/platform'):
|
||||
self.vk.platforms[platform.get('name')] = platform.get('protect')
|
||||
|
||||
for tags in self.registry.tree.findall('tags'):
|
||||
for tag in tags.findall('tag'):
|
||||
self.vk.vendorTags.append(tag.get('name'))
|
||||
|
||||
# No way known to get this from the XML
|
||||
self.vk.queueBits[Queues.TRANSFER] = 'VK_QUEUE_TRANSFER_BIT'
|
||||
self.vk.queueBits[Queues.GRAPHICS] = 'VK_QUEUE_GRAPHICS_BIT'
|
||||
self.vk.queueBits[Queues.COMPUTE] = 'VK_QUEUE_COMPUTE_BIT'
|
||||
self.vk.queueBits[Queues.PROTECTED] = 'VK_QUEUE_PROTECTED_BIT'
|
||||
self.vk.queueBits[Queues.SPARSE_BINDING] = 'VK_QUEUE_SPARSE_BINDING_BIT'
|
||||
self.vk.queueBits[Queues.OPTICAL_FLOW] = 'VK_QUEUE_OPTICAL_FLOW_BIT_NV'
|
||||
self.vk.queueBits[Queues.DECODE] = 'VK_QUEUE_VIDEO_DECODE_BIT_KHR'
|
||||
self.vk.queueBits[Queues.ENCODE] = 'VK_QUEUE_VIDEO_ENCODE_BIT_KHR'
|
||||
|
||||
# This function should be overloaded
|
||||
def generate(self):
|
||||
print("WARNING: This should not be called from the child class")
|
||||
return
|
||||
|
||||
# This function is dense, it does all the magic to set the right extensions dependencies!
|
||||
#
|
||||
# The issue is if 2 extension expose a command, genCmd() will only
|
||||
# show one of the extension, at endFile() we can finally go through
|
||||
# and update which things depend on which extensions
|
||||
#
|
||||
# self.featureDictionary is built for use in the reg.py framework
|
||||
# Details found in Vulkan-Docs/scripts/scriptgenerator.py
|
||||
def applyExtensionDependency(self):
|
||||
for extension in self.vk.extensions.values():
|
||||
# dict.key() can be None, so need to double loop
|
||||
dict = self.featureDictionary[extension.name]['command']
|
||||
|
||||
# "required" == None
|
||||
# or
|
||||
# an additional feature dependency, which is a boolean expression of
|
||||
# one or more extension and/or core version names
|
||||
for required in dict:
|
||||
for commandName in dict[required]:
|
||||
# Skip commands removed in the target API
|
||||
# This check is needed because parts of the base generator code bypass the
|
||||
# dependency resolution logic in the registry tooling and thus the generator
|
||||
# may attempt to generate code for commands which are not supported in the
|
||||
# target API variant, thus this check needs to happen even if any specific
|
||||
# target API variant may not specifically need it
|
||||
if not commandName in self.vk.commands:
|
||||
continue
|
||||
|
||||
command = self.vk.commands[commandName]
|
||||
# Make sure list is unique
|
||||
command.extensions.extend([extension] if extension not in command.extensions else [])
|
||||
extension.commands.extend([command] if command not in extension.commands else [])
|
||||
|
||||
# While genGroup() will call twice with aliased value, it does not provide all the information we need
|
||||
dict = self.featureDictionary[extension.name]['enumconstant']
|
||||
for required in dict:
|
||||
# group can be a Enum or Bitmask
|
||||
for group in dict[required]:
|
||||
if group in self.vk.enums:
|
||||
if group not in extension.enumFields:
|
||||
extension.enumFields[group] = [] # Dict needs init
|
||||
enum = self.vk.enums[group]
|
||||
# Need to convert all alias so they match what is in EnumField
|
||||
enumList = list(map(lambda x: x if x not in self.enumFieldAliasMap else self.enumFieldAliasMap[x], dict[required][group]))
|
||||
|
||||
for enumField in [x for x in enum.fields if x.name in enumList]:
|
||||
# Make sure list is unique
|
||||
enum.fieldExtensions.extend([extension] if extension not in enum.fieldExtensions else [])
|
||||
enumField.extensions.extend([extension] if extension not in enumField.extensions else [])
|
||||
extension.enumFields[group].extend([enumField] if enumField not in extension.enumFields[group] else [])
|
||||
if group in self.vk.bitmasks:
|
||||
if group not in extension.flags:
|
||||
extension.flags[group] = [] # Dict needs init
|
||||
bitmask = self.vk.bitmasks[group]
|
||||
# Need to convert all alias so they match what is in Flags
|
||||
flagList = list(map(lambda x: x if x not in self.flagAliasMap else self.flagAliasMap[x], dict[required][group]))
|
||||
|
||||
for flags in [x for x in bitmask.flags if x.name in flagList]:
|
||||
# Make sure list is unique
|
||||
bitmask.flagExtensions.extend([extension] if extension not in bitmask.flagExtensions else [])
|
||||
flags.extensions.extend([extension] if extension not in flags.extensions else [])
|
||||
extension.flags[group].extend([flags] if flags not in extension.flags[group] else [])
|
||||
|
||||
# Need to do 'enum'/'bitmask' after 'enumconstant' has applied everything so we can add implicit extensions
|
||||
#
|
||||
# Sometimes two extensions enable an Enum, but the newer extension version has extra flags allowed
|
||||
# This information seems to be implicit, so need to update it here
|
||||
# Go through each Flag and append the Enum extension to it
|
||||
#
|
||||
# ex. VkAccelerationStructureTypeKHR where GENERIC_KHR is not allowed with just VK_NV_ray_tracing
|
||||
# This only works because the values are aliased as well, making the KHR a superset enum
|
||||
for extension in self.vk.extensions.values():
|
||||
dict = self.featureDictionary[extension.name]['enum']
|
||||
for required in dict:
|
||||
for group in dict[required]:
|
||||
for enumName in dict[required][group]:
|
||||
isAlias = enumName in self.enumAliasMap
|
||||
enumName = self.enumAliasMap[enumName] if isAlias else enumName
|
||||
if enumName in self.vk.enums:
|
||||
enum = self.vk.enums[enumName]
|
||||
enum.extensions.extend([extension] if extension not in enum.extensions else [])
|
||||
extension.enums.extend([enum] if enum not in extension.enums else [])
|
||||
# Update fields with implicit base extension
|
||||
if isAlias:
|
||||
continue
|
||||
enum.fieldExtensions.extend([extension] if extension not in enum.fieldExtensions else [])
|
||||
for enumField in [x for x in enum.fields if (not x.extensions or (x.extensions and all(e in enum.extensions for e in x.extensions)))]:
|
||||
enumField.extensions.extend([extension] if extension not in enumField.extensions else [])
|
||||
if enumName not in extension.enumFields:
|
||||
extension.enumFields[enumName] = [] # Dict needs init
|
||||
extension.enumFields[enumName].extend([enumField] if enumField not in extension.enumFields[enumName] else [])
|
||||
|
||||
dict = self.featureDictionary[extension.name]['bitmask']
|
||||
for required in dict:
|
||||
for group in dict[required]:
|
||||
for bitmaskName in dict[required][group]:
|
||||
bitmaskName = bitmaskName.replace('Flags', 'FlagBits') # Works since Flags is not repeated in name
|
||||
isAlias = bitmaskName in self.bitmaskAliasMap
|
||||
bitmaskName = self.bitmaskAliasMap[bitmaskName] if isAlias else bitmaskName
|
||||
if bitmaskName in self.vk.bitmasks:
|
||||
bitmask = self.vk.bitmasks[bitmaskName]
|
||||
bitmask.extensions.extend([extension] if extension not in bitmask.extensions else [])
|
||||
extension.bitmasks.extend([bitmask] if bitmask not in extension.bitmasks else [])
|
||||
# Update flags with implicit base extension
|
||||
if isAlias:
|
||||
continue
|
||||
bitmask.flagExtensions.extend([extension] if extension not in bitmask.flagExtensions else [])
|
||||
for flag in [x for x in bitmask.flags if (not x.extensions or (x.extensions and all(e in bitmask.extensions for e in x.extensions)))]:
|
||||
flag.extensions.extend([extension] if extension not in flag.extensions else [])
|
||||
if bitmaskName not in extension.flags:
|
||||
extension.flags[bitmaskName] = [] # Dict needs init
|
||||
extension.flags[bitmaskName].extend([flag] if flag not in extension.flags[bitmaskName] else [])
|
||||
|
||||
# Some structs (ex VkAttachmentSampleCountInfoAMD) can have multiple alias pointing to same extension
|
||||
for extension in self.vk.extensions.values():
|
||||
dict = self.featureDictionary[extension.name]['struct']
|
||||
for required in dict:
|
||||
for group in dict[required]:
|
||||
for structName in dict[required][group]:
|
||||
isAlias = structName in self.structAliasMap
|
||||
structName = self.structAliasMap[structName] if isAlias else structName
|
||||
# An EXT struct can alias a KHR struct,
|
||||
# that in turns aliaes a core struct
|
||||
# => Try to propagate aliasing, it can safely result in a no-op
|
||||
isAlias = structName in self.structAliasMap
|
||||
structName = self.structAliasMap[structName] if isAlias else structName
|
||||
if structName in self.vk.structs:
|
||||
struct = self.vk.structs[structName]
|
||||
struct.extensions.extend([extension] if extension not in struct.extensions else [])
|
||||
|
||||
# While we update struct alias inside other structs, the command itself might have the struct as a first level param.
|
||||
# We use this time to update params to have the promoted name
|
||||
# Example - https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/9322
|
||||
for command in self.vk.commands.values():
|
||||
for member in command.params:
|
||||
if member.type in self.structAliasMap:
|
||||
member.type = self.structAliasMap[member.type]
|
||||
|
||||
# Could build up a reverse lookup map, but since these are not too large of list, just do here
|
||||
# (Need to be done after we have found all the aliases)
|
||||
for key, value in self.structAliasMap.items():
|
||||
self.vk.structs[value].aliases.append(key)
|
||||
for key, value in self.enumAliasMap.items():
|
||||
self.vk.enums[value].aliases.append(key)
|
||||
for key, value in self.bitmaskAliasMap.items():
|
||||
self.vk.bitmasks[value].aliases.append(key)
|
||||
for key, value in self.handleAliasMap.items():
|
||||
self.vk.handles[value].aliases.append(key)
|
||||
|
||||
def endFile(self):
|
||||
# This is the point were reg.py has ran, everything is collected
|
||||
# We do some post processing now
|
||||
self.applyExtensionDependency()
|
||||
|
||||
# Use structs and commands to find which things are returnedOnly
|
||||
for struct in [x for x in self.vk.structs.values() if not x.returnedOnly]:
|
||||
for enum in [self.vk.enums[x.type] for x in struct.members if x.type in self.vk.enums]:
|
||||
enum.returnedOnly = False
|
||||
for bitmask in [self.vk.bitmasks[x.type] for x in struct.members if x.type in self.vk.bitmasks]:
|
||||
bitmask.returnedOnly = False
|
||||
for bitmask in [self.vk.bitmasks[x.type.replace('Flags', 'FlagBits')] for x in struct.members if x.type.replace('Flags', 'FlagBits') in self.vk.bitmasks]:
|
||||
bitmask.returnedOnly = False
|
||||
for command in self.vk.commands.values():
|
||||
for enum in [self.vk.enums[x.type] for x in command.params if x.type in self.vk.enums]:
|
||||
enum.returnedOnly = False
|
||||
for bitmask in [self.vk.bitmasks[x.type] for x in command.params if x.type in self.vk.bitmasks]:
|
||||
bitmask.returnedOnly = False
|
||||
for bitmask in [self.vk.bitmasks[x.type.replace('Flags', 'FlagBits')] for x in command.params if x.type.replace('Flags', 'FlagBits') in self.vk.bitmasks]:
|
||||
bitmask.returnedOnly = False
|
||||
|
||||
# Turn handle parents into pointers to classes
|
||||
for handle in [x for x in self.vk.handles.values() if x.parent is not None]:
|
||||
handle.parent = self.vk.handles[handle.parent]
|
||||
# search up parent chain to see if instance or device
|
||||
for handle in [x for x in self.vk.handles.values()]:
|
||||
next_parent = handle.parent
|
||||
while (not handle.instance and not handle.device):
|
||||
handle.instance = next_parent.name == 'VkInstance'
|
||||
handle.device = next_parent.name == 'VkDevice'
|
||||
next_parent = next_parent.parent
|
||||
|
||||
maxSyncSupport.queues = Queues.ALL
|
||||
maxSyncSupport.stages = self.vk.bitmasks['VkPipelineStageFlagBits2'].flags
|
||||
maxSyncEquivalent.accesses = self.vk.bitmasks['VkAccessFlagBits2'].flags
|
||||
maxSyncEquivalent.stages = self.vk.bitmasks['VkPipelineStageFlagBits2'].flags
|
||||
|
||||
# All inherited generators should run from here
|
||||
self.generate()
|
||||
|
||||
if cachingEnabled:
|
||||
cachePath = os.path.join(tempfile.gettempdir(), f'vkobject_{os.getpid()}')
|
||||
if not os.path.isfile(cachePath):
|
||||
cacheFile = open(cachePath, 'wb')
|
||||
pickle.dump(self.vk, cacheFile)
|
||||
cacheFile.close()
|
||||
|
||||
# This should not have to do anything but call into OutputGenerator
|
||||
OutputGenerator.endFile(self)
|
||||
|
||||
#
|
||||
# Bypass the entire processing and load in the VkObject data
|
||||
# Still need to handle the beingFile/endFile for reg.py
|
||||
def generateFromCache(self, cacheVkObjectData, genOpts):
|
||||
OutputGenerator.beginFile(self, genOpts)
|
||||
self.filename = genOpts.filename
|
||||
self.vk = cacheVkObjectData
|
||||
self.generate()
|
||||
OutputGenerator.endFile(self)
|
||||
|
||||
#
|
||||
# Processing point at beginning of each extension definition
|
||||
def beginFeature(self, interface, emit):
|
||||
OutputGenerator.beginFeature(self, interface, emit)
|
||||
platform = interface.get('platform')
|
||||
self.featureExtraProtec = self.vk.platforms[platform] if platform in self.vk.platforms else None
|
||||
protect = self.vk.platforms[platform] if platform in self.vk.platforms else None
|
||||
name = interface.get('name')
|
||||
|
||||
if interface.tag == 'extension':
|
||||
instance = interface.get('type') == 'instance'
|
||||
device = not instance
|
||||
depends = interface.get('depends')
|
||||
vendorTag = interface.get('author')
|
||||
platform = interface.get('platform')
|
||||
provisional = boolGet(interface, 'provisional')
|
||||
promotedto = interface.get('promotedto')
|
||||
deprecatedby = interface.get('deprecatedby')
|
||||
obsoletedby = interface.get('obsoletedby')
|
||||
specialuse = splitIfGet(interface, 'specialuse')
|
||||
# Not sure if better way to get this info
|
||||
specVersion = self.featureDictionary[name]['enumconstant'][None][None][0]
|
||||
nameString = self.featureDictionary[name]['enumconstant'][None][None][1]
|
||||
|
||||
self.currentExtension = Extension(name, nameString, specVersion, instance, device, depends, vendorTag,
|
||||
platform, protect, provisional, promotedto, deprecatedby,
|
||||
obsoletedby, specialuse)
|
||||
self.vk.extensions[name] = self.currentExtension
|
||||
else: # version
|
||||
number = interface.get('number')
|
||||
if number != '1.0':
|
||||
self.currentVersion = APISpecific.createApiVersion(self.targetApiName, name)
|
||||
self.vk.versions[name] = self.currentVersion
|
||||
|
||||
def endFeature(self):
|
||||
OutputGenerator.endFeature(self)
|
||||
self.currentExtension = None
|
||||
self.currentVersion = None
|
||||
|
||||
#
|
||||
# All <command> from XML
|
||||
def genCmd(self, cmdinfo, name, alias):
|
||||
OutputGenerator.genCmd(self, cmdinfo, name, alias)
|
||||
|
||||
params = []
|
||||
for param in cmdinfo.elem.findall('param'):
|
||||
paramName = param.find('name').text
|
||||
paramType = textIfFind(param, 'type')
|
||||
paramAlias = param.get('alias')
|
||||
|
||||
cdecl = self.makeCParamDecl(param, 0)
|
||||
paramFullType = ' '.join(cdecl.split()[:-1])
|
||||
pointer = '*' in cdecl or paramType.startswith('PFN_')
|
||||
paramConst = 'const' in cdecl
|
||||
fixedSizeArray = [x[:-1] for x in cdecl.split('[') if x.endswith(']')]
|
||||
|
||||
paramNoautovalidity = boolGet(param, 'noautovalidity')
|
||||
|
||||
nullTerminated = False
|
||||
length = param.get('altlen') if param.get('altlen') is not None else param.get('len')
|
||||
if length:
|
||||
# we will either find it like "null-terminated" or "enabledExtensionCount,null-terminated"
|
||||
# This finds both
|
||||
nullTerminated = 'null-terminated' in length
|
||||
length = length.replace(',null-terminated', '') if 'null-terminated' in length else length
|
||||
length = None if length == 'null-terminated' else length
|
||||
|
||||
if fixedSizeArray and not length:
|
||||
length = ','.join(fixedSizeArray)
|
||||
|
||||
# See Member::optional code for details of this
|
||||
optionalValues = splitIfGet(param, 'optional')
|
||||
optional = optionalValues is not None and optionalValues[0].lower() == "true"
|
||||
optionalPointer = optionalValues is not None and len(optionalValues) > 1 and optionalValues[1].lower() == "true"
|
||||
|
||||
# externsync will be 'true' or expression
|
||||
# if expression, it should be same as 'true'
|
||||
externSync = boolGet(param, 'externsync')
|
||||
externSyncPointer = None if externSync else splitIfGet(param, 'externsync')
|
||||
if not externSync and externSyncPointer is not None:
|
||||
externSync = True
|
||||
|
||||
params.append(Param(paramName, paramAlias, paramType, paramFullType, paramNoautovalidity,
|
||||
paramConst, length, nullTerminated, pointer, fixedSizeArray,
|
||||
optional, optionalPointer,
|
||||
externSync, externSyncPointer, cdecl))
|
||||
|
||||
attrib = cmdinfo.elem.attrib
|
||||
alias = attrib.get('alias')
|
||||
tasks = splitIfGet(attrib, 'tasks')
|
||||
|
||||
queues = getQueues(attrib)
|
||||
successcodes = splitIfGet(attrib, 'successcodes')
|
||||
errorcodes = splitIfGet(attrib, 'errorcodes')
|
||||
cmdbufferlevel = attrib.get('cmdbufferlevel')
|
||||
primary = cmdbufferlevel is not None and 'primary' in cmdbufferlevel
|
||||
secondary = cmdbufferlevel is not None and 'secondary' in cmdbufferlevel
|
||||
|
||||
renderpass = attrib.get('renderpass')
|
||||
renderpass = CommandScope.NONE if renderpass is None else getattr(CommandScope, renderpass.upper())
|
||||
videocoding = attrib.get('videocoding')
|
||||
videocoding = CommandScope.NONE if videocoding is None else getattr(CommandScope, videocoding.upper())
|
||||
|
||||
protoElem = cmdinfo.elem.find('proto')
|
||||
returnType = textIfFind(protoElem, 'type')
|
||||
|
||||
decls = self.makeCDecls(cmdinfo.elem)
|
||||
cPrototype = decls[0]
|
||||
cFunctionPointer = decls[1]
|
||||
|
||||
protect = self.currentExtension.protect if self.currentExtension is not None else None
|
||||
|
||||
# These coammds have no way from the XML to detect they would be an instance command
|
||||
specialInstanceCommand = ['vkCreateInstance', 'vkEnumerateInstanceExtensionProperties','vkEnumerateInstanceLayerProperties', 'vkEnumerateInstanceVersion']
|
||||
instance = len(params) > 0 and (params[0].type == 'VkInstance' or params[0].type == 'VkPhysicalDevice' or name in specialInstanceCommand)
|
||||
device = not instance
|
||||
|
||||
implicitElem = cmdinfo.elem.find('implicitexternsyncparams')
|
||||
implicitExternSyncParams = [x.text for x in implicitElem.findall('param')] if implicitElem else []
|
||||
|
||||
self.vk.commands[name] = Command(name, alias, protect, [], self.currentVersion,
|
||||
returnType, params, instance, device,
|
||||
tasks, queues, successcodes, errorcodes,
|
||||
primary, secondary, renderpass, videocoding,
|
||||
implicitExternSyncParams, cPrototype, cFunctionPointer)
|
||||
|
||||
#
|
||||
# List the enum for the commands
|
||||
# TODO - Seems empty groups like `VkDeviceDeviceMemoryReportCreateInfoEXT` do not show up in here
|
||||
def genGroup(self, groupinfo, groupName, alias):
|
||||
# There can be case where the Enum/Bitmask is in a protect, but the individual
|
||||
# fields also have their own protect
|
||||
groupProtect = self.currentExtension.protect if hasattr(self.currentExtension, 'protect') and self.currentExtension.protect is not None else None
|
||||
enumElem = groupinfo.elem
|
||||
bitwidth = 32 if enumElem.get('bitwidth') is None else int(enumElem.get('bitwidth'))
|
||||
fields = []
|
||||
if enumElem.get('type') == "enum":
|
||||
if alias is not None:
|
||||
self.enumAliasMap[groupName] = alias
|
||||
return
|
||||
|
||||
for elem in enumElem.findall('enum'):
|
||||
fieldName = elem.get('name')
|
||||
|
||||
if elem.get('alias') is not None:
|
||||
self.enumFieldAliasMap[fieldName] = elem.get('alias')
|
||||
continue
|
||||
|
||||
negative = elem.get('dir') is not None
|
||||
protect = elem.get('protect')
|
||||
(valueInt, valueStr) = self.enumToValue(elem, True, bitwidth)
|
||||
|
||||
# Some values have multiple extensions (ex VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR)
|
||||
# genGroup() lists them twice
|
||||
if next((x for x in fields if x.name == fieldName), None) is None:
|
||||
fields.append(EnumField(fieldName, protect, negative, valueInt, valueStr, []))
|
||||
|
||||
self.vk.enums[groupName] = Enum(groupName, [], groupProtect, bitwidth, True, fields, [], [])
|
||||
|
||||
else: # "bitmask"
|
||||
if alias is not None:
|
||||
self.bitmaskAliasMap[groupName] = alias
|
||||
return
|
||||
|
||||
for elem in enumElem.findall('enum'):
|
||||
flagName = elem.get('name')
|
||||
|
||||
if elem.get('alias') is not None:
|
||||
self.flagAliasMap[flagName] = elem.get('alias')
|
||||
continue
|
||||
|
||||
protect = elem.get('protect')
|
||||
|
||||
(valueInt, valueStr) = self.enumToValue(elem, True, bitwidth)
|
||||
flagZero = valueInt == 0
|
||||
flagMultiBit = False
|
||||
# if flag uses 'value' instead of 'bitpos', will be zero or a mask
|
||||
if elem.get('bitpos') is None and elem.get('value'):
|
||||
flagMultiBit = valueInt != 0
|
||||
|
||||
# Some values have multiple extensions (ex VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT)
|
||||
# genGroup() lists them twice
|
||||
if next((x for x in fields if x.name == flagName), None) is None:
|
||||
fields.append(Flag(flagName, protect, valueInt, valueStr, flagMultiBit, flagZero, []))
|
||||
|
||||
flagName = groupName.replace('FlagBits', 'Flags')
|
||||
self.vk.bitmasks[groupName] = Bitmask(groupName, [], flagName, groupProtect, bitwidth, True, fields, [], [])
|
||||
|
||||
def genType(self, typeInfo, typeName, alias):
|
||||
OutputGenerator.genType(self, typeInfo, typeName, alias)
|
||||
typeElem = typeInfo.elem
|
||||
protect = self.currentExtension.protect if hasattr(self.currentExtension, 'protect') and self.currentExtension.protect is not None else None
|
||||
category = typeElem.get('category')
|
||||
if (category == 'struct' or category == 'union'):
|
||||
extension = [self.currentExtension] if self.currentExtension is not None else []
|
||||
if alias is not None:
|
||||
self.structAliasMap[typeName] = alias
|
||||
return
|
||||
|
||||
union = category == 'union'
|
||||
|
||||
returnedOnly = boolGet(typeElem, 'returnedonly')
|
||||
allowDuplicate = boolGet(typeElem, 'allowduplicate')
|
||||
|
||||
extends = splitIfGet(typeElem, 'structextends')
|
||||
extendedBy = self.registry.validextensionstructs[typeName] if len(self.registry.validextensionstructs[typeName]) > 0 else None
|
||||
|
||||
membersElem = typeInfo.elem.findall('.//member')
|
||||
members = []
|
||||
sType = None
|
||||
|
||||
for member in membersElem:
|
||||
for comment in member.findall('comment'):
|
||||
member.remove(comment)
|
||||
|
||||
name = textIfFind(member, 'name')
|
||||
type = textIfFind(member, 'type')
|
||||
sType = member.get('values') if member.get('values') is not None else sType
|
||||
externSync = boolGet(member, 'externsync')
|
||||
noautovalidity = boolGet(member, 'noautovalidity')
|
||||
limittype = member.get('limittype')
|
||||
|
||||
nullTerminated = False
|
||||
length = member.get('altlen') if member.get('altlen') is not None else member.get('len')
|
||||
if length:
|
||||
# we will either find it like "null-terminated" or "enabledExtensionCount,null-terminated"
|
||||
# This finds both
|
||||
nullTerminated = 'null-terminated' in length
|
||||
length = length.replace(',null-terminated', '') if 'null-terminated' in length else length
|
||||
length = None if length == 'null-terminated' else length
|
||||
|
||||
cdecl = self.makeCParamDecl(member, 0)
|
||||
fullType = ' '.join(cdecl.split()[:-1])
|
||||
pointer = '*' in cdecl or type.startswith('PFN_')
|
||||
const = 'const' in cdecl
|
||||
# Some structs like VkTransformMatrixKHR have a 2D array
|
||||
fixedSizeArray = [x[:-1] for x in cdecl.split('[') if x.endswith(']')]
|
||||
|
||||
if fixedSizeArray and not length:
|
||||
length = ','.join(fixedSizeArray)
|
||||
|
||||
# if a pointer, this can be a something like:
|
||||
# optional="true,false" for ppGeometries
|
||||
# optional="false,true" for pPhysicalDeviceCount
|
||||
# the first is if the variable itself is optional
|
||||
# the second is the value of the pointer is optional;
|
||||
optionalValues = splitIfGet(member, 'optional')
|
||||
optional = optionalValues is not None and optionalValues[0].lower() == "true"
|
||||
optionalPointer = optionalValues is not None and len(optionalValues) > 1 and optionalValues[1].lower() == "true"
|
||||
|
||||
members.append(Member(name, type, fullType, noautovalidity, limittype,
|
||||
const, length, nullTerminated, pointer, fixedSizeArray,
|
||||
optional, optionalPointer,
|
||||
externSync, cdecl))
|
||||
|
||||
self.vk.structs[typeName] = Struct(typeName, [], extension, self.currentVersion, protect, members,
|
||||
union, returnedOnly, sType, allowDuplicate, extends, extendedBy)
|
||||
|
||||
elif category == 'handle':
|
||||
if alias is not None:
|
||||
self.handleAliasMap[typeName] = alias
|
||||
return
|
||||
type = typeElem.get('objtypeenum')
|
||||
|
||||
# will resolve these later, the VulkanObjectType does not list things in dependent order
|
||||
parent = typeElem.get('parent')
|
||||
instance = typeName == 'VkInstance'
|
||||
device = typeName == 'VkDevice'
|
||||
|
||||
dispatchable = typeElem.find('type').text == 'VK_DEFINE_HANDLE'
|
||||
|
||||
self.vk.handles[typeName] = Handle(typeName, [], type, protect, parent, instance, device, dispatchable)
|
||||
|
||||
elif category == 'define':
|
||||
if typeName == 'VK_HEADER_VERSION':
|
||||
self.vk.headerVersion = typeElem.find('name').tail.strip()
|
||||
|
||||
else:
|
||||
# not all categories are used
|
||||
# 'group'/'enum'/'bitmask' are routed to genGroup instead
|
||||
# 'basetype'/'include' are only for headers
|
||||
# 'funcpointer` ignore until needed
|
||||
return
|
||||
|
||||
def genSpirv(self, spirvinfo, spirvName, alias):
|
||||
OutputGenerator.genSpirv(self, spirvinfo, spirvName, alias)
|
||||
spirvElem = spirvinfo.elem
|
||||
name = spirvElem.get('name')
|
||||
extension = True if spirvElem.tag == 'spirvextension' else False
|
||||
capability = not extension
|
||||
|
||||
enables = []
|
||||
for elem in spirvElem:
|
||||
version = elem.attrib.get('version')
|
||||
extensionEnable = elem.attrib.get('extension')
|
||||
struct = elem.attrib.get('struct')
|
||||
feature = elem.attrib.get('feature')
|
||||
requires = elem.attrib.get('requires')
|
||||
propertyEnable = elem.attrib.get('property')
|
||||
member = elem.attrib.get('member')
|
||||
value = elem.attrib.get('value')
|
||||
enables.append(SpirvEnables(version, extensionEnable, struct, feature,
|
||||
requires, propertyEnable, member, value))
|
||||
|
||||
self.vk.spirv.append(Spirv(name, extension, capability, enables))
|
||||
|
||||
def genFormat(self, format, formatinfo, alias):
|
||||
OutputGenerator.genFormat(self, format, formatinfo, alias)
|
||||
formatElem = format.elem
|
||||
name = formatElem.get('name')
|
||||
|
||||
components = []
|
||||
for component in formatElem.iterfind('component'):
|
||||
type = component.get('name')
|
||||
bits = component.get('bits')
|
||||
numericFormat = component.get('numericFormat')
|
||||
planeIndex = intIfGet(component, 'planeIndex')
|
||||
components.append(FormatComponent(type, bits, numericFormat, planeIndex))
|
||||
|
||||
planes = []
|
||||
for plane in formatElem.iterfind('plane'):
|
||||
index = int(plane.get('index'))
|
||||
widthDivisor = int(plane.get('widthDivisor'))
|
||||
heightDivisor = int(plane.get('heightDivisor'))
|
||||
compatible = plane.get('compatible')
|
||||
planes.append(FormatPlane(index, widthDivisor, heightDivisor, compatible))
|
||||
|
||||
className = formatElem.get('class')
|
||||
blockSize = int(formatElem.get('blockSize'))
|
||||
texelsPerBlock = int(formatElem.get('texelsPerBlock'))
|
||||
blockExtent = splitIfGet(formatElem, 'blockExtent')
|
||||
packed = intIfGet(formatElem, 'packed')
|
||||
chroma = formatElem.get('chroma')
|
||||
compressed = formatElem.get('compressed')
|
||||
spirvImageFormat = formatElem.find('spirvimageformat')
|
||||
if spirvImageFormat is not None:
|
||||
spirvImageFormat = spirvImageFormat.get('name')
|
||||
|
||||
self.vk.formats[name] = Format(name, className, blockSize, texelsPerBlock,
|
||||
blockExtent, packed, chroma, compressed,
|
||||
components, planes, spirvImageFormat)
|
||||
|
||||
def genSyncStage(self, sync):
|
||||
OutputGenerator.genSyncStage(self, sync)
|
||||
syncElem = sync.elem
|
||||
|
||||
support = maxSyncSupport
|
||||
supportElem = syncElem.find('syncsupport')
|
||||
if supportElem is not None:
|
||||
queues = getQueues(supportElem)
|
||||
stageNames = splitIfGet(supportElem, 'stage')
|
||||
stages = [x for x in self.vk.bitmasks['VkPipelineStageFlagBits2'].flags if x.name in stageNames] if stageNames is not None else None
|
||||
support = SyncSupport(queues, stages, False)
|
||||
|
||||
equivalent = maxSyncEquivalent
|
||||
equivalentElem = syncElem.find('syncequivalent')
|
||||
if equivalentElem is not None:
|
||||
stageNames = splitIfGet(equivalentElem, 'stage')
|
||||
stages = [x for x in self.vk.bitmasks['VkPipelineStageFlagBits2'].flags if x.name in stageNames] if stageNames is not None else None
|
||||
accessNames = splitIfGet(equivalentElem, 'access')
|
||||
accesses = [x for x in self.vk.bitmasks['VkAccessFlagBits2'].flags if x.name in accessNames] if accessNames is not None else None
|
||||
equivalent = SyncEquivalent(stages, accesses, False)
|
||||
|
||||
flagName = syncElem.get('name')
|
||||
flag = [x for x in self.vk.bitmasks['VkPipelineStageFlagBits2'].flags if x.name == flagName]
|
||||
# This check is needed because not all API variants have VK_KHR_synchronization2
|
||||
if flag:
|
||||
self.vk.syncStage.append(SyncStage(flag[0], support, equivalent))
|
||||
|
||||
def genSyncAccess(self, sync):
|
||||
OutputGenerator.genSyncAccess(self, sync)
|
||||
syncElem = sync.elem
|
||||
|
||||
support = maxSyncSupport
|
||||
supportElem = syncElem.find('syncsupport')
|
||||
if supportElem is not None:
|
||||
queues = getQueues(supportElem)
|
||||
stageNames = splitIfGet(supportElem, 'stage')
|
||||
stages = [x for x in self.vk.bitmasks['VkPipelineStageFlagBits2'].flags if x.name in stageNames] if stageNames is not None else None
|
||||
support = SyncSupport(queues, stages, False)
|
||||
|
||||
equivalent = maxSyncEquivalent
|
||||
equivalentElem = syncElem.find('syncequivalent')
|
||||
if equivalentElem is not None:
|
||||
stageNames = splitIfGet(equivalentElem, 'stage')
|
||||
stages = [x for x in self.vk.bitmasks['VkPipelineStageFlagBits2'].flags if x.name in stageNames] if stageNames is not None else None
|
||||
accessNames = splitIfGet(equivalentElem, 'access')
|
||||
accesses = [x for x in self.vk.bitmasks['VkAccessFlagBits2'].flags if x.name in accessNames] if accessNames is not None else None
|
||||
equivalent = SyncEquivalent(stages, accesses, False)
|
||||
|
||||
flagName = syncElem.get('name')
|
||||
flag = [x for x in self.vk.bitmasks['VkAccessFlagBits2'].flags if x.name == flagName]
|
||||
# This check is needed because not all API variants have VK_KHR_synchronization2
|
||||
if flag:
|
||||
self.vk.syncAccess.append(SyncAccess(flag[0], support, equivalent))
|
||||
|
||||
def genSyncPipeline(self, sync):
|
||||
OutputGenerator.genSyncPipeline(self, sync)
|
||||
syncElem = sync.elem
|
||||
name = syncElem.get('name')
|
||||
depends = splitIfGet(syncElem, 'depends')
|
||||
stages = []
|
||||
for stageElem in syncElem.findall('syncpipelinestage'):
|
||||
order = stageElem.get('order')
|
||||
before = stageElem.get('before')
|
||||
after = stageElem.get('after')
|
||||
value = stageElem.text
|
||||
stages.append(SyncPipelineStage(order, before, after, value))
|
||||
|
||||
self.vk.syncPipeline.append(SyncPipeline(name, depends, stages))
|
|
@ -1,232 +1,321 @@
|
|||
#!/usr/bin/python3 -i
|
||||
#!/usr/bin/env python3 -i
|
||||
#
|
||||
# Copyright (c) 2013-2018 The Khronos Group Inc.
|
||||
# Copyright 2013-2025 The Khronos Group 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
|
||||
|
||||
import os,re,sys,pdb
|
||||
from generator import *
|
||||
import os
|
||||
import re
|
||||
|
||||
from generator import (GeneratorOptions,
|
||||
MissingGeneratorOptionsConventionsError,
|
||||
MissingGeneratorOptionsError, MissingRegistryError,
|
||||
OutputGenerator, noneStr, regSortFeatures, write)
|
||||
|
||||
# CGeneratorOptions - subclass of GeneratorOptions.
|
||||
#
|
||||
# Adds options used by COutputGenerator objects during C language header
|
||||
# generation.
|
||||
#
|
||||
# Additional members
|
||||
# prefixText - list of strings to prefix generated header with
|
||||
# (usually a copyright statement + calling convention macros).
|
||||
# protectFile - True if multiple inclusion protection should be
|
||||
# generated (based on the filename) around the entire header.
|
||||
# protectFeature - True if #ifndef..#endif protection should be
|
||||
# generated around a feature interface in the header file.
|
||||
# genFuncPointers - True if function pointer typedefs should be
|
||||
# generated
|
||||
# protectProto - If conditional protection should be generated
|
||||
# around prototype declarations, set to either '#ifdef'
|
||||
# to require opt-in (#ifdef protectProtoStr) or '#ifndef'
|
||||
# to require opt-out (#ifndef protectProtoStr). Otherwise
|
||||
# set to None.
|
||||
# protectProtoStr - #ifdef/#ifndef symbol to use around prototype
|
||||
# declarations, if protectProto is set
|
||||
# apicall - string to use for the function declaration prefix,
|
||||
# such as APICALL on Windows.
|
||||
# apientry - string to use for the calling convention macro,
|
||||
# in typedefs, such as APIENTRY.
|
||||
# apientryp - string to use for the calling convention macro
|
||||
# in function pointer typedefs, such as APIENTRYP.
|
||||
# directory - directory into which to generate include files
|
||||
# indentFuncProto - True if prototype declarations should put each
|
||||
# parameter on a separate line
|
||||
# indentFuncPointer - True if typedefed function pointers should put each
|
||||
# parameter on a separate line
|
||||
# alignFuncParam - if nonzero and parameters are being put on a
|
||||
# separate line, align parameter names at the specified column
|
||||
class CGeneratorOptions(GeneratorOptions):
|
||||
"""Represents options during C interface generation for headers"""
|
||||
def __init__(self,
|
||||
filename = None,
|
||||
directory = '.',
|
||||
apiname = None,
|
||||
profile = None,
|
||||
versions = '.*',
|
||||
emitversions = '.*',
|
||||
defaultExtensions = None,
|
||||
addExtensions = None,
|
||||
removeExtensions = None,
|
||||
emitExtensions = None,
|
||||
sortProcedure = regSortFeatures,
|
||||
prefixText = "",
|
||||
genFuncPointers = True,
|
||||
protectFile = True,
|
||||
protectFeature = True,
|
||||
protectProto = None,
|
||||
protectProtoStr = None,
|
||||
apicall = '',
|
||||
apientry = '',
|
||||
apientryp = '',
|
||||
indentFuncProto = True,
|
||||
indentFuncPointer = False,
|
||||
alignFuncParam = 0):
|
||||
GeneratorOptions.__init__(self, filename, directory, apiname, profile,
|
||||
versions, emitversions, defaultExtensions,
|
||||
addExtensions, removeExtensions,
|
||||
emitExtensions, sortProcedure)
|
||||
self.prefixText = prefixText
|
||||
self.genFuncPointers = genFuncPointers
|
||||
self.protectFile = protectFile
|
||||
self.protectFeature = protectFeature
|
||||
self.protectProto = protectProto
|
||||
self.protectProtoStr = protectProtoStr
|
||||
self.apicall = apicall
|
||||
self.apientry = apientry
|
||||
self.apientryp = apientryp
|
||||
self.indentFuncProto = indentFuncProto
|
||||
self.indentFuncPointer = indentFuncPointer
|
||||
self.alignFuncParam = alignFuncParam
|
||||
"""CGeneratorOptions - subclass of GeneratorOptions.
|
||||
|
||||
Adds options used by COutputGenerator objects during C language header
|
||||
generation."""
|
||||
|
||||
def __init__(self,
|
||||
prefixText='',
|
||||
genFuncPointers=True,
|
||||
protectFile=True,
|
||||
protectFeature=True,
|
||||
protectProto=None,
|
||||
protectProtoStr=None,
|
||||
protectExtensionProto=None,
|
||||
protectExtensionProtoStr=None,
|
||||
apicall='',
|
||||
apientry='',
|
||||
apientryp='',
|
||||
indentFuncProto=True,
|
||||
indentFuncPointer=False,
|
||||
alignFuncParam=0,
|
||||
genEnumBeginEndRange=False,
|
||||
genAliasMacro=False,
|
||||
genStructExtendsComment=False,
|
||||
aliasMacro='',
|
||||
misracstyle=False,
|
||||
misracppstyle=False,
|
||||
**kwargs
|
||||
):
|
||||
"""Constructor.
|
||||
Additional parameters beyond parent class:
|
||||
|
||||
- prefixText - list of strings to prefix generated header with
|
||||
(usually a copyright statement + calling convention macros)
|
||||
- protectFile - True if multiple inclusion protection should be
|
||||
generated (based on the filename) around the entire header
|
||||
- protectFeature - True if #ifndef..#endif protection should be
|
||||
generated around a feature interface in the header file
|
||||
- genFuncPointers - True if function pointer typedefs should be
|
||||
generated
|
||||
- protectProto - If conditional protection should be generated
|
||||
around prototype declarations, set to either '#ifdef'
|
||||
to require opt-in (#ifdef protectProtoStr) or '#ifndef'
|
||||
to require opt-out (#ifndef protectProtoStr). Otherwise
|
||||
set to None.
|
||||
- protectProtoStr - #ifdef/#ifndef symbol to use around prototype
|
||||
declarations, if protectProto is set
|
||||
- protectExtensionProto - If conditional protection should be generated
|
||||
around extension prototype declarations, set to either '#ifdef'
|
||||
to require opt-in (#ifdef protectExtensionProtoStr) or '#ifndef'
|
||||
to require opt-out (#ifndef protectExtensionProtoStr). Otherwise
|
||||
set to None
|
||||
- protectExtensionProtoStr - #ifdef/#ifndef symbol to use around
|
||||
extension prototype declarations, if protectExtensionProto is set
|
||||
- apicall - string to use for the function declaration prefix,
|
||||
such as APICALL on Windows
|
||||
- apientry - string to use for the calling convention macro,
|
||||
in typedefs, such as APIENTRY
|
||||
- apientryp - string to use for the calling convention macro
|
||||
in function pointer typedefs, such as APIENTRYP
|
||||
- indentFuncProto - True if prototype declarations should put each
|
||||
parameter on a separate line
|
||||
- indentFuncPointer - True if typedefed function pointers should put each
|
||||
parameter on a separate line
|
||||
- alignFuncParam - if nonzero and parameters are being put on a
|
||||
separate line, align parameter names at the specified column
|
||||
- genEnumBeginEndRange - True if BEGIN_RANGE / END_RANGE macros should
|
||||
be generated for enumerated types
|
||||
- genAliasMacro - True if the OpenXR alias macro should be generated
|
||||
for aliased types (unclear what other circumstances this is useful)
|
||||
- genStructExtendsComment - True if comments showing the structures
|
||||
whose pNext chain a structure extends are included before its
|
||||
definition
|
||||
- aliasMacro - alias macro to inject when genAliasMacro is True
|
||||
- misracstyle - generate MISRA C-friendly headers
|
||||
- misracppstyle - generate MISRA C++-friendly headers"""
|
||||
|
||||
GeneratorOptions.__init__(self, **kwargs)
|
||||
|
||||
self.prefixText = prefixText
|
||||
"""list of strings to prefix generated header with (usually a copyright statement + calling convention macros)."""
|
||||
|
||||
self.genFuncPointers = genFuncPointers
|
||||
"""True if function pointer typedefs should be generated"""
|
||||
|
||||
self.protectFile = protectFile
|
||||
"""True if multiple inclusion protection should be generated (based on the filename) around the entire header."""
|
||||
|
||||
self.protectFeature = protectFeature
|
||||
"""True if #ifndef..#endif protection should be generated around a feature interface in the header file."""
|
||||
|
||||
self.protectProto = protectProto
|
||||
"""If conditional protection should be generated around prototype declarations, set to either '#ifdef' to require opt-in (#ifdef protectProtoStr) or '#ifndef' to require opt-out (#ifndef protectProtoStr). Otherwise set to None."""
|
||||
|
||||
self.protectProtoStr = protectProtoStr
|
||||
"""#ifdef/#ifndef symbol to use around prototype declarations, if protectProto is set"""
|
||||
|
||||
self.protectExtensionProto = protectExtensionProto
|
||||
"""If conditional protection should be generated around extension prototype declarations, set to either '#ifdef' to require opt-in (#ifdef protectExtensionProtoStr) or '#ifndef' to require opt-out (#ifndef protectExtensionProtoStr). Otherwise set to None."""
|
||||
|
||||
self.protectExtensionProtoStr = protectExtensionProtoStr
|
||||
"""#ifdef/#ifndef symbol to use around extension prototype declarations, if protectExtensionProto is set"""
|
||||
|
||||
self.apicall = apicall
|
||||
"""string to use for the function declaration prefix, such as APICALL on Windows."""
|
||||
|
||||
self.apientry = apientry
|
||||
"""string to use for the calling convention macro, in typedefs, such as APIENTRY."""
|
||||
|
||||
self.apientryp = apientryp
|
||||
"""string to use for the calling convention macro in function pointer typedefs, such as APIENTRYP."""
|
||||
|
||||
self.indentFuncProto = indentFuncProto
|
||||
"""True if prototype declarations should put each parameter on a separate line"""
|
||||
|
||||
self.indentFuncPointer = indentFuncPointer
|
||||
"""True if typedefed function pointers should put each parameter on a separate line"""
|
||||
|
||||
self.alignFuncParam = alignFuncParam
|
||||
"""if nonzero and parameters are being put on a separate line, align parameter names at the specified column"""
|
||||
|
||||
self.genEnumBeginEndRange = genEnumBeginEndRange
|
||||
"""True if BEGIN_RANGE / END_RANGE macros should be generated for enumerated types"""
|
||||
|
||||
self.genAliasMacro = genAliasMacro
|
||||
"""True if the OpenXR alias macro should be generated for aliased types (unclear what other circumstances this is useful)"""
|
||||
|
||||
self.genStructExtendsComment = genStructExtendsComment
|
||||
"""True if comments showing the structures whose pNext chain a structure extends are included before its definition"""
|
||||
|
||||
self.aliasMacro = aliasMacro
|
||||
"""alias macro to inject when genAliasMacro is True"""
|
||||
|
||||
self.misracstyle = misracstyle
|
||||
"""generate MISRA C-friendly headers"""
|
||||
|
||||
self.misracppstyle = misracppstyle
|
||||
"""generate MISRA C++-friendly headers"""
|
||||
|
||||
self.codeGenerator = True
|
||||
"""True if this generator makes compilable code"""
|
||||
|
||||
|
||||
# COutputGenerator - subclass of OutputGenerator.
|
||||
# Generates C-language API interfaces.
|
||||
#
|
||||
# ---- methods ----
|
||||
# COutputGenerator(errFile, warnFile, diagFile) - args as for
|
||||
# OutputGenerator. Defines additional internal state.
|
||||
# ---- methods overriding base class ----
|
||||
# beginFile(genOpts)
|
||||
# endFile()
|
||||
# beginFeature(interface, emit)
|
||||
# endFeature()
|
||||
# genType(typeinfo,name)
|
||||
# genStruct(typeinfo,name)
|
||||
# genGroup(groupinfo,name)
|
||||
# genEnum(enuminfo, name)
|
||||
# genCmd(cmdinfo)
|
||||
class COutputGenerator(OutputGenerator):
|
||||
"""Generate specified API interfaces in a specific style, such as a C header"""
|
||||
"""Generates C-language API interfaces."""
|
||||
|
||||
# This is an ordered list of sections in the header file.
|
||||
TYPE_SECTIONS = ['include', 'define', 'basetype', 'handle', 'enum',
|
||||
'group', 'bitmask', 'funcpointer', 'struct']
|
||||
ALL_SECTIONS = TYPE_SECTIONS + ['commandPointer', 'command']
|
||||
def __init__(self,
|
||||
errFile = sys.stderr,
|
||||
warnFile = sys.stderr,
|
||||
diagFile = sys.stdout):
|
||||
OutputGenerator.__init__(self, errFile, warnFile, diagFile)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
# Internal state - accumulators for different inner block text
|
||||
self.sections = dict([(section, []) for section in self.ALL_SECTIONS])
|
||||
#
|
||||
self.sections = {section: [] for section in self.ALL_SECTIONS}
|
||||
self.feature_not_empty = False
|
||||
self.may_alias = None
|
||||
|
||||
def beginFile(self, genOpts):
|
||||
OutputGenerator.beginFile(self, genOpts)
|
||||
if self.genOpts is None:
|
||||
raise MissingGeneratorOptionsError()
|
||||
# C-specific
|
||||
#
|
||||
# Multiple inclusion protection & C++ wrappers.
|
||||
if (genOpts.protectFile and self.genOpts.filename):
|
||||
headerSym = re.sub('\.h', '_h_',
|
||||
if self.genOpts.protectFile and self.genOpts.filename:
|
||||
headerSym = re.sub(r'\.h', '_h_',
|
||||
os.path.basename(self.genOpts.filename)).upper()
|
||||
write('#ifndef', headerSym, file=self.outFile)
|
||||
write('#define', headerSym, '1', file=self.outFile)
|
||||
self.newline()
|
||||
|
||||
# User-supplied prefix text, if any (list of strings)
|
||||
if genOpts.prefixText:
|
||||
for s in genOpts.prefixText:
|
||||
write(s, file=self.outFile)
|
||||
|
||||
# C++ extern wrapper - after prefix lines so they can add includes.
|
||||
self.newline()
|
||||
write('#ifdef __cplusplus', file=self.outFile)
|
||||
write('extern "C" {', file=self.outFile)
|
||||
write('#endif', file=self.outFile)
|
||||
self.newline()
|
||||
#
|
||||
# User-supplied prefix text, if any (list of strings)
|
||||
if (genOpts.prefixText):
|
||||
for s in genOpts.prefixText:
|
||||
write(s, file=self.outFile)
|
||||
#
|
||||
# Some boilerplate describing what was generated - this
|
||||
# will probably be removed later since the extensions
|
||||
# pattern may be very long.
|
||||
# write('/* Generated C header for:', file=self.outFile)
|
||||
# write(' * API:', genOpts.apiname, file=self.outFile)
|
||||
# if (genOpts.profile):
|
||||
# write(' * Profile:', genOpts.profile, file=self.outFile)
|
||||
# write(' * Versions considered:', genOpts.versions, file=self.outFile)
|
||||
# write(' * Versions emitted:', genOpts.emitversions, file=self.outFile)
|
||||
# write(' * Default extensions included:', genOpts.defaultExtensions, file=self.outFile)
|
||||
# write(' * Additional extensions included:', genOpts.addExtensions, file=self.outFile)
|
||||
# write(' * Extensions removed:', genOpts.removeExtensions, file=self.outFile)
|
||||
# write(' * Extensions emitted:', genOpts.emitExtensions, file=self.outFile)
|
||||
# write(' */', file=self.outFile)
|
||||
|
||||
def endFile(self):
|
||||
# C-specific
|
||||
# Finish C++ wrapper and multiple inclusion protection
|
||||
if self.genOpts is None:
|
||||
raise MissingGeneratorOptionsError()
|
||||
self.newline()
|
||||
write('#ifdef __cplusplus', file=self.outFile)
|
||||
write('}', file=self.outFile)
|
||||
write('#endif', file=self.outFile)
|
||||
if (self.genOpts.protectFile and self.genOpts.filename):
|
||||
if self.genOpts.protectFile and self.genOpts.filename:
|
||||
self.newline()
|
||||
write('#endif', file=self.outFile)
|
||||
# Finish processing in superclass
|
||||
OutputGenerator.endFile(self)
|
||||
|
||||
def beginFeature(self, interface, emit):
|
||||
# Start processing in superclass
|
||||
OutputGenerator.beginFeature(self, interface, emit)
|
||||
# C-specific
|
||||
# Accumulate includes, defines, types, enums, function pointer typedefs,
|
||||
# end function prototypes separately for this feature. They're only
|
||||
# end function prototypes separately for this feature. They are only
|
||||
# printed in endFeature().
|
||||
self.sections = dict([(section, []) for section in self.ALL_SECTIONS])
|
||||
self.sections = {section: [] for section in self.ALL_SECTIONS}
|
||||
self.feature_not_empty = False
|
||||
|
||||
def _endProtectComment(self, protect_str, protect_directive='#ifdef'):
|
||||
if protect_directive is None or protect_str is None:
|
||||
raise RuntimeError('Should not call in here without something to protect')
|
||||
|
||||
# Do not put comments after #endif closing blocks if this is not set
|
||||
if not self.genOpts.conventions.protectProtoComment:
|
||||
return ''
|
||||
elif 'ifdef' in protect_directive:
|
||||
return f' /* {protect_str} */'
|
||||
else:
|
||||
return f' /* !{protect_str} */'
|
||||
|
||||
def endFeature(self):
|
||||
"Actually write the interface to the output file."
|
||||
# C-specific
|
||||
# Actually write the interface to the output file.
|
||||
if (self.emit):
|
||||
self.newline()
|
||||
if (self.genOpts.protectFeature):
|
||||
write('#ifndef', self.featureName, file=self.outFile)
|
||||
# If type declarations are needed by other features based on
|
||||
# this one, it may be necessary to suppress the ExtraProtect,
|
||||
# or move it below the 'for section...' loop.
|
||||
if (self.featureExtraProtect != None):
|
||||
write('#ifdef', self.featureExtraProtect, file=self.outFile)
|
||||
write('#define', self.featureName, '1', file=self.outFile)
|
||||
for section in self.TYPE_SECTIONS:
|
||||
contents = self.sections[section]
|
||||
if contents:
|
||||
write('\n'.join(contents), file=self.outFile)
|
||||
if self.emit:
|
||||
if self.feature_not_empty:
|
||||
if self.genOpts is None:
|
||||
raise MissingGeneratorOptionsError()
|
||||
if self.genOpts.conventions is None:
|
||||
raise MissingGeneratorOptionsConventionsError()
|
||||
is_core = self.featureName and self.featureName.startswith(f"{self.conventions.api_prefix}VERSION_")
|
||||
if self.genOpts.conventions.writeFeature(self.featureName, self.featureExtraProtect, self.genOpts.filename):
|
||||
self.newline()
|
||||
if (self.genOpts.genFuncPointers and self.sections['commandPointer']):
|
||||
write('\n'.join(self.sections['commandPointer']), file=self.outFile)
|
||||
self.newline()
|
||||
if (self.sections['command']):
|
||||
if (self.genOpts.protectProto):
|
||||
write(self.genOpts.protectProto,
|
||||
self.genOpts.protectProtoStr, file=self.outFile)
|
||||
write('\n'.join(self.sections['command']), end='', file=self.outFile)
|
||||
if (self.genOpts.protectProto):
|
||||
write('#endif', file=self.outFile)
|
||||
else:
|
||||
if self.genOpts.protectFeature:
|
||||
write('#ifndef', self.featureName, file=self.outFile)
|
||||
|
||||
# If type declarations are needed by other features based on
|
||||
# this one, it may be necessary to suppress the ExtraProtect,
|
||||
# or move it below the 'for section...' loop.
|
||||
if self.featureExtraProtect is not None:
|
||||
write('#ifdef', self.featureExtraProtect, file=self.outFile)
|
||||
self.newline()
|
||||
if (self.featureExtraProtect != None):
|
||||
write('#endif /*', self.featureExtraProtect, '*/', file=self.outFile)
|
||||
if (self.genOpts.protectFeature):
|
||||
write('#endif /*', self.featureName, '*/', file=self.outFile)
|
||||
|
||||
# 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]
|
||||
if contents:
|
||||
write('\n'.join(contents), file=self.outFile)
|
||||
|
||||
if self.genOpts.genFuncPointers and self.sections['commandPointer']:
|
||||
write('\n'.join(self.sections['commandPointer']), file=self.outFile)
|
||||
self.newline()
|
||||
|
||||
if self.sections['command']:
|
||||
if self.genOpts.protectProto:
|
||||
write(self.genOpts.protectProto,
|
||||
self.genOpts.protectProtoStr, file=self.outFile)
|
||||
if self.genOpts.protectExtensionProto and not is_core:
|
||||
write(self.genOpts.protectExtensionProto,
|
||||
self.genOpts.protectExtensionProtoStr, file=self.outFile)
|
||||
write('\n'.join(self.sections['command']), end='', file=self.outFile)
|
||||
if self.genOpts.protectExtensionProto and not is_core:
|
||||
write('#endif' +
|
||||
self._endProtectComment(protect_directive=self.genOpts.protectExtensionProto,
|
||||
protect_str=self.genOpts.protectExtensionProtoStr),
|
||||
file=self.outFile)
|
||||
if self.genOpts.protectProto:
|
||||
write('#endif' +
|
||||
self._endProtectComment(protect_directive=self.genOpts.protectProto,
|
||||
protect_str=self.genOpts.protectProtoStr),
|
||||
file=self.outFile)
|
||||
else:
|
||||
self.newline()
|
||||
|
||||
if self.featureExtraProtect is not None:
|
||||
write('#endif' +
|
||||
self._endProtectComment(protect_str=self.featureExtraProtect),
|
||||
file=self.outFile)
|
||||
|
||||
if self.genOpts.protectFeature:
|
||||
write('#endif' +
|
||||
self._endProtectComment(protect_str=self.featureName),
|
||||
file=self.outFile)
|
||||
# Finish processing in superclass
|
||||
OutputGenerator.endFeature(self)
|
||||
#
|
||||
# Append a definition to the specified section
|
||||
|
||||
def appendSection(self, section, text):
|
||||
# self.sections[section].append('SECTION: ' + section + '\n')
|
||||
"Append a definition to the specified section"
|
||||
|
||||
if section is None:
|
||||
self.logMsg('error', 'Missing section in appendSection (probably a <type> element missing its \'category\' attribute. Text:', text)
|
||||
exit(1)
|
||||
|
||||
self.sections[section].append(text)
|
||||
# self.logMsg('diag', 'appendSection(section =', section, 'text =', text)
|
||||
#
|
||||
# Type generation
|
||||
self.feature_not_empty = True
|
||||
|
||||
def genType(self, typeinfo, name, alias):
|
||||
"Generate type."
|
||||
OutputGenerator.genType(self, typeinfo, name, alias)
|
||||
typeElem = typeinfo.elem
|
||||
|
||||
# Vulkan:
|
||||
# Determine the category of the type, and the type section to add
|
||||
# its definition to.
|
||||
# 'funcpointer' is added to the 'struct' section as a workaround for
|
||||
|
@ -238,180 +327,192 @@ class COutputGenerator(OutputGenerator):
|
|||
else:
|
||||
section = category
|
||||
|
||||
if category == 'struct' or category == 'union':
|
||||
if category in ('struct', 'union'):
|
||||
# If the type is a struct type, generate it using the
|
||||
# special-purpose generator.
|
||||
self.genStruct(typeinfo, name, alias)
|
||||
else:
|
||||
if self.genOpts is None:
|
||||
raise MissingGeneratorOptionsError()
|
||||
|
||||
body = self.deprecationComment(typeElem)
|
||||
|
||||
# OpenXR: this section was not under 'else:' previously, just fell through
|
||||
if alias:
|
||||
# If the type is an alias, just emit a typedef declaration
|
||||
body = 'typedef ' + alias + ' ' + name + ';\n'
|
||||
body += f"typedef {alias} {name};\n"
|
||||
else:
|
||||
# Replace <apientry /> tags with an APIENTRY-style string
|
||||
# (from self.genOpts). Copy other text through unchanged.
|
||||
# If the resulting text is an empty string, don't emit it.
|
||||
body = noneStr(typeElem.text)
|
||||
# If the resulting text is an empty string, do not emit it.
|
||||
body += noneStr(typeElem.text)
|
||||
for elem in typeElem:
|
||||
if (elem.tag == 'apientry'):
|
||||
if elem.tag == 'apientry':
|
||||
body += self.genOpts.apientry + noneStr(elem.tail)
|
||||
else:
|
||||
body += noneStr(elem.text) + noneStr(elem.tail)
|
||||
|
||||
if category == 'define' and self.misracppstyle():
|
||||
body = body.replace("(uint32_t)", "static_cast<uint32_t>")
|
||||
if body:
|
||||
# Add extra newline after multi-line entries.
|
||||
if '\n' in body[0:-1]:
|
||||
body += '\n'
|
||||
self.appendSection(section, body)
|
||||
#
|
||||
# Struct (e.g. C "struct" type) generation.
|
||||
# This is a special case of the <type> tag where the contents are
|
||||
# interpreted as a set of <member> tags instead of freeform C
|
||||
# C type declarations. The <member> tags are just like <param>
|
||||
# tags - they are a declaration of a struct or union member.
|
||||
# Only simple member declarations are supported (no nested
|
||||
# structs etc.)
|
||||
# If alias != None, then this struct aliases another; just
|
||||
# generate a typedef of that alias.
|
||||
|
||||
def genProtectString(self, protect_str):
|
||||
"""Generate protection string.
|
||||
|
||||
Protection strings are the strings defining the OS/Platform/Graphics
|
||||
requirements for a given API command. When generating the
|
||||
language header files, we need to make sure the items specific to a
|
||||
graphics API or OS platform are properly wrapped in #ifs."""
|
||||
protect_if_str = ''
|
||||
protect_end_str = ''
|
||||
if not protect_str:
|
||||
return (protect_if_str, protect_end_str)
|
||||
|
||||
if ',' in protect_str:
|
||||
protect_list = protect_str.split(',')
|
||||
protect_defs = (f'defined({d})' for d in protect_list)
|
||||
protect_def_str = ' && '.join(protect_defs)
|
||||
protect_if_str = f'#if {protect_def_str}\n'
|
||||
protect_end_str = f'#endif // {protect_def_str}\n'
|
||||
else:
|
||||
protect_if_str = f'#ifdef {protect_str}\n'
|
||||
protect_end_str = f'#endif // {protect_str}\n'
|
||||
|
||||
return (protect_if_str, protect_end_str)
|
||||
|
||||
def typeMayAlias(self, typeName):
|
||||
if not self.may_alias:
|
||||
if self.registry is None:
|
||||
raise MissingRegistryError()
|
||||
# First time we have asked if a type may alias.
|
||||
# So, populate the set of all names of types that may.
|
||||
|
||||
# Everyone with an explicit mayalias="true"
|
||||
self.may_alias = set(typeName
|
||||
for typeName, data in self.registry.typedict.items()
|
||||
if data.elem.get('mayalias') == 'true')
|
||||
|
||||
# Every type mentioned in some other type's parentstruct attribute.
|
||||
polymorphic_bases = (otherType.elem.get('parentstruct')
|
||||
for otherType in self.registry.typedict.values())
|
||||
self.may_alias.update(set(x for x in polymorphic_bases
|
||||
if x is not None))
|
||||
return typeName in self.may_alias
|
||||
|
||||
def genStruct(self, typeinfo, typeName, alias):
|
||||
"""Generate struct (e.g. C "struct" type).
|
||||
|
||||
This is a special case of the <type> tag where the contents are
|
||||
interpreted as a set of <member> tags instead of freeform C
|
||||
C type declarations. The <member> tags are just like <param>
|
||||
tags - they are a declaration of a struct or union member.
|
||||
Only simple member declarations are supported (no nested
|
||||
structs etc.)
|
||||
|
||||
If alias is not None, then this struct aliases another; just
|
||||
generate a typedef of that alias."""
|
||||
OutputGenerator.genStruct(self, typeinfo, typeName, alias)
|
||||
|
||||
if self.genOpts is None:
|
||||
raise MissingGeneratorOptionsError()
|
||||
|
||||
typeElem = typeinfo.elem
|
||||
body = self.deprecationComment(typeElem)
|
||||
|
||||
if alias:
|
||||
body = 'typedef ' + alias + ' ' + typeName + ';\n'
|
||||
body += f"typedef {alias} {typeName};\n"
|
||||
else:
|
||||
body = 'typedef ' + typeElem.get('category') + ' ' + typeName + ' {\n'
|
||||
(protect_begin, protect_end) = self.genProtectString(typeElem.get('protect'))
|
||||
if protect_begin:
|
||||
body += protect_begin
|
||||
|
||||
targetLen = 0;
|
||||
for member in typeElem.findall('.//member'):
|
||||
targetLen = max(targetLen, self.getCParamTypeLength(member))
|
||||
if self.genOpts.genStructExtendsComment:
|
||||
structextends = typeElem.get('structextends')
|
||||
body += f"// {typeName} extends {structextends}\n" if structextends else ''
|
||||
|
||||
body += f"typedef {typeElem.get('category')}"
|
||||
|
||||
# This is an OpenXR-specific alternative where aliasing refers
|
||||
# to an inheritance hierarchy of types rather than C-level type
|
||||
# aliases.
|
||||
if self.genOpts.genAliasMacro and self.typeMayAlias(typeName):
|
||||
body += f" {self.genOpts.aliasMacro}"
|
||||
|
||||
body += f" {typeName} {{\n"
|
||||
|
||||
targetLen = self.getMaxCParamTypeLength(typeinfo)
|
||||
for member in typeElem.findall('.//member'):
|
||||
body += self.deprecationComment(member, indent = 4)
|
||||
body += self.makeCParamDecl(member, targetLen + 4)
|
||||
body += ';\n'
|
||||
body += '} ' + typeName + ';\n'
|
||||
body += f"}} {typeName};\n"
|
||||
if protect_end:
|
||||
body += protect_end
|
||||
|
||||
self.appendSection('struct', body)
|
||||
#
|
||||
# Group (e.g. C "enum" type) generation.
|
||||
# These are concatenated together with other types.
|
||||
# If alias != None, it is the name of another group type
|
||||
# which aliases this type; just generate that alias.
|
||||
def genGroup(self, groupinfo, groupName, alias = None):
|
||||
|
||||
def genGroup(self, groupinfo, groupName, alias=None):
|
||||
"""Generate groups (e.g. C "enum" type).
|
||||
|
||||
These are concatenated together with other types.
|
||||
|
||||
If alias is not None, it is the name of another group type
|
||||
which aliases this type; just generate that alias."""
|
||||
OutputGenerator.genGroup(self, groupinfo, groupName, alias)
|
||||
groupElem = groupinfo.elem
|
||||
|
||||
if alias:
|
||||
# If the group name is aliased, just emit a typedef declaration
|
||||
# for the alias.
|
||||
body = 'typedef ' + alias + ' ' + groupName + ';\n'
|
||||
else:
|
||||
self.logMsg('diag', 'CGenerator.genGroup group =', groupName, 'alias =', alias)
|
||||
|
||||
# Otherwise, emit an actual enumerated type declaration
|
||||
expandName = re.sub(r'([0-9a-z_])([A-Z0-9])',r'\1_\2',groupName).upper()
|
||||
|
||||
expandPrefix = expandName
|
||||
expandSuffix = ''
|
||||
expandSuffixMatch = re.search(r'[A-Z][A-Z]+$',groupName)
|
||||
if expandSuffixMatch:
|
||||
expandSuffix = '_' + expandSuffixMatch.group()
|
||||
# Strip off the suffix from the prefix
|
||||
expandPrefix = expandName.rsplit(expandSuffix, 1)[0]
|
||||
|
||||
# Prefix
|
||||
body = "\ntypedef enum " + groupName + " {\n"
|
||||
|
||||
# @@ Should use the type="bitmask" attribute instead
|
||||
isEnum = ('FLAG_BITS' not in expandPrefix)
|
||||
|
||||
# Get a list of nested 'enum' tags.
|
||||
enums = groupElem.findall('enum')
|
||||
|
||||
# Check for and report duplicates, and return a list with them
|
||||
# removed.
|
||||
enums = self.checkDuplicateEnums(enums)
|
||||
|
||||
# Loop over the nested 'enum' tags. Keep track of the minimum and
|
||||
# maximum numeric values, if they can be determined; but only for
|
||||
# core API enumerants, not extension enumerants. This is inferred
|
||||
# by looking for 'extends' attributes.
|
||||
minName = None
|
||||
|
||||
# Accumulate non-numeric enumerant values separately and append
|
||||
# them following the numeric values, to allow for aliases.
|
||||
# NOTE: this doesn't do a topological sort yet, so aliases of
|
||||
# aliases can still get in the wrong order.
|
||||
aliasText = ""
|
||||
|
||||
for elem in enums:
|
||||
# Convert the value to an integer and use that to track min/max.
|
||||
(numVal,strVal) = self.enumToValue(elem, True)
|
||||
name = elem.get('name')
|
||||
|
||||
# Extension enumerants are only included if they are required
|
||||
if self.isEnumRequired(elem):
|
||||
decl = " " + name + " = " + strVal + ",\n"
|
||||
if numVal != None:
|
||||
body += decl
|
||||
else:
|
||||
aliasText += decl
|
||||
|
||||
# Don't track min/max for non-numbers (numVal == None)
|
||||
if isEnum and numVal != None and elem.get('extends') is None:
|
||||
if minName == None:
|
||||
minName = maxName = name
|
||||
minValue = maxValue = numVal
|
||||
elif numVal < minValue:
|
||||
minName = name
|
||||
minValue = numVal
|
||||
elif numVal > maxValue:
|
||||
maxName = name
|
||||
maxValue = numVal
|
||||
|
||||
# Now append the non-numeric enumerant values
|
||||
body += aliasText
|
||||
|
||||
# Generate min/max value tokens and a range-padding enum. Need some
|
||||
# additional padding to generate correct names...
|
||||
if isEnum:
|
||||
body += " " + expandPrefix + "_BEGIN_RANGE" + expandSuffix + " = " + minName + ",\n"
|
||||
body += " " + expandPrefix + "_END_RANGE" + expandSuffix + " = " + maxName + ",\n"
|
||||
body += " " + expandPrefix + "_RANGE_SIZE" + expandSuffix + " = (" + maxName + " - " + minName + " + 1),\n"
|
||||
|
||||
body += " " + expandPrefix + "_MAX_ENUM" + expandSuffix + " = 0x7FFFFFFF\n"
|
||||
|
||||
# Postfix
|
||||
body += "} " + groupName + ";"
|
||||
|
||||
# After either enumerated type or alias paths, add the declaration
|
||||
# to the appropriate section for the group being defined.
|
||||
if groupElem.get('type') == 'bitmask':
|
||||
section = 'bitmask'
|
||||
else:
|
||||
section = 'group'
|
||||
self.appendSection(section, body)
|
||||
|
||||
# Enumerant generation
|
||||
# <enum> tags may specify their values in several ways, but are usually
|
||||
# just integers.
|
||||
if alias:
|
||||
# If the group name is aliased, just emit a typedef declaration
|
||||
# for the alias.
|
||||
body = f"typedef {alias} {groupName};\n"
|
||||
self.appendSection(section, body)
|
||||
else:
|
||||
if self.genOpts is None:
|
||||
raise MissingGeneratorOptionsError()
|
||||
(section, body) = self.buildEnumCDecl(self.genOpts.genEnumBeginEndRange, groupinfo, groupName)
|
||||
self.appendSection(section, f"\n{body}")
|
||||
|
||||
def genEnum(self, enuminfo, name, alias):
|
||||
"""Generate the C declaration for a constant (a single <enum> value).
|
||||
|
||||
<enum> tags may specify their values in several ways, but are usually
|
||||
just integers."""
|
||||
|
||||
OutputGenerator.genEnum(self, enuminfo, name, alias)
|
||||
(numVal,strVal) = self.enumToValue(enuminfo.elem, False)
|
||||
body = '#define ' + name.ljust(33) + ' ' + strVal
|
||||
|
||||
body = self.deprecationComment(enuminfo.elem)
|
||||
body += self.buildConstantCDecl(enuminfo, name, alias)
|
||||
self.appendSection('enum', body)
|
||||
|
||||
#
|
||||
# Command generation
|
||||
def genCmd(self, cmdinfo, name, alias):
|
||||
"Command generation"
|
||||
OutputGenerator.genCmd(self, cmdinfo, name, alias)
|
||||
|
||||
# if alias:
|
||||
# prefix = '// ' + name + ' is an alias of command ' + alias + '\n'
|
||||
# else:
|
||||
# prefix = ''
|
||||
if self.genOpts is None:
|
||||
raise MissingGeneratorOptionsError()
|
||||
|
||||
prefix = ''
|
||||
decls = self.makeCDecls(cmdinfo.elem)
|
||||
self.appendSection('command', prefix + decls[0] + '\n')
|
||||
if (self.genOpts.genFuncPointers):
|
||||
self.appendSection('command', f"{prefix + decls[0]}\n")
|
||||
if self.genOpts.genFuncPointers:
|
||||
self.appendSection('commandPointer', decls[1])
|
||||
|
||||
def misracstyle(self):
|
||||
return self.genOpts.misracstyle
|
||||
|
||||
def misracppstyle(self):
|
||||
return self.genOpts.misracppstyle
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,531 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
#
|
||||
# Copyright (c) 2013-2018 The Khronos Group 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.
|
||||
|
||||
import argparse, cProfile, pdb, string, sys, time
|
||||
from reg import *
|
||||
from generator import write
|
||||
from cgenerator import CGeneratorOptions, COutputGenerator
|
||||
from docgenerator import DocGeneratorOptions, DocOutputGenerator
|
||||
from extensionmetadocgenerator import ExtensionMetaDocGeneratorOptions, ExtensionMetaDocOutputGenerator
|
||||
from pygenerator import PyOutputGenerator
|
||||
from validitygenerator import ValidityOutputGenerator
|
||||
from hostsyncgenerator import HostSynchronizationOutputGenerator
|
||||
from extensionStubSource import ExtensionStubSourceOutputGenerator
|
||||
|
||||
# Simple timer functions
|
||||
startTime = None
|
||||
|
||||
def startTimer(timeit):
|
||||
global startTime
|
||||
startTime = time.clock()
|
||||
|
||||
def endTimer(timeit, msg):
|
||||
global startTime
|
||||
endTime = time.clock()
|
||||
if (timeit):
|
||||
write(msg, endTime - startTime, file=sys.stderr)
|
||||
startTime = None
|
||||
|
||||
# Turn a list of strings into a regexp string matching exactly those strings
|
||||
def makeREstring(list, default = None):
|
||||
if len(list) > 0 or default == None:
|
||||
return '^(' + '|'.join(list) + ')$'
|
||||
else:
|
||||
return default
|
||||
|
||||
# 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.
|
||||
def makeGenOpts(args):
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
# Descriptive names for various regexp patterns used to select
|
||||
# versions and extensions
|
||||
allFeatures = allExtensions = '.*'
|
||||
noFeatures = noExtensions = None
|
||||
|
||||
# Turn lists of names/patterns into matching regular expressions
|
||||
addExtensionsPat = makeREstring(extensions, None)
|
||||
removeExtensionsPat = makeREstring(removeExtensions, None)
|
||||
emitExtensionsPat = makeREstring(emitExtensions, allExtensions)
|
||||
featuresPat = makeREstring(features, allFeatures)
|
||||
|
||||
# Copyright text prefixing all headers (list of strings).
|
||||
prefixStrings = [
|
||||
'/*',
|
||||
'** Copyright (c) 2015-2018 The Khronos Group 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.',
|
||||
'*/',
|
||||
''
|
||||
]
|
||||
|
||||
# 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
|
||||
protectFeature = protect
|
||||
protectProto = protect
|
||||
|
||||
# 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(
|
||||
filename = 'timeMarker',
|
||||
directory = directory,
|
||||
apiname = 'vulkan',
|
||||
profile = None,
|
||||
versions = featuresPat,
|
||||
emitversions = featuresPat,
|
||||
defaultExtensions = None,
|
||||
addExtensions = addExtensionsPat,
|
||||
removeExtensions = removeExtensionsPat,
|
||||
emitExtensions = emitExtensionsPat,
|
||||
prefixText = prefixStrings + vkPrefixStrings,
|
||||
apicall = '',
|
||||
apientry = '',
|
||||
apientryp = '*',
|
||||
alignFuncParam = 48,
|
||||
expandEnumerants = False)
|
||||
]
|
||||
|
||||
# API names to validate man/api spec includes & links
|
||||
genOpts['vkapi.py'] = [
|
||||
PyOutputGenerator,
|
||||
DocGeneratorOptions(
|
||||
filename = 'vkapi.py',
|
||||
directory = directory,
|
||||
apiname = 'vulkan',
|
||||
profile = None,
|
||||
versions = featuresPat,
|
||||
emitversions = featuresPat,
|
||||
defaultExtensions = None,
|
||||
addExtensions = addExtensionsPat,
|
||||
removeExtensions = removeExtensionsPat,
|
||||
emitExtensions = emitExtensionsPat)
|
||||
]
|
||||
|
||||
# API validity files for spec
|
||||
genOpts['validinc'] = [
|
||||
ValidityOutputGenerator,
|
||||
DocGeneratorOptions(
|
||||
filename = 'timeMarker',
|
||||
directory = directory,
|
||||
apiname = 'vulkan',
|
||||
profile = None,
|
||||
versions = featuresPat,
|
||||
emitversions = featuresPat,
|
||||
defaultExtensions = None,
|
||||
addExtensions = addExtensionsPat,
|
||||
removeExtensions = removeExtensionsPat,
|
||||
emitExtensions = emitExtensionsPat)
|
||||
]
|
||||
|
||||
# API host sync table files for spec
|
||||
genOpts['hostsyncinc'] = [
|
||||
HostSynchronizationOutputGenerator,
|
||||
DocGeneratorOptions(
|
||||
filename = 'timeMarker',
|
||||
directory = directory,
|
||||
apiname = 'vulkan',
|
||||
profile = None,
|
||||
versions = featuresPat,
|
||||
emitversions = featuresPat,
|
||||
defaultExtensions = None,
|
||||
addExtensions = addExtensionsPat,
|
||||
removeExtensions = removeExtensionsPat,
|
||||
emitExtensions = emitExtensionsPat)
|
||||
]
|
||||
|
||||
# Extension stub source dispatcher
|
||||
# This target is no longer maintained and supported.
|
||||
# See README.adoc for discussion.
|
||||
genOpts['vulkan_ext.c'] = [
|
||||
ExtensionStubSourceOutputGenerator,
|
||||
CGeneratorOptions(
|
||||
filename = 'vulkan_ext.c',
|
||||
directory = directory,
|
||||
apiname = 'vulkan',
|
||||
profile = None,
|
||||
versions = featuresPat,
|
||||
emitversions = None,
|
||||
defaultExtensions = None,
|
||||
addExtensions = '.*',
|
||||
removeExtensions = removeExtensionsPat,
|
||||
emitExtensions = emitExtensionsPat,
|
||||
prefixText = prefixStrings + vkPrefixStrings,
|
||||
alignFuncParam = 48)
|
||||
]
|
||||
|
||||
# Extension metainformation for spec extension appendices
|
||||
genOpts['extinc'] = [
|
||||
ExtensionMetaDocOutputGenerator,
|
||||
ExtensionMetaDocGeneratorOptions(
|
||||
filename = 'timeMarker',
|
||||
directory = directory,
|
||||
apiname = 'vulkan',
|
||||
profile = None,
|
||||
versions = featuresPat,
|
||||
emitversions = None,
|
||||
defaultExtensions = defaultExtensions,
|
||||
addExtensions = None,
|
||||
removeExtensions = None,
|
||||
emitExtensions = emitExtensionsPat)
|
||||
]
|
||||
|
||||
# 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 platforms.
|
||||
# Covers common WSI extension types.
|
||||
commonSuppressExtensions = [ 'VK_KHR_display', 'VK_KHR_swapchain' ]
|
||||
|
||||
platforms = [
|
||||
[ 'vulkan_android.h', [ 'VK_KHR_android_surface',
|
||||
'VK_ANDROID_external_memory_android_hardware_buffer'
|
||||
], commonSuppressExtensions ],
|
||||
[ 'vulkan_ios.h', [ 'VK_MVK_ios_surface' ], commonSuppressExtensions ],
|
||||
[ 'vulkan_macos.h', [ 'VK_MVK_macos_surface' ], commonSuppressExtensions ],
|
||||
[ 'vulkan_mir.h', [ 'VK_KHR_mir_surface' ], commonSuppressExtensions ],
|
||||
[ 'vulkan_vi.h', [ 'VK_NN_vi_surface' ], commonSuppressExtensions ],
|
||||
[ 'vulkan_wayland.h', [ 'VK_KHR_wayland_surface' ], commonSuppressExtensions ],
|
||||
[ 'vulkan_win32.h', [ 'VK_.*_win32(|_.*)' ], commonSuppressExtensions + [ 'VK_KHR_external_semaphore', 'VK_KHR_external_memory_capabilities', 'VK_KHR_external_fence', 'VK_KHR_external_fence_capabilities', 'VK_NV_external_memory_capabilities' ] ],
|
||||
[ 'vulkan_xcb.h', [ 'VK_KHR_xcb_surface' ], commonSuppressExtensions ],
|
||||
[ 'vulkan_xlib.h', [ 'VK_KHR_xlib_surface' ], commonSuppressExtensions ],
|
||||
[ 'vulkan_xlib_xrandr.h', [ 'VK_EXT_acquire_xlib_display' ], commonSuppressExtensions ],
|
||||
]
|
||||
|
||||
for platform in platforms:
|
||||
headername = platform[0]
|
||||
|
||||
allPlatformExtensions += platform[1]
|
||||
|
||||
addPlatformExtensionsRE = makeREstring(platform[1] + platform[2])
|
||||
emitPlatformExtensionsRE = makeREstring(platform[1])
|
||||
|
||||
opts = CGeneratorOptions(
|
||||
filename = headername,
|
||||
directory = directory,
|
||||
apiname = 'vulkan',
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
genOpts['vulkan_core.h'] = [
|
||||
COutputGenerator,
|
||||
CGeneratorOptions(
|
||||
filename = 'vulkan_core.h',
|
||||
directory = directory,
|
||||
apiname = 'vulkan',
|
||||
profile = None,
|
||||
versions = featuresPat,
|
||||
emitversions = featuresPat,
|
||||
defaultExtensions = defaultExtensions,
|
||||
addExtensions = None,
|
||||
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)
|
||||
]
|
||||
|
||||
# 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(
|
||||
filename = 'vulkan10.h',
|
||||
directory = directory,
|
||||
apiname = 'vulkan',
|
||||
profile = None,
|
||||
versions = 'VK_VERSION_1_0',
|
||||
emitversions = 'VK_VERSION_1_0',
|
||||
defaultExtensions = defaultExtensions,
|
||||
addExtensions = None,
|
||||
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)
|
||||
]
|
||||
|
||||
genOpts['alias.h'] = [
|
||||
COutputGenerator,
|
||||
CGeneratorOptions(
|
||||
filename = 'alias.h',
|
||||
directory = directory,
|
||||
apiname = 'vulkan',
|
||||
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)
|
||||
]
|
||||
|
||||
# Generate a target based on the options in the matching genOpts{} object.
|
||||
# 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
|
||||
def genTarget(args):
|
||||
global genOpts
|
||||
|
||||
# Create generator options with specified parameters
|
||||
makeGenOpts(args)
|
||||
|
||||
if (args.target in genOpts.keys()):
|
||||
createGenerator = genOpts[args.target][0]
|
||||
options = genOpts[args.target][1]
|
||||
|
||||
if not args.quiet:
|
||||
write('* Building', options.filename, file=sys.stderr)
|
||||
write('* options.versions =', options.versions, file=sys.stderr)
|
||||
write('* options.emitversions =', options.emitversions, file=sys.stderr)
|
||||
write('* options.defaultExtensions =', options.defaultExtensions, file=sys.stderr)
|
||||
write('* options.addExtensions =', options.addExtensions, file=sys.stderr)
|
||||
write('* options.removeExtensions =', options.removeExtensions, file=sys.stderr)
|
||||
write('* options.emitExtensions =', options.emitExtensions, file=sys.stderr)
|
||||
|
||||
startTimer(args.time)
|
||||
gen = createGenerator(errFile=errWarn,
|
||||
warnFile=errWarn,
|
||||
diagFile=diag)
|
||||
reg.setGenerator(gen)
|
||||
reg.apiGen(options)
|
||||
|
||||
if not args.quiet:
|
||||
write('* Generated', options.filename, file=sys.stderr)
|
||||
endTimer(args.time, '* Time to generate ' + options.filename + ' =')
|
||||
else:
|
||||
write('No generator options for unknown target:',
|
||||
args.target, file=sys.stderr)
|
||||
|
||||
# -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('-defaultExtensions', action='store',
|
||||
default='vulkan',
|
||||
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('-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('-validate', action='store_true',
|
||||
help='Enable group validation')
|
||||
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.')
|
||||
|
||||
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()]
|
||||
|
||||
# Load & parse registry
|
||||
reg = Registry()
|
||||
|
||||
startTimer(args.time)
|
||||
tree = etree.parse(args.registry)
|
||||
endTimer(args.time, '* Time to make ElementTree =')
|
||||
|
||||
if args.debug:
|
||||
pdb.run('reg.loadElementTree(tree)')
|
||||
else:
|
||||
startTimer(args.time)
|
||||
reg.loadElementTree(tree)
|
||||
endTimer(args.time, '* Time to parse ElementTree =')
|
||||
|
||||
if (args.validate):
|
||||
reg.validateGroups()
|
||||
|
||||
if (args.dump):
|
||||
write('* Dumping registry to regdump.txt', file=sys.stderr)
|
||||
reg.dumpReg(filehandle = open('regdump.txt', 'w', encoding='utf-8'))
|
||||
|
||||
# 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.debug):
|
||||
pdb.run('genTarget(args)')
|
||||
elif (args.profile):
|
||||
import cProfile, pstats
|
||||
cProfile.run('genTarget(args)', 'profile.txt')
|
||||
p = pstats.Stats('profile.txt')
|
||||
p.strip_dirs().sort_stats('time').print_stats(50)
|
||||
else:
|
||||
genTarget(args)
|
404
registry/parse_dependency.py
Executable file
404
registry/parse_dependency.py
Executable file
|
@ -0,0 +1,404 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2022-2025 The Khronos Group Inc.
|
||||
# Copyright 2003-2019 Paul McGuire
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# apirequirements.py - parse 'depends' expressions in API XML
|
||||
# Supported methods:
|
||||
# dependency - the expression string
|
||||
#
|
||||
# evaluateDependency(dependency, isSupported) evaluates the expression,
|
||||
# returning a boolean result. isSupported takes an extension or version name
|
||||
# string and returns a boolean.
|
||||
#
|
||||
# dependencyLanguage(dependency) returns an English string equivalent
|
||||
# to the expression, suitable for header file comments.
|
||||
#
|
||||
# dependencyNames(dependency) returns a set of the extension and
|
||||
# version names in the expression.
|
||||
#
|
||||
# dependencyMarkup(dependency) returns a string containing asciidoctor
|
||||
# markup for English equivalent to the expression, suitable for extension
|
||||
# appendices.
|
||||
#
|
||||
# All may throw a ParseException if the expression cannot be parsed or is
|
||||
# not completely consumed by parsing.
|
||||
|
||||
# Supported expressions at present:
|
||||
# - extension names
|
||||
# - '+' as AND connector
|
||||
# - ',' as OR connector
|
||||
# - parenthesization for grouping
|
||||
|
||||
# Based on `examples/fourFn.py` from the
|
||||
# https://github.com/pyparsing/pyparsing/ repository.
|
||||
|
||||
from pyparsing import (
|
||||
Literal,
|
||||
Word,
|
||||
Group,
|
||||
Forward,
|
||||
alphas,
|
||||
alphanums,
|
||||
Regex,
|
||||
ParseException,
|
||||
CaselessKeyword,
|
||||
Suppress,
|
||||
delimitedList,
|
||||
infixNotation,
|
||||
)
|
||||
import math
|
||||
import operator
|
||||
import pyparsing as pp
|
||||
import re
|
||||
|
||||
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"""
|
||||
|
||||
return conventions.formatVersionOrExtension(name)
|
||||
|
||||
def leafMarkupC(name):
|
||||
"""Markup a leaf name as a C expression, using conventions of the
|
||||
Vulkan Validation Layers
|
||||
|
||||
- name - version or extension name"""
|
||||
|
||||
(apivariant, major, minor) = apiVersionNameMatch(name)
|
||||
|
||||
if apivariant is not None:
|
||||
return name
|
||||
else:
|
||||
return f'ext.{name}'
|
||||
|
||||
opMarkupAsciidocMap = { '+' : 'and', ',' : 'or' }
|
||||
|
||||
def opMarkupAsciidoc(op):
|
||||
"""Markup an operator as an asciidoc spec markup equivalent
|
||||
|
||||
- op - operator ('+' or ',')"""
|
||||
|
||||
return opMarkupAsciidocMap[op]
|
||||
|
||||
opMarkupCMap = { '+' : '&&', ',' : '||' }
|
||||
|
||||
def opMarkupC(op):
|
||||
"""Markup an operator as a C language equivalent
|
||||
|
||||
- op - operator ('+' or ',')"""
|
||||
|
||||
return opMarkupCMap[op]
|
||||
|
||||
|
||||
# Unfortunately global to be used in pyparsing
|
||||
exprStack = []
|
||||
|
||||
def push_first(toks):
|
||||
"""Push a token on the global stack
|
||||
|
||||
- toks - first element is the token to push"""
|
||||
|
||||
exprStack.append(toks[0])
|
||||
|
||||
# An identifier (version, feature boolean, or extension name)
|
||||
dependencyIdent = Word(f"{alphanums}_:")
|
||||
|
||||
# Infix expression for depends expressions
|
||||
dependencyExpr = pp.infixNotation(dependencyIdent,
|
||||
[ (pp.oneOf(', +'), 2, pp.opAssoc.LEFT), ])
|
||||
|
||||
# BNF grammar for depends expressions
|
||||
_bnf = None
|
||||
def dependencyBNF():
|
||||
"""
|
||||
boolop :: '+' | ','
|
||||
extname :: Char(alphas)
|
||||
atom :: extname | '(' expr ')'
|
||||
expr :: atom [ boolop atom ]*
|
||||
"""
|
||||
global _bnf
|
||||
if _bnf is None:
|
||||
and_, or_ = map(Literal, '+,')
|
||||
lpar, rpar = map(Suppress, '()')
|
||||
boolop = and_ | or_
|
||||
|
||||
expr = Forward()
|
||||
expr_list = delimitedList(Group(expr))
|
||||
atom = (
|
||||
boolop[...]
|
||||
+ (
|
||||
(dependencyIdent).setParseAction(push_first)
|
||||
| Group(lpar + expr + rpar)
|
||||
)
|
||||
)
|
||||
|
||||
expr <<= atom + (boolop + atom).setParseAction(push_first)[...]
|
||||
_bnf = expr
|
||||
return _bnf
|
||||
|
||||
|
||||
# map operator symbols to corresponding arithmetic operations
|
||||
_opn = {
|
||||
'+': operator.and_,
|
||||
',': operator.or_,
|
||||
}
|
||||
|
||||
def evaluateStack(stack, isSupported):
|
||||
"""Evaluate an expression stack, returning a boolean result.
|
||||
|
||||
- stack - the stack
|
||||
- isSupported - function taking a version or extension name string and
|
||||
returning True or False if that name is supported or not."""
|
||||
|
||||
op, num_args = stack.pop(), 0
|
||||
if isinstance(op, tuple):
|
||||
op, num_args = op
|
||||
|
||||
if op in '+,':
|
||||
# Note: operands are pushed onto the stack in reverse order
|
||||
op2 = evaluateStack(stack, isSupported)
|
||||
op1 = evaluateStack(stack, isSupported)
|
||||
return _opn[op](op1, op2)
|
||||
elif op[0].isalpha():
|
||||
return isSupported(op)
|
||||
else:
|
||||
raise Exception(f'invalid op: {op}')
|
||||
|
||||
def evaluateDependency(dependency, isSupported):
|
||||
"""Evaluate a dependency expression, returning a boolean result.
|
||||
|
||||
- dependency - the expression
|
||||
- isSupported - function taking a version or extension name string and
|
||||
returning True or False if that name is supported or not."""
|
||||
|
||||
global exprStack
|
||||
exprStack = []
|
||||
results = dependencyBNF().parseString(dependency, parseAll=True)
|
||||
val = evaluateStack(exprStack[:], isSupported)
|
||||
return val
|
||||
|
||||
def evalDependencyLanguage(stack, leafMarkup, opMarkup, parenthesize, root):
|
||||
"""Evaluate an expression stack, returning an English equivalent
|
||||
|
||||
- stack - the stack
|
||||
- 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, 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
|
||||
return leafMarkup(op)
|
||||
else:
|
||||
raise Exception(f'invalid op: {op}')
|
||||
|
||||
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
|
||||
- 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, 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
|
||||
feature names used in the expression.
|
||||
|
||||
- stack - the stack"""
|
||||
|
||||
op, num_args = stack.pop(), 0
|
||||
if isinstance(op, tuple):
|
||||
op, num_args = op
|
||||
if op in '+,':
|
||||
# Do not evaluate the operation. We only care about the names.
|
||||
return evalDependencyNames(stack) | evalDependencyNames(stack)
|
||||
elif op[0].isalpha():
|
||||
return { op }
|
||||
else:
|
||||
raise Exception(f'invalid op: {op}')
|
||||
|
||||
def dependencyNames(dependency):
|
||||
"""Return a set of the extension and version names in an API dependency
|
||||
expression. Used when determining transitive dependencies for spec
|
||||
generation with specific extensions included.
|
||||
|
||||
- dependency - the expression"""
|
||||
|
||||
global exprStack
|
||||
exprStack = []
|
||||
results = dependencyBNF().parseString(dependency, parseAll=True)
|
||||
# print(f'names(): stack = {exprStack}')
|
||||
return evalDependencyNames(exprStack)
|
||||
|
||||
def markupTraverse(expr, level = 0, root = True):
|
||||
"""Recursively process a dependency in infix form, transforming it into
|
||||
asciidoctor markup with expression nesting indicated by indentation
|
||||
level.
|
||||
|
||||
- expr - expression to process
|
||||
- level - indentation level to render expression at
|
||||
- root - True only on initial call"""
|
||||
|
||||
if level > 0:
|
||||
prefix = f"{'{nbsp}{nbsp}' * level * 2} "
|
||||
else:
|
||||
prefix = ''
|
||||
str = ''
|
||||
|
||||
for elem in expr:
|
||||
if isinstance(elem, pp.ParseResults):
|
||||
if not root:
|
||||
nextlevel = level + 1
|
||||
else:
|
||||
# Do not indent the outer expression
|
||||
nextlevel = level
|
||||
|
||||
str = str + markupTraverse(elem, level = nextlevel, root = False)
|
||||
elif elem in ('+', ','):
|
||||
str = f"{str}{prefix}{opMarkupAsciidoc(elem)} +\n"
|
||||
else:
|
||||
str = f"{str}{prefix}{leafMarkupAsciidoc(elem)} +\n"
|
||||
|
||||
return str
|
||||
|
||||
def dependencyMarkup(dependency):
|
||||
"""Return asciidoctor markup for a human-readable equivalent of an API
|
||||
dependency expression, suitable for use in extension appendix
|
||||
metadata.
|
||||
|
||||
- dependency - the expression"""
|
||||
|
||||
parsed = dependencyExpr.parseString(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,
|
||||
'false' : False,
|
||||
'true' : True,
|
||||
}
|
||||
termSupported = lambda name: name in termdict and termdict[name]
|
||||
|
||||
def test(dependency, expected):
|
||||
val = False
|
||||
try:
|
||||
val = evaluateDependency(dependency, termSupported)
|
||||
except ParseException as pe:
|
||||
print(dependency, f'failed parse: {dependency}')
|
||||
except Exception as e:
|
||||
print(dependency, f'failed eval: {dependency}')
|
||||
|
||||
if val == expected:
|
||||
True
|
||||
# print(f'{dependency} = {val} (as expected)')
|
||||
else:
|
||||
print(f'{dependency} ERROR: {val} != {expected}')
|
||||
|
||||
# Verify expressions are evaluated left-to-right
|
||||
|
||||
test('false,false+false', False)
|
||||
test('false,false+true', False)
|
||||
test('false,true+false', False)
|
||||
test('false,true+true', True)
|
||||
test('true,false+false', False)
|
||||
test('true,false+true', True)
|
||||
test('true,true+false', False)
|
||||
test('true,true+true', True)
|
||||
|
||||
test('false,(false+false)', False)
|
||||
test('false,(false+true)', False)
|
||||
test('false,(true+false)', False)
|
||||
test('false,(true+true)', True)
|
||||
test('true,(false+false)', True)
|
||||
test('true,(false+true)', True)
|
||||
test('true,(true+false)', True)
|
||||
test('true,(true+true)', True)
|
||||
|
||||
|
||||
test('false+false,false', False)
|
||||
test('false+false,true', True)
|
||||
test('false+true,false', False)
|
||||
test('false+true,true', True)
|
||||
test('true+false,false', False)
|
||||
test('true+false,true', True)
|
||||
test('true+true,false', True)
|
||||
test('true+true,true', True)
|
||||
|
||||
test('false+(false,false)', False)
|
||||
test('false+(false,true)', False)
|
||||
test('false+(true,false)', False)
|
||||
test('false+(true,true)', False)
|
||||
test('true+(false,false)', False)
|
||||
test('true+(false,true)', True)
|
||||
test('true+(true,false)', True)
|
||||
test('true+(true,true)', True)
|
||||
|
||||
# Check formatting
|
||||
for dependency in [
|
||||
#'true',
|
||||
#'true+true+false',
|
||||
'true+false',
|
||||
'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' 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)}')
|
390
registry/profiles/VP_KHR_roadmap.json
Normal file
390
registry/profiles/VP_KHR_roadmap.json
Normal file
|
@ -0,0 +1,390 @@
|
|||
{
|
||||
"$schema": "https://schema.khronos.org/vulkan/profiles-0.8.2-276.json#",
|
||||
"capabilities": {
|
||||
"vulkan10requirements": {
|
||||
"features": {
|
||||
"VkPhysicalDeviceFeatures": {
|
||||
"robustBufferAccess": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkan11requirements": {
|
||||
"features": {
|
||||
"VkPhysicalDeviceVulkan11Features": {
|
||||
"multiview": true
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"VkPhysicalDeviceVulkan11Properties": {
|
||||
"maxMultiviewViewCount": 6,
|
||||
"maxMultiviewInstanceIndex": 134217727
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkan12requirements": {
|
||||
"features": {
|
||||
"VkPhysicalDeviceVulkan12Features": {
|
||||
"uniformBufferStandardLayout": true,
|
||||
"subgroupBroadcastDynamicId": true,
|
||||
"imagelessFramebuffer": true,
|
||||
"separateDepthStencilLayouts": true,
|
||||
"hostQueryReset": true,
|
||||
"timelineSemaphore": true,
|
||||
"shaderSubgroupExtendedTypes": true
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"VkPhysicalDeviceVulkan12Properties": {
|
||||
"maxTimelineSemaphoreValueDifference": 2147483647
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkan13requirements": {
|
||||
"features": {
|
||||
"VkPhysicalDeviceVulkan12Features": {
|
||||
"vulkanMemoryModel": true,
|
||||
"vulkanMemoryModelDeviceScope": true,
|
||||
"bufferDeviceAddress": true
|
||||
},
|
||||
"VkPhysicalDeviceVulkan13Features": {
|
||||
"robustImageAccess": true,
|
||||
"shaderTerminateInvocation": true,
|
||||
"shaderZeroInitializeWorkgroupMemory": true,
|
||||
"synchronization2": true,
|
||||
"shaderIntegerDotProduct": true,
|
||||
"maintenance4": true,
|
||||
"pipelineCreationCacheControl": true,
|
||||
"subgroupSizeControl": true,
|
||||
"computeFullSubgroups": true,
|
||||
"shaderDemoteToHelperInvocation": true,
|
||||
"inlineUniformBlock": true,
|
||||
"dynamicRendering": true
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"VkPhysicalDeviceVulkan13Properties": {
|
||||
"maxBufferSize": 1073741824,
|
||||
"maxInlineUniformBlockSize": 256,
|
||||
"maxPerStageDescriptorInlineUniformBlocks": 4,
|
||||
"maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks": 4,
|
||||
"maxDescriptorSetInlineUniformBlocks": 4,
|
||||
"maxDescriptorSetUpdateAfterBindInlineUniformBlocks": 4,
|
||||
"maxInlineUniformTotalSize": 256
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkan10requirements_roadmap2022": {
|
||||
"features": {
|
||||
"VkPhysicalDeviceFeatures": {
|
||||
"fullDrawIndexUint32": true,
|
||||
"imageCubeArray": true,
|
||||
"independentBlend": true,
|
||||
"sampleRateShading": true,
|
||||
"drawIndirectFirstInstance": true,
|
||||
"depthClamp": true,
|
||||
"depthBiasClamp": true,
|
||||
"samplerAnisotropy": true,
|
||||
"occlusionQueryPrecise": true,
|
||||
"fragmentStoresAndAtomics": true,
|
||||
"shaderStorageImageExtendedFormats": true,
|
||||
"shaderUniformBufferArrayDynamicIndexing": true,
|
||||
"shaderSampledImageArrayDynamicIndexing": true,
|
||||
"shaderStorageBufferArrayDynamicIndexing": true,
|
||||
"shaderStorageImageArrayDynamicIndexing": true
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"VkPhysicalDeviceProperties": {
|
||||
"limits": {
|
||||
"maxImageDimension1D": 8192,
|
||||
"maxImageDimension2D": 8192,
|
||||
"maxImageDimensionCube": 8192,
|
||||
"maxImageArrayLayers": 2048,
|
||||
"maxUniformBufferRange": 65536,
|
||||
"bufferImageGranularity": 4096,
|
||||
"maxPerStageDescriptorSamplers": 64,
|
||||
"maxPerStageDescriptorUniformBuffers": 15,
|
||||
"maxPerStageDescriptorStorageBuffers": 30,
|
||||
"maxPerStageDescriptorSampledImages": 200,
|
||||
"maxPerStageDescriptorStorageImages": 16,
|
||||
"maxPerStageResources": 200,
|
||||
"maxDescriptorSetSamplers": 576,
|
||||
"maxDescriptorSetUniformBuffers": 90,
|
||||
"maxDescriptorSetStorageBuffers": 96,
|
||||
"maxDescriptorSetSampledImages": 1800,
|
||||
"maxDescriptorSetStorageImages": 144,
|
||||
"maxFragmentCombinedOutputResources": 16,
|
||||
"maxComputeWorkGroupInvocations": 256,
|
||||
"maxComputeWorkGroupSize": [ 256, 256, 64 ],
|
||||
"subTexelPrecisionBits": 8,
|
||||
"mipmapPrecisionBits": 6,
|
||||
"maxSamplerLodBias": 14,
|
||||
"standardSampleLocations": true,
|
||||
"maxColorAttachments": 7
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkan10optionals_roadmap2022": {
|
||||
"features": {
|
||||
"VkPhysicalDeviceFeatures": {
|
||||
"largePoints": true,
|
||||
"wideLines": true
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"VkPhysicalDeviceProperties": {
|
||||
"limits": {
|
||||
"pointSizeGranularity": 0.125,
|
||||
"lineWidthGranularity": 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkan11requirements_roadmap2022": {
|
||||
"features": {
|
||||
"VkPhysicalDeviceVulkan11Features": {
|
||||
"samplerYcbcrConversion": true
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"VkPhysicalDeviceVulkan11Properties": {
|
||||
"subgroupSize": 4,
|
||||
"subgroupSupportedStages": [ "VK_SHADER_STAGE_COMPUTE_BIT", "VK_SHADER_STAGE_FRAGMENT_BIT" ],
|
||||
"subgroupSupportedOperations": [ "VK_SUBGROUP_FEATURE_BASIC_BIT", "VK_SUBGROUP_FEATURE_VOTE_BIT", "VK_SUBGROUP_FEATURE_ARITHMETIC_BIT", "VK_SUBGROUP_FEATURE_BALLOT_BIT", "VK_SUBGROUP_FEATURE_SHUFFLE_BIT", "VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT", "VK_SUBGROUP_FEATURE_QUAD_BIT" ]
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkan12requirements_roadmap2022": {
|
||||
"features": {
|
||||
"VkPhysicalDeviceVulkan12Features": {
|
||||
"samplerMirrorClampToEdge": true,
|
||||
"descriptorIndexing": true,
|
||||
"shaderUniformTexelBufferArrayDynamicIndexing": true,
|
||||
"shaderStorageTexelBufferArrayDynamicIndexing": true,
|
||||
"shaderUniformBufferArrayNonUniformIndexing": true,
|
||||
"shaderSampledImageArrayNonUniformIndexing": true,
|
||||
"shaderStorageBufferArrayNonUniformIndexing": true,
|
||||
"shaderStorageImageArrayNonUniformIndexing": true,
|
||||
"shaderUniformTexelBufferArrayNonUniformIndexing": true,
|
||||
"shaderStorageTexelBufferArrayNonUniformIndexing": true,
|
||||
"descriptorBindingSampledImageUpdateAfterBind": true,
|
||||
"descriptorBindingStorageImageUpdateAfterBind": true,
|
||||
"descriptorBindingStorageBufferUpdateAfterBind": true,
|
||||
"descriptorBindingUniformTexelBufferUpdateAfterBind": true,
|
||||
"descriptorBindingStorageTexelBufferUpdateAfterBind": true,
|
||||
"descriptorBindingUpdateUnusedWhilePending": true,
|
||||
"descriptorBindingPartiallyBound": true,
|
||||
"descriptorBindingVariableDescriptorCount": true,
|
||||
"runtimeDescriptorArray": true,
|
||||
"scalarBlockLayout": true
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"VkPhysicalDeviceVulkan12Properties": {
|
||||
"shaderSignedZeroInfNanPreserveFloat16": true,
|
||||
"shaderSignedZeroInfNanPreserveFloat32": true,
|
||||
"maxPerStageDescriptorUpdateAfterBindSamplers": 500000,
|
||||
"maxPerStageDescriptorUpdateAfterBindUniformBuffers": 12,
|
||||
"maxPerStageDescriptorUpdateAfterBindStorageBuffers": 500000,
|
||||
"maxPerStageDescriptorUpdateAfterBindSampledImages": 500000,
|
||||
"maxPerStageDescriptorUpdateAfterBindStorageImages": 500000,
|
||||
"maxPerStageDescriptorUpdateAfterBindInputAttachments": 7,
|
||||
"maxPerStageUpdateAfterBindResources": 500000,
|
||||
"maxDescriptorSetUpdateAfterBindSamplers": 500000,
|
||||
"maxDescriptorSetUpdateAfterBindUniformBuffers": 72,
|
||||
"maxDescriptorSetUpdateAfterBindUniformBuffersDynamic": 8,
|
||||
"maxDescriptorSetUpdateAfterBindStorageBuffers": 500000,
|
||||
"maxDescriptorSetUpdateAfterBindStorageBuffersDynamic": 4,
|
||||
"maxDescriptorSetUpdateAfterBindSampledImages": 500000,
|
||||
"maxDescriptorSetUpdateAfterBindStorageImages": 500000,
|
||||
"maxDescriptorSetUpdateAfterBindInputAttachments": 7
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkan13requirements_roadmap2022": {
|
||||
"extensions": {
|
||||
"VK_KHR_global_priority": 1
|
||||
},
|
||||
"features": {
|
||||
"VkPhysicalDeviceVulkan13Features": {
|
||||
"descriptorBindingInlineUniformBlockUpdateAfterBind": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkan10requirements_roadmap2024": {
|
||||
"features": {
|
||||
"VkPhysicalDeviceFeatures": {
|
||||
"multiDrawIndirect": true,
|
||||
"shaderInt16": true,
|
||||
"shaderImageGatherExtended": true
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"VkPhysicalDeviceProperties": {
|
||||
"limits": {
|
||||
"timestampComputeAndGraphics": true,
|
||||
"maxColorAttachments": 8,
|
||||
"maxBoundDescriptorSets": 7
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkan11requirements_roadmap2024": {
|
||||
"features": {
|
||||
"VkPhysicalDeviceVulkan11Features": {
|
||||
"shaderDrawParameters": true,
|
||||
"storageBuffer16BitAccess": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkan12requirements_roadmap2024": {
|
||||
"features": {
|
||||
"VkPhysicalDeviceVulkan12Features": {
|
||||
"shaderInt8": true,
|
||||
"shaderFloat16": true,
|
||||
"storageBuffer8BitAccess": true
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"VkPhysicalDeviceVulkan12Properties": {
|
||||
"shaderRoundingModeRTEFloat16": true,
|
||||
"shaderRoundingModeRTEFloat32": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkan13requirements_roadmap2024": {
|
||||
"features": {
|
||||
"VkPhysicalDeviceVulkan13Features": {
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"VkPhysicalDeviceVulkan13Properties": {
|
||||
}
|
||||
}
|
||||
},
|
||||
"vulkanextensionrequirements_roadmap2024": {
|
||||
"extensions": {
|
||||
"VK_KHR_dynamic_rendering_local_read": 1,
|
||||
"VK_KHR_load_store_op_none": 1,
|
||||
"VK_KHR_shader_quad_control": 1,
|
||||
"VK_KHR_shader_maximal_reconvergence": 1,
|
||||
"VK_KHR_shader_subgroup_uniform_control_flow": 1,
|
||||
"VK_KHR_shader_subgroup_rotate": 1,
|
||||
"VK_KHR_shader_float_controls2": 1,
|
||||
"VK_KHR_shader_expect_assume": 1,
|
||||
"VK_KHR_line_rasterization": 1,
|
||||
"VK_KHR_vertex_attribute_divisor": 1,
|
||||
"VK_KHR_index_type_uint8": 1,
|
||||
"VK_KHR_map_memory2": 1,
|
||||
"VK_KHR_maintenance5": 1,
|
||||
"VK_KHR_push_descriptor": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"VP_KHR_roadmap_2024": {
|
||||
"version": 1,
|
||||
"api-version": "1.3.276",
|
||||
"label": "Khronos Vulkan Roadmap 2024 profile",
|
||||
"description": "This roadmap profile is intended to be supported by newer devices shipping in 2024 across mainstream smartphone, tablet, laptops, console and desktop devices.",
|
||||
"profiles": [
|
||||
"VP_KHR_roadmap_2022"
|
||||
],
|
||||
"capabilities": [
|
||||
"vulkan10requirements_roadmap2024",
|
||||
"vulkan11requirements_roadmap2024",
|
||||
"vulkan12requirements_roadmap2024",
|
||||
"vulkan13requirements_roadmap2024",
|
||||
"vulkanextensionrequirements_roadmap2024"
|
||||
]
|
||||
},
|
||||
"VP_KHR_roadmap_2022": {
|
||||
"version": 1,
|
||||
"api-version": "1.3.204",
|
||||
"label": "Khronos Vulkan Roadmap 2022 profile",
|
||||
"description": "This roadmap profile is intended to be supported by newer devices shipping in 2022 across mainstream smartphone, tablet, laptops, console and desktop devices.",
|
||||
"contributors": {
|
||||
"Tobias Hector": {
|
||||
"company": "AMD",
|
||||
"email": "tobias.hector@amd.com",
|
||||
"contact": true
|
||||
},
|
||||
"Christophe Riccio": {
|
||||
"company": "LunarG",
|
||||
"email": "christophe@lunarg.com",
|
||||
"contact": true
|
||||
}
|
||||
},
|
||||
"history": [
|
||||
{
|
||||
"revision": 9,
|
||||
"date": "2024-01-16",
|
||||
"author": "Tobias Hector",
|
||||
"comment": "Add Roadmap 2024 profile"
|
||||
},
|
||||
{
|
||||
"revision": 8,
|
||||
"date": "2023-11-02",
|
||||
"author": "Christophe Riccio",
|
||||
"comment": "Remove unreferenced capabilities blocks that were written against Vulkan 1.2 for testing before Vulkan 1.3 was released"
|
||||
},
|
||||
{
|
||||
"revision": 7,
|
||||
"date": "2022-11-16",
|
||||
"author": "Christophe Riccio",
|
||||
"comment": "Fix wideLines and largePoints that are optionals"
|
||||
},
|
||||
{
|
||||
"revision": 6,
|
||||
"date": "2022-11-02",
|
||||
"author": "Christophe Riccio",
|
||||
"comment": "Fix roadmap 2022 maxInlineUniformTotalSize limit, 256 instead of 4"
|
||||
},
|
||||
{
|
||||
"revision": 5,
|
||||
"date": "2022-05-02",
|
||||
"author": "Christophe Riccio",
|
||||
"comment": "Add missing dynamicRendering that is a Vulkan 1.3 requirement"
|
||||
},
|
||||
{
|
||||
"revision": 4,
|
||||
"date": "2022-03-08",
|
||||
"author": "Christophe Riccio",
|
||||
"comment": "Refactor requirements per Vulkan API version"
|
||||
},
|
||||
{
|
||||
"revision": 3,
|
||||
"date": "2022-03-08",
|
||||
"author": "Christophe Riccio",
|
||||
"comment": "Fix Vulkan 1.3.204 API version requirement"
|
||||
},
|
||||
{
|
||||
"revision": 2,
|
||||
"date": "2022-01-03",
|
||||
"author": "Christophe Riccio",
|
||||
"comment": "Rebase against Vulkan 1.3.203 revision"
|
||||
},
|
||||
{
|
||||
"revision": 1,
|
||||
"date": "2021-12-08",
|
||||
"author": "Christophe Riccio",
|
||||
"comment": "Initial revision"
|
||||
}
|
||||
],
|
||||
"capabilities": [
|
||||
"vulkan10requirements",
|
||||
"vulkan10requirements_roadmap2022",
|
||||
"vulkan11requirements",
|
||||
"vulkan11requirements_roadmap2022",
|
||||
"vulkan12requirements",
|
||||
"vulkan12requirements_roadmap2022",
|
||||
"vulkan13requirements",
|
||||
"vulkan13requirements_roadmap2022"
|
||||
],
|
||||
"optionals": [
|
||||
"vulkan10optionals_roadmap2022"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
1900
registry/reg.py
1900
registry/reg.py
File diff suppressed because it is too large
Load diff
562
registry/spec_tools/conventions.py
Normal file
562
registry/spec_tools/conventions.py
Normal file
|
@ -0,0 +1,562 @@
|
|||
#!/usr/bin/env python3 -i
|
||||
#
|
||||
# Copyright 2013-2025 The Khronos Group Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Base class for working-group-specific style conventions,
|
||||
# used in generation.
|
||||
|
||||
from enum import Enum
|
||||
import abc
|
||||
import re
|
||||
|
||||
# Type categories that respond "False" to isStructAlwaysValid
|
||||
# basetype is home to typedefs like ..Bool32
|
||||
CATEGORIES_REQUIRING_VALIDATION = set(('handle',
|
||||
'enum',
|
||||
'bitmask',
|
||||
'basetype',
|
||||
None))
|
||||
|
||||
# These are basic C types pulled in via openxr_platform_defines.h
|
||||
TYPES_KNOWN_ALWAYS_VALID = set(('char',
|
||||
'float',
|
||||
'int8_t', 'uint8_t',
|
||||
'int16_t', 'uint16_t',
|
||||
'int32_t', 'uint32_t',
|
||||
'int64_t', 'uint64_t',
|
||||
'size_t',
|
||||
'intptr_t', 'uintptr_t',
|
||||
'int',
|
||||
))
|
||||
|
||||
# Split an extension name into vendor ID and name portions
|
||||
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'(?P<apivariant>[A-Za-z]+)_VERSION_(?P<major>[0-9]+)_(?P<minor>[0-9]+)')
|
||||
|
||||
class ProseListFormats(Enum):
|
||||
"""A connective, possibly with a quantifier."""
|
||||
AND = 0
|
||||
EACH_AND = 1
|
||||
OR = 2
|
||||
ANY_OR = 3
|
||||
|
||||
@classmethod
|
||||
def from_string(cls, s):
|
||||
if s == 'or':
|
||||
return cls.OR
|
||||
if s == 'and':
|
||||
return cls.AND
|
||||
raise RuntimeError(f"Unrecognized string connective: {s}")
|
||||
|
||||
@property
|
||||
def connective(self):
|
||||
if self in (ProseListFormats.OR, ProseListFormats.ANY_OR):
|
||||
return 'or'
|
||||
return 'and'
|
||||
|
||||
def quantifier(self, n):
|
||||
"""Return the desired quantifier for a list of a given length."""
|
||||
if self == ProseListFormats.ANY_OR:
|
||||
if n > 1:
|
||||
return 'any of '
|
||||
elif self == ProseListFormats.EACH_AND:
|
||||
if n > 2:
|
||||
return 'each of '
|
||||
if n == 2:
|
||||
return 'both of '
|
||||
return ''
|
||||
|
||||
|
||||
class ConventionsBase(abc.ABC):
|
||||
"""WG-specific conventions."""
|
||||
|
||||
def __init__(self):
|
||||
self._command_prefix = None
|
||||
self._type_prefix = None
|
||||
|
||||
def formatVersionOrExtension(self, name):
|
||||
"""Mark up an API version or extension name as a link in the spec."""
|
||||
|
||||
# Is this a version name?
|
||||
match = API_VERSION_NAME_RE.match(name)
|
||||
if match is not None:
|
||||
return self.formatVersion(name,
|
||||
match.group('apivariant'),
|
||||
match.group('major'),
|
||||
match.group('minor'))
|
||||
else:
|
||||
# If not, assumed to be an extension name. Might be worth checking.
|
||||
return self.formatExtension(name)
|
||||
|
||||
def formatVersion(self, name, apivariant, major, minor):
|
||||
"""Mark up an API version name as a link in the spec."""
|
||||
return f'`<<{name}>>`'
|
||||
|
||||
def formatExtension(self, name):
|
||||
"""Mark up an extension name as a link in the spec."""
|
||||
return f'`<<{name}>>`'
|
||||
|
||||
def formatSPIRVlink(self, name):
|
||||
"""Mark up a SPIR-V extension name as an external link in the spec.
|
||||
Since these are external links, the formatting probably will be
|
||||
the same for all APIs creating such links, so long as they use
|
||||
the asciidoctor {spirv} attribute for the base path to the SPIR-V
|
||||
extensions."""
|
||||
|
||||
(vendor, _) = self.extension_name_split(name)
|
||||
|
||||
return f'{{spirv}}/{vendor}/{name}.html[{name}]'
|
||||
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def null(self):
|
||||
"""Preferred spelling of NULL."""
|
||||
raise NotImplementedError
|
||||
|
||||
def makeProseList(self, elements, fmt=ProseListFormats.AND, with_verb=False, *args, **kwargs):
|
||||
"""Make a (comma-separated) list for use in prose.
|
||||
|
||||
Adds a connective (by default, 'and')
|
||||
before the last element if there are more than 1.
|
||||
|
||||
Adds the right one of "is" or "are" to the end if with_verb is true.
|
||||
|
||||
Optionally adds a quantifier (like 'any') before a list of 2 or more,
|
||||
if specified by fmt.
|
||||
|
||||
Override with a different method or different call to
|
||||
_implMakeProseList if you want to add a comma for two elements,
|
||||
or not use a serial comma.
|
||||
"""
|
||||
return self._implMakeProseList(elements, fmt, with_verb, *args, **kwargs)
|
||||
|
||||
@property
|
||||
def struct_macro(self):
|
||||
"""Get the appropriate format macro for a structure.
|
||||
|
||||
May override.
|
||||
"""
|
||||
return 'slink:'
|
||||
|
||||
@property
|
||||
def external_macro(self):
|
||||
"""Get the appropriate format macro for an external type like uint32_t.
|
||||
|
||||
May override.
|
||||
"""
|
||||
return 'code:'
|
||||
|
||||
@property
|
||||
def allows_x_number_suffix(self):
|
||||
"""Whether vendor tags can be suffixed with X and a number to mark experimental extensions."""
|
||||
return False
|
||||
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def structtype_member_name(self):
|
||||
"""Return name of the structure type member.
|
||||
|
||||
Must implement.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def nextpointer_member_name(self):
|
||||
"""Return name of the structure pointer chain member.
|
||||
|
||||
Must implement.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def xml_api_name(self):
|
||||
"""Return the name used in the default API XML registry for the default API"""
|
||||
raise NotImplementedError()
|
||||
|
||||
@abc.abstractmethod
|
||||
def generate_structure_type_from_name(self, structname):
|
||||
"""Generate a structure type name, like XR_TYPE_CREATE_INSTANCE_INFO.
|
||||
|
||||
Must implement.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def makeStructName(self, name):
|
||||
"""Prepend the appropriate format macro for a structure to a structure type name.
|
||||
|
||||
Uses struct_macro, so just override that if you want to change behavior.
|
||||
"""
|
||||
return self.struct_macro + name
|
||||
|
||||
def makeExternalTypeName(self, name):
|
||||
"""Prepend the appropriate format macro for an external type like uint32_t to a type name.
|
||||
|
||||
Uses external_macro, so just override that if you want to change behavior.
|
||||
"""
|
||||
return self.external_macro + name
|
||||
|
||||
def _implMakeProseList(self, elements, fmt, with_verb, comma_for_two_elts=False, serial_comma=True):
|
||||
"""Internal-use implementation to make a (comma-separated) list for use in prose.
|
||||
|
||||
Adds a connective (by default, 'and')
|
||||
before the last element if there are more than 1,
|
||||
and only includes commas if there are more than 2
|
||||
(if comma_for_two_elts is False).
|
||||
|
||||
Adds the right one of "is" or "are" to the end if with_verb is true.
|
||||
|
||||
Optionally adds a quantifier (like 'any') before a list of 2 or more,
|
||||
if specified by fmt.
|
||||
|
||||
Do not edit these defaults, override self.makeProseList().
|
||||
"""
|
||||
assert serial_comma # did not implement what we did not need
|
||||
if isinstance(fmt, str):
|
||||
fmt = ProseListFormats.from_string(fmt)
|
||||
|
||||
my_elts = list(elements)
|
||||
if len(my_elts) > 1:
|
||||
my_elts[-1] = f'{fmt.connective} {my_elts[-1]}'
|
||||
|
||||
if not comma_for_two_elts and len(my_elts) <= 2:
|
||||
prose = ' '.join(my_elts)
|
||||
else:
|
||||
prose = ', '.join(my_elts)
|
||||
|
||||
quantifier = fmt.quantifier(len(my_elts))
|
||||
|
||||
parts = [quantifier, prose]
|
||||
|
||||
if with_verb:
|
||||
if len(my_elts) > 1:
|
||||
parts.append(' are')
|
||||
else:
|
||||
parts.append(' is')
|
||||
return ''.join(parts)
|
||||
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def file_suffix(self):
|
||||
"""Return suffix of generated Asciidoctor files"""
|
||||
raise NotImplementedError
|
||||
|
||||
@abc.abstractmethod
|
||||
def api_name(self, spectype=None):
|
||||
"""Return API or specification name for citations in ref pages.
|
||||
|
||||
spectype is the spec this refpage is for.
|
||||
'api' (the default value) is the main API Specification.
|
||||
If an unrecognized spectype is given, returns None.
|
||||
|
||||
Must implement."""
|
||||
raise NotImplementedError
|
||||
|
||||
def should_insert_may_alias_macro(self, genOpts):
|
||||
"""Return true if we should insert a "may alias" macro in this file.
|
||||
|
||||
Only used by OpenXR right now."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def command_prefix(self):
|
||||
"""Return the expected prefix of commands/functions.
|
||||
|
||||
Implemented in terms of api_prefix."""
|
||||
if not self._command_prefix:
|
||||
self._command_prefix = self.api_prefix[:].replace('_', '').lower()
|
||||
return self._command_prefix
|
||||
|
||||
@property
|
||||
def type_prefix(self):
|
||||
"""Return the expected prefix of type names.
|
||||
|
||||
Implemented in terms of command_prefix (and in turn, api_prefix)."""
|
||||
if not self._type_prefix:
|
||||
self._type_prefix = ''.join(
|
||||
(self.command_prefix[0:1].upper(), self.command_prefix[1:]))
|
||||
return self._type_prefix
|
||||
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def api_prefix(self):
|
||||
"""Return API token prefix.
|
||||
|
||||
Typically two uppercase letters followed by an underscore.
|
||||
|
||||
Must implement."""
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def extension_name_prefix(self):
|
||||
"""Return extension name prefix.
|
||||
|
||||
Typically two uppercase letters followed by an underscore.
|
||||
|
||||
Assumed to be the same as api_prefix, but some APIs use different
|
||||
case conventions."""
|
||||
|
||||
return self.api_prefix
|
||||
|
||||
def extension_short_description(self, elem):
|
||||
"""Return a short description of an extension for use in refpages.
|
||||
|
||||
elem is an ElementTree for the <extension> tag in the XML.
|
||||
The default behavior is to use the 'type' field of this tag, but not
|
||||
all APIs support this field."""
|
||||
|
||||
ext_type = elem.get('type')
|
||||
|
||||
if ext_type is not None:
|
||||
return f'{ext_type} extension'
|
||||
else:
|
||||
return ''
|
||||
|
||||
@property
|
||||
def write_contacts(self):
|
||||
"""Return whether contact list should be written to extension appendices"""
|
||||
return False
|
||||
|
||||
@property
|
||||
def write_extension_type(self):
|
||||
"""Return whether extension type should be written to extension appendices"""
|
||||
return True
|
||||
|
||||
@property
|
||||
def write_extension_number(self):
|
||||
"""Return whether extension number should be written to extension appendices"""
|
||||
return True
|
||||
|
||||
@property
|
||||
def write_extension_revision(self):
|
||||
"""Return whether extension revision number should be written to extension appendices"""
|
||||
return True
|
||||
|
||||
@property
|
||||
def write_refpage_include(self):
|
||||
"""Return whether refpage include should be written to extension appendices"""
|
||||
return True
|
||||
|
||||
@property
|
||||
def api_version_prefix(self):
|
||||
"""Return API core version token prefix.
|
||||
|
||||
Implemented in terms of api_prefix.
|
||||
|
||||
May override."""
|
||||
return f"{self.api_prefix}VERSION_"
|
||||
|
||||
@property
|
||||
def KHR_prefix(self):
|
||||
"""Return extension name prefix for KHR extensions.
|
||||
|
||||
Implemented in terms of api_prefix.
|
||||
|
||||
May override."""
|
||||
return f"{self.api_prefix}KHR_"
|
||||
|
||||
@property
|
||||
def EXT_prefix(self):
|
||||
"""Return extension name prefix for EXT extensions.
|
||||
|
||||
Implemented in terms of api_prefix.
|
||||
|
||||
May override."""
|
||||
return f"{self.api_prefix}EXT_"
|
||||
|
||||
def writeFeature(self, featureName, featureExtraProtect, filename):
|
||||
"""Return True if OutputGenerator.endFeature should write this feature.
|
||||
|
||||
Defaults to always True.
|
||||
Used in COutputGenerator.
|
||||
|
||||
May override."""
|
||||
return True
|
||||
|
||||
def requires_error_validation(self, return_type):
|
||||
"""Return True if the return_type element is an API result code
|
||||
requiring error validation.
|
||||
|
||||
Defaults to always False.
|
||||
|
||||
May override."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def required_errors(self):
|
||||
"""Return a list of required error codes for validation.
|
||||
|
||||
Defaults to an empty list.
|
||||
|
||||
May override."""
|
||||
return []
|
||||
|
||||
def is_voidpointer_alias(self, tag, text, tail):
|
||||
"""Return True if the declaration components (tag,text,tail) of an
|
||||
element represents a void * type.
|
||||
|
||||
Defaults to a reasonable implementation.
|
||||
|
||||
May override."""
|
||||
return tag == 'type' and text == 'void' and tail.startswith('*')
|
||||
|
||||
def make_voidpointer_alias(self, tail):
|
||||
"""Reformat a void * declaration to include the API alias macro.
|
||||
|
||||
Defaults to a no-op.
|
||||
|
||||
Must override if you actually want to use this feature in your project."""
|
||||
return tail
|
||||
|
||||
def category_requires_validation(self, category):
|
||||
"""Return True if the given type 'category' always requires validation.
|
||||
|
||||
Defaults to a reasonable implementation.
|
||||
|
||||
May override."""
|
||||
return category in CATEGORIES_REQUIRING_VALIDATION
|
||||
|
||||
def type_always_valid(self, typename):
|
||||
"""Return True if the given type name is always valid (never requires validation).
|
||||
|
||||
This is for things like integers.
|
||||
|
||||
Defaults to a reasonable implementation.
|
||||
|
||||
May override."""
|
||||
return typename in TYPES_KNOWN_ALWAYS_VALID
|
||||
|
||||
@property
|
||||
def should_skip_checking_codes(self):
|
||||
"""Return True if more than the basic validation of return codes should
|
||||
be skipped for a command."""
|
||||
|
||||
return False
|
||||
|
||||
@property
|
||||
def generate_index_terms(self):
|
||||
"""Return True if asiidoctor index terms should be generated as part
|
||||
of an API interface from the docgenerator."""
|
||||
|
||||
return False
|
||||
|
||||
@property
|
||||
def generate_enum_table(self):
|
||||
"""Return True if asciidoctor tables describing enumerants in a
|
||||
group should be generated as part of group generation."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def generate_max_enum_in_docs(self):
|
||||
"""Return True if MAX_ENUM tokens should be generated in
|
||||
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
|
||||
containing all such appendices.
|
||||
- name - extension name
|
||||
|
||||
Must implement."""
|
||||
raise NotImplementedError
|
||||
|
||||
def extension_include_string(self, name):
|
||||
"""Return format string for include:: line for an extension appendix
|
||||
file.
|
||||
- name - extension name"""
|
||||
|
||||
return f'include::{{appendices}}/{self.extension_file_path(name)}[]'
|
||||
|
||||
@property
|
||||
def provisional_extension_warning(self):
|
||||
"""Return True if a warning should be included in extension
|
||||
appendices for provisional extensions."""
|
||||
return True
|
||||
|
||||
@property
|
||||
def generated_include_path(self):
|
||||
"""Return path relative to the generated reference pages, to the
|
||||
generated API include files."""
|
||||
|
||||
return '{generated}'
|
||||
|
||||
@property
|
||||
def include_extension_appendix_in_refpage(self):
|
||||
"""Return True if generating extension refpages by embedding
|
||||
extension appendix content (default), False otherwise
|
||||
(OpenXR)."""
|
||||
|
||||
return True
|
||||
|
||||
def valid_flag_bit(self, bitpos):
|
||||
"""Return True if bitpos is an allowed numeric bit position for
|
||||
an API flag.
|
||||
|
||||
Behavior depends on the data type used for flags (which may be 32
|
||||
or 64 bits), and may depend on assumptions about compiler
|
||||
handling of sign bits in enumerated types, as well."""
|
||||
return True
|
||||
|
||||
@property
|
||||
def duplicate_aliased_structs(self):
|
||||
"""
|
||||
Should aliased structs have the original struct definition listed in the
|
||||
generated docs snippet?
|
||||
"""
|
||||
return False
|
||||
|
||||
@property
|
||||
def protectProtoComment(self):
|
||||
"""Return True if generated #endif should have a comment matching
|
||||
the protection symbol used in the opening #ifdef/#ifndef."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def extra_refpage_headers(self):
|
||||
"""Return any extra headers (preceding the title) for generated
|
||||
reference pages."""
|
||||
return ''
|
||||
|
||||
@property
|
||||
def extra_refpage_body(self):
|
||||
"""Return any extra text (following the title) for generated
|
||||
reference pages."""
|
||||
return ''
|
||||
|
||||
def is_api_version_name(self, name):
|
||||
"""Return True if name is an API version name."""
|
||||
|
||||
return API_VERSION_NAME_RE.match(name) is not None
|
||||
|
||||
@property
|
||||
def docgen_language(self):
|
||||
"""Return the language to be used in docgenerator [source]
|
||||
blocks."""
|
||||
|
||||
return 'c++'
|
||||
|
||||
@property
|
||||
def docgen_source_options(self):
|
||||
"""Return block options to be used in docgenerator [source] blocks,
|
||||
which are appended to the 'source' block type.
|
||||
Can be empty."""
|
||||
|
||||
return '%unbreakable'
|
58
registry/spec_tools/util.py
Normal file
58
registry/spec_tools/util.py
Normal file
|
@ -0,0 +1,58 @@
|
|||
"""Utility functions not closely tied to other spec_tools types."""
|
||||
# Copyright (c) 2018-2019 Collabora, Ltd.
|
||||
# Copyright 2013-2025 The Khronos Group Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
|
||||
def getElemName(elem, default=None):
|
||||
"""Get the name associated with an element, either a name child or name attribute."""
|
||||
name_elem = elem.find('name')
|
||||
if name_elem is not None:
|
||||
return name_elem.text
|
||||
# Fallback if there is no child.
|
||||
return elem.get('name', default)
|
||||
|
||||
|
||||
def getElemType(elem, default=None):
|
||||
"""Get the type associated with an element, either a type child or type attribute."""
|
||||
type_elem = elem.find('type')
|
||||
if type_elem is not None:
|
||||
return type_elem.text
|
||||
# Fallback if there is no child.
|
||||
return elem.get('type', default)
|
||||
|
||||
|
||||
def findFirstWithPredicate(collection, pred):
|
||||
"""Return the first element that satisfies the predicate, or None if none exist.
|
||||
|
||||
NOTE: Some places where this is used might be better served by changing to a dictionary.
|
||||
"""
|
||||
for elt in collection:
|
||||
if pred(elt):
|
||||
return elt
|
||||
return None
|
||||
|
||||
|
||||
def findNamedElem(elems, name):
|
||||
"""Traverse a collection of elements with 'name' nodes or attributes, looking for and returning one with the right name.
|
||||
|
||||
NOTE: Many places where this is used might be better served by changing to a dictionary.
|
||||
"""
|
||||
return findFirstWithPredicate(elems, lambda elem: getElemName(elem) == name)
|
||||
|
||||
|
||||
def findTypedElem(elems, typename):
|
||||
"""Traverse a collection of elements with 'type' nodes or attributes, looking for and returning one with the right typename.
|
||||
|
||||
NOTE: Many places where this is used might be better served by changing to a dictionary.
|
||||
"""
|
||||
return findFirstWithPredicate(elems, lambda elem: getElemType(elem) == typename)
|
||||
|
||||
|
||||
def findNamedObject(collection, name):
|
||||
"""Traverse a collection of elements with 'name' attributes, looking for and returning one with the right name.
|
||||
|
||||
NOTE: Many places where this is used might be better served by changing to a dictionary.
|
||||
"""
|
||||
return findFirstWithPredicate(collection, lambda elt: elt.name == name)
|
42
registry/stripAPI.py
Executable file
42
registry/stripAPI.py
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright 2023-2025 The Khronos Group Inc.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import argparse
|
||||
import xml.etree.ElementTree as etree
|
||||
from reg import stripNonmatchingAPIs
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(prog='stripAPI',
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
description='''\
|
||||
Filters out elements with non-matching explicit 'api' attributes from API XML.
|
||||
To remove Vulkan SC-only elements from the combined API XML:
|
||||
python3 scripts/stripAPI.py -input xml/vk.xml -output vulkan-only.xml -keepAPI vulkan
|
||||
To remove Vulkan-only elements:
|
||||
python3 scripts/stripAPI.py -input xml/vk.xml -output vulkansc-only.xml -keepAPI vulkansc
|
||||
If you are parsing the XML yourself but using the xml.etree package, the
|
||||
equivalent runtime code is:
|
||||
import reg
|
||||
reg.stripNonmatchingAPIs(tree.getroot(), keepAPI, actuallyDelete=True)
|
||||
where 'tree' is an ElementTree created from the XML file using
|
||||
etree.parse(filename)''')
|
||||
|
||||
parser.add_argument('-input', action='store',
|
||||
required=True,
|
||||
help='Specify input registry XML')
|
||||
parser.add_argument('-output', action='store',
|
||||
required=True,
|
||||
help='Specify output registry XML')
|
||||
parser.add_argument('-keepAPI', action='store',
|
||||
default=None,
|
||||
help='Specify API name whose \'api\' tags are kept')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
tree = etree.parse(args.input)
|
||||
if args.keepAPI is not None:
|
||||
stripNonmatchingAPIs(tree.getroot(), args.keepAPI, actuallyDelete = True)
|
||||
tree.write(args.output)
|
||||
|
108331
registry/validusage.json
108331
registry/validusage.json
File diff suppressed because one or more lines are too long
1830
registry/video.xml
Normal file
1830
registry/video.xml
Normal file
File diff suppressed because it is too large
Load diff
24490
registry/vk.xml
Normal file → Executable file
24490
registry/vk.xml
Normal file → Executable file
File diff suppressed because it is too large
Load diff
312
registry/vkconventions.py
Executable file
312
registry/vkconventions.py
Executable file
|
@ -0,0 +1,312 @@
|
|||
#!/usr/bin/env python3 -i
|
||||
#
|
||||
# Copyright 2013-2025 The Khronos Group Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Working-group-specific style conventions,
|
||||
# used in generation.
|
||||
|
||||
import re
|
||||
import os
|
||||
|
||||
from spec_tools.conventions import ConventionsBase
|
||||
|
||||
# Modified from default implementation - see category_requires_validation() below
|
||||
CATEGORIES_REQUIRING_VALIDATION = set(('handle', 'enum', 'bitmask'))
|
||||
|
||||
# Tokenize into "words" for structure types, approximately per spec "Implicit Valid Usage" section 2.7.2
|
||||
# This first set is for things we recognize explicitly as words,
|
||||
# as exceptions to the general regex.
|
||||
# Ideally these would be listed in the spec as exceptions, as OpenXR does.
|
||||
SPECIAL_WORDS = set((
|
||||
'16Bit', # VkPhysicalDevice16BitStorageFeatures
|
||||
'2D', # VkPhysicalDeviceImage2DViewOf3DFeaturesEXT
|
||||
'3D', # VkPhysicalDeviceImage2DViewOf3DFeaturesEXT
|
||||
'8Bit', # VkPhysicalDevice8BitStorageFeaturesKHR
|
||||
'AABB', # VkGeometryAABBNV
|
||||
'ASTC', # VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT
|
||||
'D3D12', # VkD3D12FenceSubmitInfoKHR
|
||||
'Float16', # VkPhysicalDeviceShaderFloat16Int8FeaturesKHR
|
||||
'Bfloat16', # VkPhysicalDeviceShaderBfloat16FeaturesKHR
|
||||
'ImagePipe', # VkImagePipeSurfaceCreateInfoFUCHSIA
|
||||
'Int64', # VkPhysicalDeviceShaderAtomicInt64FeaturesKHR
|
||||
'Int8', # VkPhysicalDeviceShaderFloat16Int8FeaturesKHR
|
||||
'MacOS', # VkMacOSSurfaceCreateInfoMVK
|
||||
'RGBA10X6', # VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT
|
||||
'Uint8', # VkPhysicalDeviceIndexTypeUint8FeaturesEXT
|
||||
'Win32', # VkWin32SurfaceCreateInfoKHR
|
||||
))
|
||||
# A regex to match any of the SPECIAL_WORDS
|
||||
EXCEPTION_PATTERN = r'(?P<exception>{})'.format(
|
||||
'|'.join(f'({re.escape(w)})' for w in SPECIAL_WORDS))
|
||||
MAIN_RE = re.compile(
|
||||
# the negative lookahead is to prevent the all-caps pattern from being too greedy.
|
||||
r'({}|([0-9]+)|([A-Z][a-z]+)|([A-Z][A-Z]*(?![a-z])))'.format(EXCEPTION_PATTERN))
|
||||
|
||||
|
||||
class VulkanConventions(ConventionsBase):
|
||||
@property
|
||||
def null(self):
|
||||
"""Preferred spelling of NULL."""
|
||||
return '`NULL`'
|
||||
|
||||
def formatVersion(self, name, apivariant, major, minor):
|
||||
"""Mark up an API version name as a link in the spec."""
|
||||
version = f'{major}.{minor}'
|
||||
if apivariant == 'VKSC':
|
||||
# Vulkan SC has a different anchor pattern for version appendices
|
||||
if version == '1.0':
|
||||
return 'Vulkan SC 1.0'
|
||||
else:
|
||||
return f'<<versions-sc-{version}, Vulkan SC Version {version}>>'
|
||||
else:
|
||||
return f'<<versions-{version}, Vulkan Version {version}>>'
|
||||
|
||||
def formatExtension(self, name):
|
||||
"""Mark up an extension name as a link in the spec."""
|
||||
return f'apiext:{name}'
|
||||
|
||||
@property
|
||||
def struct_macro(self):
|
||||
"""Get the appropriate format macro for a structure.
|
||||
|
||||
Primarily affects generated valid usage statements.
|
||||
"""
|
||||
|
||||
return 'slink:'
|
||||
|
||||
@property
|
||||
def constFlagBits(self):
|
||||
"""Returns True if static const flag bits should be generated, False if an enumerated type should be generated."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def structtype_member_name(self):
|
||||
"""Return name of the structure type member"""
|
||||
return 'sType'
|
||||
|
||||
@property
|
||||
def nextpointer_member_name(self):
|
||||
"""Return name of the structure pointer chain member"""
|
||||
return 'pNext'
|
||||
|
||||
@property
|
||||
def valid_pointer_prefix(self):
|
||||
"""Return prefix to pointers which must themselves be valid"""
|
||||
return 'valid'
|
||||
|
||||
def is_structure_type_member(self, paramtype, paramname):
|
||||
"""Determine if member type and name match the structure type member."""
|
||||
return paramtype == 'VkStructureType' and paramname == self.structtype_member_name
|
||||
|
||||
def is_nextpointer_member(self, paramtype, paramname):
|
||||
"""Determine if member type and name match the next pointer chain member."""
|
||||
return paramtype == 'void' and paramname == self.nextpointer_member_name
|
||||
|
||||
def generate_structure_type_from_name(self, structname):
|
||||
"""Generate a structure type name, like VK_STRUCTURE_TYPE_CREATE_INSTANCE_INFO"""
|
||||
|
||||
structure_type_parts = []
|
||||
# Tokenize into "words"
|
||||
for elem in MAIN_RE.findall(structname):
|
||||
word = elem[0]
|
||||
if word == 'Vk':
|
||||
structure_type_parts.append('VK_STRUCTURE_TYPE')
|
||||
else:
|
||||
structure_type_parts.append(word.upper())
|
||||
name = '_'.join(structure_type_parts)
|
||||
|
||||
# The simple-minded rules need modification for some structure names
|
||||
subpats = [
|
||||
[ r'_H_(26[45])_', r'_H\1_' ],
|
||||
[ r'_AV_1_', r'_AV1_' ],
|
||||
[ r'_VULKAN_([0-9])([0-9])_', r'_VULKAN_\1_\2_' ],
|
||||
[ r'_VULKAN_SC_([0-9])([0-9])_',r'_VULKAN_SC_\1_\2_' ],
|
||||
[ r'_DIRECT_FB_', r'_DIRECTFB_' ],
|
||||
[ r'_VULKAN_SC_10', r'_VULKAN_SC_1_0' ],
|
||||
|
||||
]
|
||||
|
||||
for subpat in subpats:
|
||||
name = re.sub(subpat[0], subpat[1], name)
|
||||
return name
|
||||
|
||||
@property
|
||||
def warning_comment(self):
|
||||
"""Return warning comment to be placed in header of generated Asciidoctor files"""
|
||||
return '// WARNING: DO NOT MODIFY! This file is automatically generated from the vk.xml registry'
|
||||
|
||||
@property
|
||||
def file_suffix(self):
|
||||
"""Return suffix of generated Asciidoctor files"""
|
||||
return '.adoc'
|
||||
|
||||
def api_name(self, spectype='api'):
|
||||
"""Return API or specification name for citations in ref pages.ref
|
||||
pages should link to for
|
||||
|
||||
spectype is the spec this refpage is for: 'api' is the Vulkan API
|
||||
Specification. Defaults to 'api'. If an unrecognized spectype is
|
||||
given, returns None.
|
||||
"""
|
||||
if spectype == 'api' or spectype is None:
|
||||
return 'Vulkan'
|
||||
else:
|
||||
return None
|
||||
|
||||
@property
|
||||
def api_prefix(self):
|
||||
"""Return API token prefix"""
|
||||
return 'VK_'
|
||||
|
||||
@property
|
||||
def write_contacts(self):
|
||||
"""Return whether contact list 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 member_used_for_unique_vuid(self):
|
||||
"""Return the member name used in the VUID-...-...-unique ID."""
|
||||
return self.structtype_member_name
|
||||
|
||||
def is_externsync_command(self, protoname):
|
||||
"""Returns True if the protoname element is an API command requiring
|
||||
external synchronization
|
||||
"""
|
||||
return protoname is not None and 'vkCmd' in protoname
|
||||
|
||||
def is_api_name(self, name):
|
||||
"""Returns True if name is in the reserved API namespace.
|
||||
For Vulkan, these are names with a case-insensitive 'vk' prefix, or
|
||||
a 'PFN_vk' function pointer type prefix.
|
||||
"""
|
||||
return name[0:2].lower() == 'vk' or name.startswith('PFN_vk')
|
||||
|
||||
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/vulkan/specs/latest/html/vkspec.html'
|
||||
|
||||
@property
|
||||
def xml_api_name(self):
|
||||
"""Return the name used in the default API XML registry for the default API"""
|
||||
return 'vulkan'
|
||||
|
||||
@property
|
||||
def registry_path(self):
|
||||
"""Return relpath to the default API XML registry in this project."""
|
||||
return 'xml/vk.xml'
|
||||
|
||||
@property
|
||||
def specification_path(self):
|
||||
"""Return relpath to the Asciidoctor specification sources in this project."""
|
||||
return '{generated}/meta'
|
||||
|
||||
@property
|
||||
def special_use_section_anchor(self):
|
||||
"""Return asciidoctor anchor name in the API Specification of the
|
||||
section describing extension special uses in detail."""
|
||||
return 'extendingvulkan-compatibility-specialuse'
|
||||
|
||||
@property
|
||||
def extension_index_prefixes(self):
|
||||
"""Return a list of extension prefixes used to group extension refpages."""
|
||||
return ['VK_KHR', 'VK_EXT', 'VK']
|
||||
|
||||
@property
|
||||
def unified_flag_refpages(self):
|
||||
"""Return True if Flags/FlagBits refpages are unified, False if
|
||||
they are separate.
|
||||
"""
|
||||
return False
|
||||
|
||||
@property
|
||||
def spec_reflow_path(self):
|
||||
"""Return the path to the spec source folder to reflow"""
|
||||
return os.getcwd()
|
||||
|
||||
@property
|
||||
def spec_no_reflow_dirs(self):
|
||||
"""Return a set of directories not to automatically descend into
|
||||
when reflowing spec text
|
||||
"""
|
||||
return ('scripts', 'style')
|
||||
|
||||
@property
|
||||
def zero(self):
|
||||
return '`0`'
|
||||
|
||||
def category_requires_validation(self, category):
|
||||
"""Return True if the given type 'category' always requires validation.
|
||||
|
||||
Overridden because Vulkan does not require "valid" text for basetype
|
||||
in the spec right now."""
|
||||
return category in CATEGORIES_REQUIRING_VALIDATION
|
||||
|
||||
@property
|
||||
def should_skip_checking_codes(self):
|
||||
"""Return True if more than the basic validation of return codes should
|
||||
be skipped for a command.
|
||||
|
||||
Vulkan mostly relies on the validation layers rather than API
|
||||
builtin error checking, so these checks are not appropriate.
|
||||
|
||||
For example, passing in a VkFormat parameter will not potentially
|
||||
generate a VK_ERROR_FORMAT_NOT_SUPPORTED code."""
|
||||
|
||||
return True
|
||||
|
||||
def extension_file_path(self, name):
|
||||
"""Return file path to an extension appendix relative to a directory
|
||||
containing all such appendices.
|
||||
- name - extension name"""
|
||||
|
||||
return f'{name}{self.file_suffix}'
|
||||
|
||||
def valid_flag_bit(self, bitpos):
|
||||
"""Return True if bitpos is an allowed numeric bit position for
|
||||
an API flag bit.
|
||||
|
||||
Vulkan uses 32 bit Vk*Flags types, and assumes C compilers may
|
||||
cause Vk*FlagBits values with bit 31 set to result in a 64 bit
|
||||
enumerated type, so disallows such flags."""
|
||||
return bitpos >= 0 and bitpos < 31
|
||||
|
||||
@property
|
||||
def extra_refpage_headers(self):
|
||||
"""Return any extra text to add to refpage headers."""
|
||||
return 'include::{config}/attribs.adoc[]'
|
||||
|
||||
@property
|
||||
def extra_refpage_body(self):
|
||||
"""Return any extra text (following the title) for generated
|
||||
reference pages."""
|
||||
return 'include::{generated}/specattribs.adoc[]'
|
||||
|
||||
|
||||
class VulkanSCConventions(VulkanConventions):
|
||||
|
||||
def specURL(self, spectype='api'):
|
||||
"""Return public registry URL which ref pages should link to for the
|
||||
current all-extensions HTML specification, so xrefs in the
|
||||
asciidoc source that are not to ref pages can link into it
|
||||
instead. N.b. this may need to change on a per-refpage basis if
|
||||
there are multiple documents involved.
|
||||
"""
|
||||
return 'https://registry.khronos.org/vulkansc/specs/1.0-extensions/html/vkspec.html'
|
||||
|
||||
@property
|
||||
def xml_api_name(self):
|
||||
"""Return the name used in the default API XML registry for the default API"""
|
||||
return 'vulkansc'
|
||||
|
438
registry/vulkan_object.py
Normal file
438
registry/vulkan_object.py
Normal file
|
@ -0,0 +1,438 @@
|
|||
#!/usr/bin/env python3 -i
|
||||
#
|
||||
# Copyright 2023-2025 The Khronos Group Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from enum import IntFlag, Enum, auto
|
||||
|
||||
@dataclass
|
||||
class Extension:
|
||||
"""<extension>"""
|
||||
name: str # ex) VK_KHR_SURFACE
|
||||
nameString: str # marco with string, ex) VK_KHR_SURFACE_EXTENSION_NAME
|
||||
specVersion: str # marco with string, ex) VK_KHR_SURFACE_SPEC_VERSION
|
||||
|
||||
# Only one will be True, the other is False
|
||||
instance: bool
|
||||
device: bool
|
||||
|
||||
depends: (str | None)
|
||||
vendorTag: (str | None) # ex) EXT, KHR, etc
|
||||
platform: (str | None) # ex) android
|
||||
protect: (str | None) # ex) VK_USE_PLATFORM_ANDROID_KHR
|
||||
provisional: bool
|
||||
promotedTo: (str | None) # ex) VK_VERSION_1_1
|
||||
deprecatedBy: (str | None)
|
||||
obsoletedBy: (str | None)
|
||||
specialUse: list[str]
|
||||
|
||||
# These are here to allow for easy reverse lookups
|
||||
# Quotes allow us to forward declare the dataclass
|
||||
commands: list['Command'] = field(default_factory=list, init=False)
|
||||
enums: list['Enum'] = field(default_factory=list, init=False)
|
||||
bitmasks: list['Bitmask'] = field(default_factory=list, init=False)
|
||||
# Use the Enum name to see what fields are extended
|
||||
enumFields: dict[str, list['EnumField']] = field(default_factory=dict, init=False)
|
||||
# Use the Bitmaks name to see what flags are extended
|
||||
flags: dict[str, list['Flag']] = field(default_factory=dict, init=False)
|
||||
|
||||
@dataclass
|
||||
class Version:
|
||||
"""
|
||||
<feature> which represents a version
|
||||
This will NEVER be Version 1.0, since having 'no version' is same as being 1.0
|
||||
"""
|
||||
name: str # ex) VK_VERSION_1_1
|
||||
nameString: str # ex) "VK_VERSION_1_1" (no marco, so has quotes)
|
||||
nameApi: str # ex) VK_API_VERSION_1_1
|
||||
|
||||
@dataclass
|
||||
class Handle:
|
||||
"""<type> which represents a dispatch handle"""
|
||||
name: str # ex) VkBuffer
|
||||
aliases: list[str] # ex) ['VkSamplerYcbcrConversionKHR']
|
||||
|
||||
type: str # ex) VK_OBJECT_TYPE_BUFFER
|
||||
protect: (str | None) # ex) VK_USE_PLATFORM_ANDROID_KHR
|
||||
|
||||
parent: 'Handle' # Chain of parent handles, can be None
|
||||
|
||||
# Only one will be True, the other is False
|
||||
instance: bool
|
||||
device: bool
|
||||
|
||||
dispatchable: bool
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.name < other.name
|
||||
|
||||
@dataclass
|
||||
class Param:
|
||||
"""<command/param>"""
|
||||
name: str # ex) pCreateInfo, pAllocator, pBuffer
|
||||
alias: str
|
||||
|
||||
# the "base type" - will not preserve the 'const' or pointer info
|
||||
# ex) void, uint32_t, VkFormat, VkBuffer, etc
|
||||
type: str
|
||||
# the "full type" - will be cDeclaration without the type name
|
||||
# ex) const void*, uint32_t, const VkFormat, VkBuffer*, etc
|
||||
# For arrays, this will only display the type, fixedSizeArray can be used to get the length
|
||||
fullType: str
|
||||
|
||||
noAutoValidity: bool
|
||||
|
||||
const: bool # type contains 'const'
|
||||
length: (str | None) # the known length of pointer, will never be 'null-terminated'
|
||||
nullTerminated: bool # If a UTF-8 string, it will be null-terminated
|
||||
pointer: bool # type contains a pointer (include 'PFN' function pointers)
|
||||
# Used to list how large an array of the type is
|
||||
# ex) lineWidthRange is ['2']
|
||||
# ex) memoryTypes is ['VK_MAX_MEMORY_TYPES']
|
||||
# ex) VkTransformMatrixKHR:matrix is ['3', '4']
|
||||
fixedSizeArray: list[str]
|
||||
|
||||
optional: bool
|
||||
optionalPointer: bool # if type contains a pointer, is the pointer value optional
|
||||
|
||||
externSync: bool
|
||||
externSyncPointer: list[str] # if type contains a pointer, might only specific members modified
|
||||
|
||||
# C string of member, example:
|
||||
# - const void* pNext
|
||||
# - VkFormat format
|
||||
# - VkStructureType sType
|
||||
cDeclaration: str
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.name < other.name
|
||||
|
||||
class Queues(IntFlag):
|
||||
TRANSFER = auto() # VK_QUEUE_TRANSFER_BIT
|
||||
GRAPHICS = auto() # VK_QUEUE_GRAPHICS_BIT
|
||||
COMPUTE = auto() # VK_QUEUE_COMPUTE_BIT
|
||||
PROTECTED = auto() # VK_QUEUE_PROTECTED_BIT
|
||||
SPARSE_BINDING = auto() # VK_QUEUE_SPARSE_BINDING_BIT
|
||||
OPTICAL_FLOW = auto() # VK_QUEUE_OPTICAL_FLOW_BIT_NV
|
||||
DECODE = auto() # VK_QUEUE_VIDEO_DECODE_BIT_KHR
|
||||
ENCODE = auto() # VK_QUEUE_VIDEO_ENCODE_BIT_KHR
|
||||
ALL = TRANSFER | GRAPHICS | COMPUTE | PROTECTED | SPARSE_BINDING | OPTICAL_FLOW | DECODE | ENCODE
|
||||
|
||||
class CommandScope(Enum):
|
||||
NONE = auto()
|
||||
INSIDE = auto()
|
||||
OUTSIDE = auto()
|
||||
BOTH = auto()
|
||||
|
||||
@dataclass
|
||||
class Command:
|
||||
"""<command>"""
|
||||
name: str # ex) vkCmdDraw
|
||||
alias: (str | None) # Because commands are interfaces into layers/drivers, we need all command alias
|
||||
protect: (str | None) # ex) 'VK_ENABLE_BETA_EXTENSIONS'
|
||||
|
||||
extensions: list[Extension] # All extensions that enable the struct
|
||||
version: (Version | None) # None if Version 1.0
|
||||
|
||||
returnType: str # ex) void, VkResult, etc
|
||||
|
||||
params: list[Param] # Each parameter of the command
|
||||
|
||||
# Only one will be True, the other is False
|
||||
instance: bool
|
||||
device: bool
|
||||
|
||||
tasks: list[str] # ex) [ action, state, synchronization ]
|
||||
queues: Queues # zero == No Queues found
|
||||
successCodes: list[str] # ex) [ VK_SUCCESS, VK_INCOMPLETE ]
|
||||
errorCodes: list[str] # ex) [ VK_ERROR_OUT_OF_HOST_MEMORY ]
|
||||
|
||||
# Shows support if command can be in a primary and/or secondary command buffer
|
||||
primary: bool
|
||||
secondary: bool
|
||||
|
||||
renderPass: CommandScope
|
||||
videoCoding: CommandScope
|
||||
|
||||
implicitExternSyncParams: list[str]
|
||||
|
||||
# C prototype string - ex:
|
||||
# VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(
|
||||
# const VkInstanceCreateInfo* pCreateInfo,
|
||||
# const VkAllocationCallbacks* pAllocator,
|
||||
# VkInstance* pInstance);
|
||||
cPrototype: str
|
||||
|
||||
# function pointer typedef - ex:
|
||||
# typedef VkResult (VKAPI_PTR *PFN_vkCreateInstance)
|
||||
# (const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance);
|
||||
cFunctionPointer: str
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.name < other.name
|
||||
|
||||
@dataclass
|
||||
class Member:
|
||||
"""<member>"""
|
||||
name: str # ex) sType, pNext, flags, size, usage
|
||||
|
||||
# the "base type" - will not preserve the 'const' or pointer info
|
||||
# ex) void, uint32_t, VkFormat, VkBuffer, etc
|
||||
type: str
|
||||
# the "full type" - will be cDeclaration without the type name
|
||||
# ex) const void*, uint32_t, const VkFormat, VkBuffer*, etc
|
||||
# For arrays, this will only display the type, fixedSizeArray can be used to get the length
|
||||
fullType: str
|
||||
|
||||
noAutoValidity: bool
|
||||
limitType: (str | None) # ex) 'max', 'bitmask', 'bits', 'min,mul'
|
||||
|
||||
const: bool # type contains 'const'
|
||||
length: (str | None) # the known length of pointer, will never be 'null-terminated'
|
||||
nullTerminated: bool # If a UTF-8 string, it will be null-terminated
|
||||
pointer: bool # type contains a pointer (include 'PFN' function pointers)
|
||||
# Used to list how large an array of the type is
|
||||
# ex) lineWidthRange is ['2']
|
||||
# ex) memoryTypes is ['VK_MAX_MEMORY_TYPES']
|
||||
# ex) VkTransformMatrixKHR:matrix is ['3', '4']
|
||||
fixedSizeArray: list[str]
|
||||
|
||||
optional: bool
|
||||
optionalPointer: bool # if type contains a pointer, is the pointer value optional
|
||||
|
||||
externSync: bool
|
||||
|
||||
# C string of member, example:
|
||||
# - const void* pNext
|
||||
# - VkFormat format
|
||||
# - VkStructureType sType
|
||||
cDeclaration: str
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.name < other.name
|
||||
|
||||
@dataclass
|
||||
class Struct:
|
||||
"""<type category="struct"> or <type category="union">"""
|
||||
name: str # ex) VkImageSubresource2
|
||||
aliases: list[str] # ex) ['VkImageSubresource2KHR', 'VkImageSubresource2EXT']
|
||||
|
||||
extensions: list[Extension] # All extensions that enable the struct
|
||||
version: (Version | None) # None if Version 1.0
|
||||
protect: (str | None) # ex) VK_ENABLE_BETA_EXTENSIONS
|
||||
|
||||
members: list[Member]
|
||||
|
||||
union: bool # Unions are just a subset of a Structs
|
||||
returnedOnly: bool
|
||||
|
||||
sType: (str | None) # ex) VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
|
||||
allowDuplicate: bool # can have a pNext point to itself
|
||||
|
||||
# These use to be list['Struct'] but some circular loops occur and cause
|
||||
# pydevd warnings and made debugging slow (30 seconds to index a Struct)
|
||||
extends: list[str] # Struct names that this struct extends
|
||||
extendedBy: list[str] # Struct names that can be extended by this struct
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.name < other.name
|
||||
|
||||
@dataclass
|
||||
class EnumField:
|
||||
"""<enum> of type enum"""
|
||||
name: str # ex) VK_DYNAMIC_STATE_SCISSOR
|
||||
protect: (str | None) # ex) VK_ENABLE_BETA_EXTENSIONS
|
||||
|
||||
negative: bool # True if negative values are allowed (ex. VkResult)
|
||||
value: int
|
||||
valueStr: str # value as shown in spec (ex. "0", "2", "1000267000", "0x00000004")
|
||||
|
||||
# some fields are enabled from 2 extensions (ex) VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR)
|
||||
extensions: list[Extension] # None if part of 1.0 core
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.name < other.name
|
||||
|
||||
@dataclass
|
||||
class Enum:
|
||||
"""<enums> of type enum"""
|
||||
name: str # ex) VkLineRasterizationMode
|
||||
aliases: list[str] # ex) ['VkLineRasterizationModeKHR', 'VkLineRasterizationModeEXT']
|
||||
|
||||
protect: (str | None) # ex) VK_ENABLE_BETA_EXTENSIONS
|
||||
|
||||
bitWidth: int # 32 or 64 (currently all are 32, but field is to match with Bitmask)
|
||||
returnedOnly: bool
|
||||
|
||||
fields: list[EnumField]
|
||||
|
||||
extensions: list[Extension] # None if part of 1.0 core
|
||||
# Unique list of all extension that are involved in 'fields' (superset of 'extensions')
|
||||
fieldExtensions: list[Extension]
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.name < other.name
|
||||
|
||||
@dataclass
|
||||
class Flag:
|
||||
"""<enum> of type bitmask"""
|
||||
name: str # ex) VK_ACCESS_2_SHADER_READ_BIT
|
||||
protect: (str | None) # ex) VK_ENABLE_BETA_EXTENSIONS
|
||||
|
||||
value: int
|
||||
valueStr: str # value as shown in spec (ex. 0x00000000", "0x00000004", "0x0000000F", "0x800000000ULL")
|
||||
multiBit: bool # if true, more than one bit is set (ex) VK_SHADER_STAGE_ALL_GRAPHICS)
|
||||
zero: bool # if true, the value is zero (ex) VK_PIPELINE_STAGE_NONE)
|
||||
|
||||
# some fields are enabled from 2 extensions (ex) VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT)
|
||||
extensions: list[Extension] # None if part of 1.0 core
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.name < other.name
|
||||
|
||||
@dataclass
|
||||
class Bitmask:
|
||||
"""<enums> of type bitmask"""
|
||||
name: str # ex) VkAccessFlagBits2
|
||||
aliases: list[str] # ex) ['VkAccessFlagBits2KHR']
|
||||
|
||||
flagName: str # ex) VkAccessFlags2
|
||||
protect: (str | None) # ex) VK_ENABLE_BETA_EXTENSIONS
|
||||
|
||||
bitWidth: int # 32 or 64
|
||||
returnedOnly: bool
|
||||
|
||||
flags: list[Flag]
|
||||
|
||||
extensions: list[Extension] # None if part of 1.0 core
|
||||
# Unique list of all extension that are involved in 'flag' (superset of 'extensions')
|
||||
flagExtensions: list[Extension]
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.name < other.name
|
||||
|
||||
@dataclass
|
||||
class FormatComponent:
|
||||
"""<format/component>"""
|
||||
type: str # ex) R, G, B, A, D, S, etc
|
||||
bits: str # will be an INT or 'compressed'
|
||||
numericFormat: str # ex) UNORM, SINT, etc
|
||||
planeIndex: (int | None) # None if no planeIndex in format
|
||||
|
||||
@dataclass
|
||||
class FormatPlane:
|
||||
"""<format/plane>"""
|
||||
index: int
|
||||
widthDivisor: int
|
||||
heightDivisor: int
|
||||
compatible: str
|
||||
|
||||
@dataclass
|
||||
class Format:
|
||||
"""<format>"""
|
||||
name: str
|
||||
className: str
|
||||
blockSize: int
|
||||
texelsPerBlock: int
|
||||
blockExtent: list[str]
|
||||
packed: (int | None) # None == not-packed
|
||||
chroma: (str | None)
|
||||
compressed: (str | None)
|
||||
components: list[FormatComponent] # <format/component>
|
||||
planes: list[FormatPlane] # <format/plane>
|
||||
spirvImageFormat: (str | None)
|
||||
|
||||
@dataclass
|
||||
class SyncSupport:
|
||||
"""<syncsupport>"""
|
||||
queues: Queues
|
||||
stages: list[Flag] # VkPipelineStageFlagBits2
|
||||
max: bool # If this supports max values
|
||||
|
||||
@dataclass
|
||||
class SyncEquivalent:
|
||||
"""<syncequivalent>"""
|
||||
stages: list[Flag] # VkPipelineStageFlagBits2
|
||||
accesses: list[Flag] # VkAccessFlagBits2
|
||||
max: bool # If this equivalent to everything
|
||||
|
||||
@dataclass
|
||||
class SyncStage:
|
||||
"""<syncstage>"""
|
||||
flag: Flag # VkPipelineStageFlagBits2
|
||||
support: SyncSupport
|
||||
equivalent: SyncEquivalent
|
||||
|
||||
@dataclass
|
||||
class SyncAccess:
|
||||
"""<syncaccess>"""
|
||||
flag: Flag # VkAccessFlagBits2
|
||||
support: SyncSupport
|
||||
equivalent: SyncEquivalent
|
||||
|
||||
@dataclass
|
||||
class SyncPipelineStage:
|
||||
"""<syncpipelinestage>"""
|
||||
order: (str | None)
|
||||
before: (str | None)
|
||||
after: (str | None)
|
||||
value: str
|
||||
|
||||
@dataclass
|
||||
class SyncPipeline:
|
||||
"""<syncpipeline>"""
|
||||
name: str
|
||||
depends: list[str]
|
||||
stages: list[SyncPipelineStage]
|
||||
|
||||
@dataclass
|
||||
class SpirvEnables:
|
||||
"""What is needed to enable the SPIR-V element"""
|
||||
version: (str | None)
|
||||
extension: (str | None)
|
||||
struct: (str | None)
|
||||
feature: (str | None)
|
||||
requires: (str | None)
|
||||
property: (str | None)
|
||||
member: (str | None)
|
||||
value: (str | None)
|
||||
|
||||
@dataclass
|
||||
class Spirv:
|
||||
"""<spirvextension> and <spirvcapability>"""
|
||||
name: str
|
||||
# Only one will be True, the other is False
|
||||
extension: bool
|
||||
capability: bool
|
||||
enable: list[SpirvEnables]
|
||||
|
||||
# This is the global Vulkan Object that holds all the information from parsing the XML
|
||||
# This class is designed so all generator scripts can use this to obtain data
|
||||
@dataclass
|
||||
class VulkanObject():
|
||||
headerVersion: int = 0 # value of VK_HEADER_VERSION
|
||||
|
||||
extensions: dict[str, Extension] = field(default_factory=dict, init=False)
|
||||
versions: dict[str, Version] = field(default_factory=dict, init=False)
|
||||
|
||||
handles: dict[str, Handle] = field(default_factory=dict, init=False)
|
||||
commands: dict[str, Command] = field(default_factory=dict, init=False)
|
||||
structs: dict[str, Struct] = field(default_factory=dict, init=False)
|
||||
enums: dict[str, Enum] = field(default_factory=dict, init=False)
|
||||
bitmasks: dict[str, Bitmask] = field(default_factory=dict, init=False)
|
||||
formats: dict[str, Format] = field(default_factory=dict, init=False)
|
||||
|
||||
syncStage: list[SyncStage] = field(default_factory=list, init=False)
|
||||
syncAccess: list[SyncAccess] = field(default_factory=list, init=False)
|
||||
syncPipeline: list[SyncPipeline] = field(default_factory=list, init=False)
|
||||
|
||||
spirv: list[Spirv] = field(default_factory=list, init=False)
|
||||
|
||||
# ex) [ xlib : VK_USE_PLATFORM_XLIB_KHR ]
|
||||
platforms: dict[str, str] = field(default_factory=dict, init=False)
|
||||
# list of all vendor Suffix names (KHR, EXT, etc. )
|
||||
vendorTags: list[str] = field(default_factory=list, init=False)
|
||||
# ex) [ Queues.COMPUTE : VK_QUEUE_COMPUTE_BIT ]
|
||||
queueBits: dict[IntFlag, str] = field(default_factory=dict, init=False)
|
33
tests/CMakeLists.txt
Normal file
33
tests/CMakeLists.txt
Normal file
|
@ -0,0 +1,33 @@
|
|||
# ~~~
|
||||
# Copyright 2022-2023 The Khronos Group Inc.
|
||||
# Copyright 2022-2023 Valve Corporation
|
||||
# Copyright 2022-2023 LunarG, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# ~~~
|
||||
|
||||
# Test add_subdirectory suppport
|
||||
add_test(NAME integration.add_subdirectory
|
||||
COMMAND ${CMAKE_CTEST_COMMAND}
|
||||
--build-and-test ${CMAKE_CURRENT_LIST_DIR}/integration
|
||||
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory
|
||||
--build-generator ${CMAKE_GENERATOR}
|
||||
--build-options -DFIND_PACKAGE_TESTING=OFF -DVULKAN_HEADERS_ENABLE_MODULE=${VULKAN_HEADERS_ENABLE_MODULE}
|
||||
)
|
||||
|
||||
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>
|
||||
)
|
||||
|
||||
# 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}
|
||||
)
|
||||
|
||||
# Installing comes before testing
|
||||
set_tests_properties(integration.find_package PROPERTIES DEPENDS integration.install)
|
91
tests/integration/CMakeLists.txt
Normal file
91
tests/integration/CMakeLists.txt
Normal file
|
@ -0,0 +1,91 @@
|
|||
# ~~~
|
||||
# Copyright 2022-2023 The Khronos Group Inc.
|
||||
# Copyright 2022-2023 Valve Corporation
|
||||
# Copyright 2022-2023 LunarG, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# ~~~
|
||||
cmake_minimum_required(VERSION 3.22.1)
|
||||
|
||||
project(API LANGUAGES C CXX)
|
||||
|
||||
if (FIND_PACKAGE_TESTING)
|
||||
find_package(VulkanHeaders REQUIRED CONFIG)
|
||||
else()
|
||||
add_subdirectory(../../ ${CMAKE_CURRENT_BINARY_DIR}/headers)
|
||||
endif()
|
||||
|
||||
if (NOT TARGET Vulkan::Headers)
|
||||
message(FATAL_ERROR "Vulkan::Headers target not defined")
|
||||
endif()
|
||||
if (NOT TARGET Vulkan::HppModule AND VULKAN_HEADERS_ENABLE_MODULE)
|
||||
message(FATAL_ERROR "Vulkan::HppModule target not defined")
|
||||
endif()
|
||||
|
||||
if (FIND_PACKAGE_TESTING)
|
||||
if (NOT DEFINED VulkanHeaders_VERSION)
|
||||
message(FATAL_ERROR "VulkanHeaders_VERSION not defined!")
|
||||
endif()
|
||||
message(STATUS "VulkanHeaders_VERSION = ${VulkanHeaders_VERSION}")
|
||||
endif()
|
||||
|
||||
if (NOT FIND_PACKAGE_TESTING)
|
||||
# Consuming vulkan-headers via add_subdirectory should NOT add installation code to the parent CMake project.
|
||||
if (DEFINED CMAKE_INSTALL_INCLUDEDIR)
|
||||
message(FATAL_ERROR "CMAKE_INSTALL_INCLUDEDIR was defined!")
|
||||
endif()
|
||||
|
||||
# NOTE: Some users may not be using the namespace target.
|
||||
# Don't accidentally break them unless we have to.
|
||||
if (NOT TARGET Vulkan-Headers)
|
||||
message(FATAL_ERROR "Backcompat for Vulkan-Headers target broken!")
|
||||
endif()
|
||||
if (NOT TARGET Vulkan-HppModule AND VULKAN_HEADERS_ENABLE_MODULE)
|
||||
message(FATAL_ERROR "Backcompat for Vulkan-HppModule target broken!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_C_EXTENSIONS OFF)
|
||||
|
||||
if(${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
|
||||
add_compile_options(
|
||||
-Wpedantic
|
||||
-Wall
|
||||
-Wextra
|
||||
-Werror
|
||||
)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
add_compile_options(
|
||||
/W4
|
||||
/permissive-
|
||||
/WX
|
||||
)
|
||||
endif()
|
||||
|
||||
# Test the non-API headers provided by this repo
|
||||
# NOTE: For us testing just means that these header files compile
|
||||
# with reasonable warnings.
|
||||
|
||||
# vk_icd.h
|
||||
add_library(vk_icd MODULE ../vk_icd.c)
|
||||
target_link_libraries(vk_icd PRIVATE Vulkan::Headers)
|
||||
|
||||
# vk_layer.h
|
||||
add_library(vk_layer MODULE ../vk_layer.c)
|
||||
target_link_libraries(vk_layer PRIVATE Vulkan::Headers)
|
||||
|
||||
# vulkan.hpp
|
||||
add_library(vk_hpp MODULE ../vk_hpp.cpp)
|
||||
target_compile_features(vk_hpp PUBLIC cxx_std_11)
|
||||
target_link_libraries(vk_hpp PRIVATE Vulkan::Headers)
|
||||
|
||||
# vulkan.cppm
|
||||
if (VULKAN_HEADERS_ENABLE_MODULE)
|
||||
add_library(vk_hpp_module MODULE ../vk_hpp_module.cpp)
|
||||
set_target_properties(vk_hpp_module PROPERTIES CXX_SCAN_FOR_MODULES ON)
|
||||
target_link_libraries(vk_hpp_module PRIVATE Vulkan::HppModule)
|
||||
endif()
|
13
tests/vk_hpp.cpp
Normal file
13
tests/vk_hpp.cpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright 2025 The Khronos Group Inc.
|
||||
* Copyright 2025 Valve Corporation
|
||||
* Copyright 2025 LunarG, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include <vulkan/vulkan.hpp>
|
||||
|
||||
int header_version()
|
||||
{
|
||||
return VK_HEADER_VERSION;
|
||||
}
|
13
tests/vk_hpp_module.cpp
Normal file
13
tests/vk_hpp_module.cpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright 2025 The Khronos Group Inc.
|
||||
* Copyright 2025 Valve Corporation
|
||||
* Copyright 2025 LunarG, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import vulkan_hpp;
|
||||
|
||||
int test_version()
|
||||
{
|
||||
return static_cast<int>(vk::makeApiVersion(1, 0, 0, 0));
|
||||
}
|
14
tests/vk_icd.c
Normal file
14
tests/vk_icd.c
Normal file
|
@ -0,0 +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 square(int i)
|
||||
{
|
||||
return i * i;
|
||||
}
|
14
tests/vk_layer.c
Normal file
14
tests/vk_layer.c
Normal file
|
@ -0,0 +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 square(int i)
|
||||
{
|
||||
return i * i;
|
||||
}
|
Loading…
Add table
Reference in a new issue