diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index aae55840a..a45623af5 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -1,5 +1,5 @@ -# Copyright (c) 2021-2023 Valve Corporation -# Copyright (c) 2021-2023 LunarG, Inc. +# Copyright (c) 2021-2024 Valve Corporation +# Copyright (c) 2021-2024 LunarG, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,7 +29,8 @@ concurrency: cancel-in-progress: true jobs: - linux: + linux: + needs: tools_codegen runs-on: ${{matrix.os}} strategy: @@ -37,54 +38,47 @@ jobs: cc: [ gcc ] cxx: [ g++ ] config: [ Debug, Release ] - os: [ ubuntu-20.04, ubuntu-22.04 ] - cube_wsi: [ XCB ] + os: [ ubuntu-22.04, ubuntu-22.04 ] include: - # Test WAYLAND - - cc: gcc - cxx: g++ - config: Release - os: ubuntu-22.04 - cube_wsi: WAYLAND - # Test clang on ubuntu 20 with XLIB + # Test clang on ubuntu 22 - cc: clang cxx: clang++ config: Debug - os: ubuntu-20.04 - cube_wsi: XLIB - # Test clang on ubuntu 22 with the DISPLAY option + os: ubuntu-22.04 + # Test clang on ubuntu 24 - cc: clang cxx: clang++ config: Release - os: ubuntu-22.04 - cube_wsi: DISPLAY + os: ubuntu-24.04 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.7' + python-version: '3.10' - run: | sudo apt-get -qq update - sudo apt install libwayland-dev xorg-dev wayland-protocols + sudo apt install --yes libwayland-dev xorg-dev wayland-protocols - uses: lukka/get-cmake@latest with: - cmakeVersion: 3.17.2 + cmakeVersion: 3.22.1 - name: Setup ccache uses: hendrikmuhs/ccache-action@v1.2 with: - key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.cc }}-${{matrix.cube_wsi}} + key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.cc }} + # This is to combat a bug when using 6.6 linux kernels with thread/address sanitizer + # https://github.com/google/sanitizers/issues/1716 + - run: sudo sysctl vm.mmap_rnd_bits=28 - name: Configure run: | cmake -S. -B build -G "Ninja" \ -D CMAKE_BUILD_TYPE=${{matrix.config}} \ - -D CUBE_WSI_SELECTION=${{matrix.cube_wsi}} \ -D UPDATE_DEPS=ON \ -D BUILD_WERROR=ON \ -D INSTALL_ICD=ON \ -D BUILD_TESTS=ON \ - -D ENABLE_ADDRESS_SANITIZER=OFF # Re-enable when github CI doesn't have fatal issues + -D ENABLE_ADDRESS_SANITIZER=ON env: CC: ${{matrix.cc}} CXX: ${{matrix.cxx}} @@ -108,7 +102,8 @@ jobs: - run: scripts/update_deps.py --dir ext --no-build - run: scripts/generate_source.py --verify ext/Vulkan-Headers/registry/ - windows: + windows: + needs: tools_codegen runs-on: ${{matrix.os}} strategy: @@ -121,7 +116,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.7' + python-version: '3.10' - uses: lukka/get-cmake@latest - uses: ilammy/msvc-dev-cmd@v1 with: @@ -141,6 +136,8 @@ jobs: run: ctest --output-on-failure mac: + # mac is 10x expensive to run on GitHub machines, so only run if we know something else fast/simple passed as well + needs: chromium runs-on: macos-latest steps: - uses: actions/checkout@v4 @@ -166,7 +163,8 @@ jobs: - run: cmake --install build --prefix /tmp - android: + android: + needs: tools_codegen runs-on: ubuntu-22.04 strategy: matrix: @@ -198,6 +196,7 @@ jobs: run: cmake --install build --prefix /tmp mingw: + needs: tools_codegen runs-on: windows-latest defaults: run: @@ -225,18 +224,20 @@ jobs: - run: cmake --install build --prefix build/install tools_codegen: + needs: codegen runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.10' - - run: sudo apt-get -qq update && sudo apt install libwayland-dev xorg-dev wayland-protocols + - run: sudo apt-get -qq update && sudo apt install --yes libwayland-dev xorg-dev wayland-protocols - run: cmake -S . -B build/ -D UPDATE_DEPS=ON -D UPDATE_DEPS_DIR=external -D TOOLS_CODEGEN=ON - run: cmake --build build --target tools_codegen - run: git diff --exit-code chromium: + needs: tools_codegen runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/BUILD.md b/BUILD.md index 12cdd2796..ef6435029 100644 --- a/BUILD.md +++ b/BUILD.md @@ -12,7 +12,7 @@ ## Requirements -1. CMake >= 3.17.2 +1. CMake >= 3.22.1 1. C++17 compatible toolchain 1. Git 1. Python >= 3.10 @@ -179,7 +179,7 @@ See the [CMake documentation](https://cmake.org/cmake/help/latest/generator/Xcod ## Building For Android -- CMake 3.21+ +- CMake 3.22.1+ - NDK r25+ - Ninja 1.10+ - Android SDK Build-Tools 34.0.0+ diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dc2a6322..ae42beb7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ~~~ -cmake_minimum_required(VERSION 3.17.2) +cmake_minimum_required(VERSION 3.22.1) project(Vulkan-Tools) @@ -148,7 +148,6 @@ if(BUILD_ICD) add_subdirectory(icd) endif() -add_subdirectory(windows-runtime-installer) if(BUILD_TESTS) enable_testing() diff --git a/cube/BUILD.gn b/cube/BUILD.gn new file mode 100644 index 000000000..a6a1e4aeb --- /dev/null +++ b/cube/BUILD.gn @@ -0,0 +1,152 @@ +# Copyright (C) 2025 The Fuchsia Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +assert(is_fuchsia, "This build file works on Fuchsia GN build only.") + +import("//build/compiled_action.gni") +import("//build/components.gni") +import("//build_overrides/vulkan_tools.gni") +import("//src/lib/vulkan/layers.gni") + +group("cube") { + testonly = true + deps = [ + ":vkcube-on-fb", + ":vkcube-on-scenic", + ] +} + +fuchsia_test_component("vkcube-on-fb-component") { + component_name = "vkcube-on-fb" + deps = [ + ":vkcube", + "//src/lib/vulkan/swapchain:image_pipe_swapchain_fb_layer", + "//src/lib/vulkan/validation_layers", + ] + manifest = "fuchsia/meta/vkcube-on-fb.cml" + test_type = "system" +} + +fuchsia_test_package("vkcube-on-fb") { + test_components = [ ":vkcube-on-fb-component" ] + test_specs = { + # vkcube runs forever, so only run manually. + environments = [] + } +} + +fuchsia_component("vkcube-on-scenic-component") { + component_name = "vkcube-on-scenic" + deps = [ + ":vkcube", + "//src/lib/vulkan/swapchain:image_pipe_swapchain_layer", + "//src/lib/vulkan/validation_layers", + ] + + manifest = "fuchsia/meta/vkcube-on-scenic.cml" +} + +fuchsia_package("vkcube-on-scenic") { + deps = [ ":vkcube-on-scenic-component" ] +} + +config("cube_config") { + cube_frag_inc = "$target_gen_dir/cube.frag.inc" + cube_vert_inc = "$target_gen_dir/cube.vert.inc" + + cube_frag_inc_rebased = rebase_path(cube_frag_inc, root_build_dir) + cube_vert_inc_rebased = rebase_path(cube_vert_inc, root_build_dir) + + inputs = [ + cube_frag_inc, + cube_vert_inc, + ] + + defines = [ + "CUBE_FRAG_INC=\"$cube_frag_inc_rebased\"", + "CUBE_VERT_INC=\"$cube_vert_inc_rebased\"", + "VULKAN_HPP_NO_NODISCARD_WARNINGS", + ] + + include_dirs = [ root_build_dir ] + + cflags = [ "-Wno-implicit-int-float-conversion" ] +} + +executable("vkcube") { + defines = [] + if (defined(texture_ppm_h)) { + path = rebase_path(texture_ppm_h, root_build_dir) + defines += [ "TEXTURE_PPM_H=\"$path\"" ] + } + + sources = [ + "cube.cpp", + "fuchsia/flatland_view.cpp", + "fuchsia/flatland_view.h", + ] + + configs += [ + ":cube_config", + "${volk_dir}:volk_config", + ] + + deps = [ + ":glslang_frag", + ":glslang_vert", + "//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app_cpp", + "//sdk/fidl/fuchsia.ui.composition:fuchsia.ui.composition_cpp", + "//sdk/fidl/fuchsia.ui.views:fuchsia.ui.views_cpp", + "//sdk/lib/async-loop:async-loop-cpp", + "//sdk/lib/component/incoming/cpp", + "//sdk/lib/component/outgoing/cpp", + "//sdk/lib/syslog/cpp", + "//sdk/lib/ui/scenic/cpp", + "//third_party/Vulkan-Headers/src:vulkan_headers", + "//third_party/Vulkan-Loader:libvulkan", + "//zircon/system/ulib/syslog", + ] +} + +compiled_action("glslang_frag") { + tool = "//third_party/glslang:glslang_validator" + outputs = [ "$target_gen_dir/cube.frag.inc" ] + + sources = [ "cube.frag" ] + + args = [ + "--quiet", + "-V", + "-x", + "-o", + rebase_path("$target_gen_dir/cube.frag.inc", root_build_dir), + rebase_path("cube.frag", root_build_dir), + ] +} + +compiled_action("glslang_vert") { + tool = "//third_party/glslang:glslang_validator" + outputs = [ "$target_gen_dir/cube.vert.inc" ] + + sources = [ "cube.vert" ] + + args = [ + "--quiet", + "-V", + "-x", + "-o", + rebase_path("$target_gen_dir/cube.vert.inc", root_build_dir), + rebase_path("cube.vert", root_build_dir), + ] +} diff --git a/cube/CMakeLists.txt b/cube/CMakeLists.txt index 880cf741c..4ecd3e36e 100644 --- a/cube/CMakeLists.txt +++ b/cube/CMakeLists.txt @@ -61,32 +61,58 @@ if(APPLE) endif() endif() +if(ANDROID OR APPLE) + set(WSI_DISPLAY_DEFAULT_SETTING "OFF") +else() + set(WSI_DISPLAY_DEFAULT_SETTING "ON") +endif() + +option(BUILD_WSI_DISPLAY_SUPPORT "Build DISPLAY WSI support" ${WSI_DISPLAY_DEFAULT_SETTING}) + if (CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|GNU") option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON) option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON) option(BUILD_WSI_WAYLAND_SUPPORT "Build Wayland WSI support" ON) option(BUILD_WSI_DIRECTFB_SUPPORT "Build DirectFB WSI support" OFF) - set(CUBE_WSI_SELECTION "XCB" CACHE STRING "Select WSI target for vkcube (XCB, XLIB, WAYLAND, DIRECTFB, DISPLAY)") find_package(PkgConfig REQUIRED QUIET) # Use PkgConfig to find Linux system libraries if(BUILD_WSI_XCB_SUPPORT) pkg_check_modules(XCB REQUIRED QUIET IMPORTED_TARGET xcb) + pkg_get_variable(XCB_INCLUDE_DIRS xcb includedir) + message(DEBUG "XCB_INCLUDE_DIRS = ${XCB_INCLUDE_DIRS}") endif() if(BUILD_WSI_XLIB_SUPPORT) pkg_check_modules(X11 REQUIRED QUIET IMPORTED_TARGET x11) + pkg_get_variable(XLIB_INCLUDE_DIRS x11 includedir) + message(DEBUG "XLIB_INCLUDE_DIRS = ${XLIB_INCLUDE_DIRS}") endif() if(BUILD_WSI_WAYLAND_SUPPORT) pkg_check_modules(WAYLAND_CLIENT REQUIRED IMPORTED_TARGET wayland-client) + pkg_get_variable(WAYLAND_INCLUDE_DIRS wayland-client includedir) pkg_get_variable(WAYLAND_SCANNER_EXECUTABLE wayland-scanner wayland_scanner) - message(STATUS "WAYLAND_SCANNER_EXECUTABLE = ${WAYLAND_SCANNER_EXECUTABLE}") + message(DEBUG "WAYLAND_SCANNER_EXECUTABLE = ${WAYLAND_SCANNER_EXECUTABLE}") + + pkg_get_variable(WAYLAND_CLIENT_PATH wayland-client pkgdatadir) + message(DEBUG "WAYLAND_CLIENT_PATH = ${WAYLAND_CLIENT_PATH}") + set(WAYLAND_CODE_PROTOCOL ${WAYLAND_CLIENT_PATH}/wayland.xml) pkg_get_variable(WAYLAND_PROTOCOLS_PATH wayland-protocols pkgdatadir) - message(STATUS "WAYLAND_PROTOCOLS_PATH = ${WAYLAND_PROTOCOLS_PATH}") + message(DEBUG "WAYLAND_PROTOCOLS_PATH = ${WAYLAND_PROTOCOLS_PATH}") set(XDG_SHELL_PROTOCOL ${WAYLAND_PROTOCOLS_PATH}/stable/xdg-shell/xdg-shell.xml) + + add_custom_command(COMMENT "Generating wayland client protocol dispatch data" + OUTPUT wayland-client.c + COMMAND ${WAYLAND_SCANNER_EXECUTABLE} + private-code + ${WAYLAND_CODE_PROTOCOL} + ${CMAKE_CURRENT_BINARY_DIR}/wayland-client.c + MAIN_DEPENDENCY ${WAYLAND_CODE_PROTOCOL} + DEPENDS ${WAYLAND_CODE_PROTOCOL} ${WAYLAND_SCANNER_EXECUTABLE}) + add_custom_command(COMMENT "Generating xdg-shell protocol dispatch data" OUTPUT xdg-shell-code.c COMMAND ${WAYLAND_SCANNER_EXECUTABLE} @@ -121,6 +147,12 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|GNU") ${CMAKE_CURRENT_BINARY_DIR}/xdg-decoration-client-header.h MAIN_DEPENDENCY ${XDG_DECORATION_PROTOCOL} DEPENDS ${XDG_DECORATION_PROTOCOL} ${WAYLAND_SCANNER_EXECUTABLE}) + + set(WAYLAND_ADDITIONAL_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/wayland-client.c + ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-code.c + ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-client-header.h + ${CMAKE_CURRENT_BINARY_DIR}/xdg-decoration-code.c + ${CMAKE_CURRENT_BINARY_DIR}/xdg-decoration-client-header.h) endif() if(BUILD_WSI_DIRECTFB_SUPPORT) @@ -128,59 +160,39 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|GNU") endif() endif() +if(BUILD_WSI_DISPLAY_SUPPORT) + list(APPEND ENABLED_CUBE_PLATFORMS VK_USE_PLATFORM_DISPLAY_KHR) +endif() + if(WIN32) - add_definitions(-DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN -DNOMINMAX) + add_definitions(-DWIN32_LEAN_AND_MEAN -DNOMINMAX) + list(APPEND ENABLED_CUBE_PLATFORMS VK_USE_PLATFORM_WIN32_KHR) elseif(ANDROID) - add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR) + list(APPEND ENABLED_CUBE_PLATFORMS VK_USE_PLATFORM_ANDROID_KHR) elseif(APPLE) - add_definitions(-DVK_USE_PLATFORM_METAL_EXT) + list(APPEND ENABLED_CUBE_PLATFORMS VK_USE_PLATFORM_METAL_EXT) elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|GNU") - if(NOT CUBE_WSI_SELECTION) - set(CUBE_WSI_SELECTION "XCB") + if(BUILD_WSI_XCB_SUPPORT) + list(APPEND ENABLED_CUBE_PLATFORMS VK_USE_PLATFORM_XCB_KHR) endif() - - if(CUBE_WSI_SELECTION STREQUAL "XCB") - if(NOT BUILD_WSI_XCB_SUPPORT) - message(FATAL_ERROR "Selected XCB for vkcube build but not building Xcb support") - endif() - link_libraries(PkgConfig::XCB) - set(CUBE_PLATFORM VK_USE_PLATFORM_XCB_KHR) - elseif(CUBE_WSI_SELECTION STREQUAL "XLIB") - if(NOT BUILD_WSI_XLIB_SUPPORT) - message(FATAL_ERROR "Selected XLIB for vkcube build but not building Xlib support") - endif() - link_libraries(PkgConfig::X11) - set(CUBE_PLATFORM VK_USE_PLATFORM_XLIB_KHR) - elseif(CUBE_WSI_SELECTION STREQUAL "WAYLAND") - if(NOT BUILD_WSI_WAYLAND_SUPPORT) - message(FATAL_ERROR "Selected Wayland for vkcube build but not building Wayland support") - endif() - link_libraries(PkgConfig::WAYLAND_CLIENT) - set(CUBE_PLATFORM VK_USE_PLATFORM_WAYLAND_KHR) - set(XDG_SHELL_PROTOCOL ${WAYLAND_PROTOCOLS_PATH}/stable/xdg-shell/xdg-shell.xml) - set(OPTIONAL_WAYLAND_DATA_FILES - ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-code.c - ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-client-header.h - ${CMAKE_CURRENT_BINARY_DIR}/xdg-decoration-code.c - ${CMAKE_CURRENT_BINARY_DIR}/xdg-decoration-client-header.h) - include_directories(${CMAKE_CURRENT_BINARY_DIR}) - elseif(CUBE_WSI_SELECTION STREQUAL "DIRECTFB") - if(NOT BUILD_WSI_DIRECTFB_SUPPORT) - message(FATAL_ERROR "Selected DIRECTFB for vkcube build but not building DirectFB support") - endif() - link_libraries(PkgConfig::DirectFB) - set(CUBE_PLATFORM VK_USE_PLATFORM_DIRECTFB_EXT) - elseif(CUBE_WSI_SELECTION STREQUAL "DISPLAY") - set(CUBE_PLATFORM VK_USE_PLATFORM_DISPLAY_KHR) - else() - message(FATAL_ERROR "Unrecognized value for CUBE_WSI_SELECTION: ${CUBE_WSI_SELECTION}") + if(BUILD_WSI_XLIB_SUPPORT) + list(APPEND ENABLED_CUBE_PLATFORMS VK_USE_PLATFORM_XLIB_KHR) + endif() + if(BUILD_WSI_WAYLAND_SUPPORT) + list(APPEND ENABLED_CUBE_PLATFORMS VK_USE_PLATFORM_WAYLAND_KHR) + endif() + if(BUILD_WSI_DIRECTFB_SUPPORT) + list(APPEND ENABLED_CUBE_PLATFORMS VK_USE_PLATFORM_DIRECTFB_EXT) endif() - link_libraries(${API_LOWERCASE} m) else() message(FATAL_ERROR "Unsupported Platform!") endif() +if(NOT DEFINED ENABLED_CUBE_PLATFORMS) + message(FATAL_ERROR "There are no supported WSI platforms on this system, vkcube requires a WSI platform be available to be able to render its output") +endif() + if (COMPILE_CUBE_SHADERS) # Try to find glslang in system paths or in an SDK if the VULKAN_SDK env-var is set find_program(GLSLANG_VALIDATOR names glslang glslangValidator HINTS $ENV{GLSLANG_INSTALL_DIR} $ENV{VULKAN_SDK}/bin $ENV{VULKAN_SDK}/Bin) @@ -226,7 +238,6 @@ elseif (ANDROID) add_subdirectory(android) - target_link_libraries(vkcube PRIVATE Vulkan::Headers volk::volk_headers) elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|GNU") add_executable(vkcube) target_sources(vkcube PRIVATE @@ -235,15 +246,28 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|GNU") ${PROJECT_SOURCE_DIR}/cube/cube.frag cube.vert.inc cube.frag.inc - ${OPTIONAL_WAYLAND_DATA_FILES} ) - target_compile_definitions(vkcube PUBLIC ${CUBE_PLATFORM}) + target_link_libraries(vkcube Threads::Threads) + if(BUILD_WSI_XCB_SUPPORT) + target_sources(vkcube PRIVATE xcb_loader.h) + target_include_directories(vkcube PRIVATE ${xcb_INCLUDE_DIRS}) + endif() + if(BUILD_WSI_XLIB_SUPPORT) + target_sources(vkcube PRIVATE xlib_loader.h) + target_include_directories(vkcube PRIVATE ${XLIB_INCLUDE_DIRS}) + endif() + if(BUILD_WSI_WAYLAND_SUPPORT) + target_include_directories(vkcube PRIVATE ${WAYLAND_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) + target_sources(vkcube PRIVATE PRIVATE ${WAYLAND_ADDITIONAL_SOURCES}) + endif() + if(BUILD_WSI_DIRECTFB_SUPPORT) + target_link_libraries(vkcube PkgConfig::DirectFB) + endif() include(CheckLibraryExists) CHECK_LIBRARY_EXISTS("rt" clock_gettime "" NEED_RT) if (NEED_RT) - target_link_libraries(vkcube PRIVATE rt) + target_link_libraries(vkcube rt) endif() - target_link_libraries(vkcube PRIVATE Vulkan::Headers volk::volk_headers Threads::Threads) elseif(WIN32) add_executable(vkcube WIN32) target_sources(vkcube PRIVATE @@ -253,12 +277,13 @@ elseif(WIN32) cube.vert.inc cube.frag.inc ) - target_link_libraries(vkcube PRIVATE Vulkan::Headers volk::volk_headers) else() message(FATAL_ERROR "Unsupported Platform!") endif() +target_compile_definitions(vkcube PRIVATE ${ENABLED_CUBE_PLATFORMS}) target_include_directories(vkcube PRIVATE .) +target_link_libraries(vkcube Vulkan::Headers volk::volk_headers) if (ANDROID) install(TARGETS vkcube DESTINATION ${CMAKE_INSTALL_LIBDIR}) @@ -280,6 +305,16 @@ if (ANDROID) return() endif() +if (XCB_LINK_LIBRARIES) + target_compile_definitions(vkcube PRIVATE "XCB_LIBRARY=\"${XCB_LINK_LIBRARIES}\"") +endif() +if (X11_LINK_LIBRARIES) + target_compile_definitions(vkcube PRIVATE "XLIB_LIBRARY=\"${X11_LINK_LIBRARIES}\"") +endif() +if (WAYLAND_CLIENT_LINK_LIBRARIES) + target_compile_definitions(vkcube PRIVATE "WAYLAND_LIBRARY=\"${WAYLAND_CLIENT_LINK_LIBRARIES}\"") +endif() + # ---------------------------------------------------------------------------- # vkcubepp @@ -291,10 +326,24 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|GNU") ${PROJECT_SOURCE_DIR}/cube/cube.vert ${PROJECT_SOURCE_DIR}/cube/cube.frag cube.vert.inc - cube.frag.inc - ${OPTIONAL_WAYLAND_DATA_FILES}) - target_link_libraries(vkcubepp Vulkan::Headers volk::volk_headers Threads::Threads) - target_compile_definitions(vkcubepp PUBLIC ${CUBE_PLATFORM}) + cube.frag.inc) + target_link_libraries(vkcubepp Threads::Threads) + + if(BUILD_WSI_XCB_SUPPORT) + target_sources(vkcubepp PRIVATE xcb_loader.h) + target_include_directories(vkcubepp PRIVATE ${xcb_INCLUDE_DIRS}) + endif() + if(BUILD_WSI_XLIB_SUPPORT) + target_sources(vkcubepp PRIVATE xlib_loader.h) + target_include_directories(vkcubepp PRIVATE ${XLIB_INCLUDE_DIRS}) + endif() + if(BUILD_WSI_WAYLAND_SUPPORT) + target_include_directories(vkcubepp PRIVATE ${WAYLAND_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) + target_sources(vkcubepp PRIVATE ${WAYLAND_ADDITIONAL_SOURCES}) + endif() + if(BUILD_WSI_DIRECTFB_SUPPORT) + target_link_libraries(vkcubepp PkgConfig::DirectFB) + endif() else() add_executable(vkcubepp WIN32 @@ -303,9 +352,21 @@ else() ${PROJECT_SOURCE_DIR}/cube/cube.frag cube.vert.inc cube.frag.inc) - target_link_libraries(vkcubepp Vulkan::Headers volk::volk_headers) endif() + target_include_directories(vkcubepp PRIVATE .) +target_compile_definitions(vkcubepp PRIVATE ${ENABLED_CUBE_PLATFORMS}) +target_link_libraries(vkcubepp Vulkan::Headers volk::volk_headers) + +if (XCB_LINK_LIBRARIES ) + target_compile_definitions(vkcubepp PUBLIC "XCB_LIBRARY=\"${XCB_LINK_LIBRARIES}\"") +endif() +if (X11_LINK_LIBRARIES) + target_compile_definitions(vkcubepp PUBLIC "XLIB_LIBRARY=\"${X11_LINK_LIBRARIES}\"") +endif() +if (WAYLAND_CLIENT_LINK_LIBRARIES) + target_compile_definitions(vkcubepp PUBLIC "WAYLAND_LIBRARY=\"${WAYLAND_CLIENT_LINK_LIBRARIES}\"") +endif() if(APPLE) install( @@ -320,41 +381,3 @@ if(APPLE) else() install(TARGETS vkcubepp) endif() - -# ---------------------------------------------------------------------------- -# vkcube-wayland - -if (CMAKE_SYSTEM_NAME MATCHES "Linux|BSD") - if(BUILD_WSI_WAYLAND_SUPPORT AND EXISTS ${WAYLAND_PROTOCOLS_PATH}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml) - add_executable(vkcube-wayland) - - target_sources(vkcube-wayland PRIVATE - cube.c - ${PROJECT_SOURCE_DIR}/cube/cube.vert - ${PROJECT_SOURCE_DIR}/cube/cube.frag - cube.vert.inc - cube.frag.inc - ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-code.c - ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-client-header.h - ${CMAKE_CURRENT_BINARY_DIR}/xdg-decoration-code.c - ${CMAKE_CURRENT_BINARY_DIR}/xdg-decoration-client-header.h - ) - target_include_directories(vkcube-wayland PRIVATE - ${CMAKE_CURRENT_BINARY_DIR} - . - ) - target_link_libraries(vkcube-wayland PRIVATE - Vulkan::Headers - volk::volk_headers - Threads::Threads - PkgConfig::WAYLAND_CLIENT - ) - target_compile_definitions(vkcube-wayland PRIVATE VK_USE_PLATFORM_WAYLAND_KHR) - include(CheckLibraryExists) - CHECK_LIBRARY_EXISTS("rt" clock_gettime "" NEED_RT) - if (NEED_RT) - target_link_libraries(vkcube-wayland PRIVATE rt) - endif() - install(TARGETS vkcube-wayland) - endif() -endif() diff --git a/cube/android/CMakeLists.txt b/cube/android/CMakeLists.txt index 66f75b424..af607a558 100644 --- a/cube/android/CMakeLists.txt +++ b/cube/android/CMakeLists.txt @@ -43,7 +43,7 @@ target_sources(android_glue PRIVATE set_target_properties(vkcube PROPERTIES OUTPUT_NAME "VkCube") -target_link_libraries(vkcube PRIVATE +target_link_libraries(vkcube android_glue log android diff --git a/cube/cube.c b/cube/cube.c index 78d0bb554..349bfc744 100644 --- a/cube/cube.c +++ b/cube/cube.c @@ -26,6 +26,7 @@ */ #define _GNU_SOURCE +#include #include #include #include @@ -33,13 +34,18 @@ #include #include #include +#if defined(VK_USE_PLATFORM_SCREEN_QNX) #include -#if defined(VK_USE_PLATFORM_XLIB_KHR) || defined(VK_USE_PLATFORM_XCB_KHR) -#include -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) +#include "xlib_loader.h" +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) +#include "xcb_loader.h" +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) #include -#include "xdg-shell-client-header.h" -#include "xdg-decoration-client-header.h" +#include "wayland_loader.h" #endif #ifdef _WIN32 @@ -290,6 +296,97 @@ char const *to_string(VkPhysicalDeviceType const type) { } } +typedef enum WSI_PLATFORM { + WSI_PLATFORM_AUTO = 0, + WSI_PLATFORM_WIN32, + WSI_PLATFORM_METAL, + WSI_PLATFORM_ANDROID, + WSI_PLATFORM_QNX, + WSI_PLATFORM_XCB, + WSI_PLATFORM_XLIB, + WSI_PLATFORM_WAYLAND, + WSI_PLATFORM_DIRECTFB, + WSI_PLATFORM_DISPLAY, + WSI_PLATFORM_INVALID, // Sentinel just to indicate invalid user input +} WSI_PLATFORM; + +WSI_PLATFORM wsi_from_string(const char *str) { + if (strcmp(str, "auto") == 0) return WSI_PLATFORM_AUTO; +#if defined(VK_USE_PLATFORM_WIN32_KHR) + if (strcmp(str, "win32") == 0) return WSI_PLATFORM_WIN32; +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + if (strcmp(str, "metal") == 0) return WSI_PLATFORM_METAL; +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + if (strcmp(str, "android") == 0) return WSI_PLATFORM_ANDROID; +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + if (strcmp(str, "qnx") == 0) return WSI_PLATFORM_QNX; +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + if (strcmp(str, "xcb") == 0) return WSI_PLATFORM_XCB; +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + if (strcmp(str, "xlib") == 0) return WSI_PLATFORM_XLIB; +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + if (strcmp(str, "wayland") == 0) return WSI_PLATFORM_WAYLAND; +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (strcmp(str, "directfb") == 0) return WSI_PLATFORM_DIRECTFB; +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + if (strcmp(str, "display") == 0) return WSI_PLATFORM_DISPLAY; +#endif + return WSI_PLATFORM_INVALID; +}; + +const char *wsi_to_string(WSI_PLATFORM wsi_platform) { + switch (wsi_platform) { + case (WSI_PLATFORM_AUTO): + return "auto"; +#if defined(VK_USE_PLATFORM_WIN32_KHR) + case (WSI_PLATFORM_WIN32): + return "win32"; +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + case (WSI_PLATFORM_METAL): + return "metal"; +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + case (WSI_PLATFORM_ANDROID): + return "android"; +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + case (WSI_PLATFORM_QNX): + return "qnx"; +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + case (WSI_PLATFORM_XCB): + return "xcb"; +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + case (WSI_PLATFORM_XLIB): + return "xlib"; +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + case (WSI_PLATFORM_WAYLAND): + return "wayland"; +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + case (WSI_PLATFORM_DIRECTFB): + return "directfb"; +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + case (WSI_PLATFORM_DISPLAY): + return "display"; +#endif + default: + return "unknown"; + } +}; + typedef struct { VkImage image; VkCommandBuffer cmd; @@ -309,18 +406,24 @@ struct demo { char name[APP_NAME_STR_LEN]; // Name to put on the window/icon HWND window; // hWnd - window handle POINT minsize; // minimum window size -#elif defined(VK_USE_PLATFORM_XLIB_KHR) - Display *display; +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + void *xlib_library; + Display *xlib_display; Window xlib_window; Atom xlib_wm_delete_window; -#elif defined(VK_USE_PLATFORM_XCB_KHR) - Display *display; +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + void *xcb_library; + Display *xcb_display; xcb_connection_t *connection; xcb_screen_t *screen; xcb_window_t xcb_window; xcb_intern_atom_reply_t *atom_wm_delete_window; -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - struct wl_display *display; +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + void *wayland_library; // Dynamic library for wayland + struct wl_display *wayland_display; struct wl_registry *registry; struct wl_compositor *compositor; struct wl_surface *window; @@ -333,20 +436,24 @@ struct demo { struct wl_seat *seat; struct wl_pointer *pointer; struct wl_keyboard *keyboard; -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) IDirectFB *dfb; - IDirectFBSurface *window; + IDirectFBSurface *directfb_window; IDirectFBEventBuffer *event_buffer; -#elif defined(VK_USE_PLATFORM_ANDROID_KHR) +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) struct ANativeWindow *window; -#elif defined(VK_USE_PLATFORM_METAL_EXT) +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) void *caMetalLayer; -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) screen_context_t screen_context; screen_window_t screen_window; screen_event_t screen_event; #endif - + WSI_PLATFORM wsi_platform; VkSurfaceKHR surface; bool prepared; bool use_staging_buffer; @@ -437,7 +544,6 @@ struct demo { int32_t curFrame; int32_t frameCount; bool validate; - bool validate_checks_disabled; bool use_break; bool suppress_popups; bool force_errors; @@ -1622,7 +1728,7 @@ static void demo_prepare_texture_buffer(struct demo *demo, const char *filename, static void demo_prepare_texture_image(struct demo *demo, const char *filename, struct texture_object *tex_obj, VkImageTiling tiling, VkImageUsageFlags usage, VkFlags required_props) { - const VkFormat tex_format = VK_FORMAT_R8G8B8A8_UNORM; + const VkFormat tex_format = VK_FORMAT_R8G8B8A8_SRGB; int32_t tex_width; int32_t tex_height; VkResult U_ASSERT_ONLY err; @@ -1707,7 +1813,7 @@ static void demo_destroy_texture(struct demo *demo, struct texture_object *tex_o } static void demo_prepare_textures(struct demo *demo) { - const VkFormat tex_format = VK_FORMAT_R8G8B8A8_UNORM; + const VkFormat tex_format = VK_FORMAT_R8G8B8A8_SRGB; VkFormatProperties props; uint32_t i; @@ -1764,8 +1870,8 @@ static void demo_prepare_textures(struct demo *demo) { demo_pop_cb_label(demo, demo->cmd); // "StagingTexture" } else { - /* Can't support VK_FORMAT_R8G8B8A8_UNORM !? */ - assert(!"No support for R8G8B8A8_UNORM as texture image format"); + /* Can't support VK_FORMAT_R8G8B8A8_SRGB !? */ + assert(!"No support for R8G8B8A8_SRGB as texture image format"); } const VkSamplerCreateInfo sampler = { @@ -2436,35 +2542,49 @@ static void demo_cleanup(struct demo *demo) { vkDestroySurfaceKHR(demo->inst, demo->surface, NULL); #if defined(VK_USE_PLATFORM_XLIB_KHR) - XDestroyWindow(demo->display, demo->xlib_window); - XCloseDisplay(demo->display); -#elif defined(VK_USE_PLATFORM_XCB_KHR) - xcb_destroy_window(demo->connection, demo->xcb_window); - xcb_disconnect(demo->connection); - free(demo->atom_wm_delete_window); -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - if (demo->keyboard) wl_keyboard_destroy(demo->keyboard); - if (demo->pointer) wl_pointer_destroy(demo->pointer); - if (demo->seat) wl_seat_destroy(demo->seat); - xdg_toplevel_destroy(demo->xdg_toplevel); - xdg_surface_destroy(demo->xdg_surface); - wl_surface_destroy(demo->window); - xdg_wm_base_destroy(demo->xdg_wm_base); - if (demo->xdg_decoration_mgr) { - zxdg_toplevel_decoration_v1_destroy(demo->toplevel_decoration); - zxdg_decoration_manager_v1_destroy(demo->xdg_decoration_mgr); - } - wl_compositor_destroy(demo->compositor); - wl_registry_destroy(demo->registry); - wl_display_disconnect(demo->display); -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) - demo->event_buffer->Release(demo->event_buffer); - demo->window->Release(demo->window); - demo->dfb->Release(demo->dfb); -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) - screen_destroy_event(demo->screen_event); - screen_destroy_window(demo->screen_window); - screen_destroy_context(demo->screen_context); + if (demo->wsi_platform == WSI_PLATFORM_XLIB) { + XDestroyWindow(demo->xlib_display, demo->xlib_window); + XCloseDisplay(demo->xlib_display); + } +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + if (demo->wsi_platform == WSI_PLATFORM_XCB) { + xcb_destroy_window(demo->connection, demo->xcb_window); + xcb_disconnect(demo->connection); + free(demo->atom_wm_delete_window); + } +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + if (demo->wsi_platform == WSI_PLATFORM_WAYLAND) { + if (demo->keyboard) wl_keyboard_destroy(demo->keyboard); + if (demo->pointer) wl_pointer_destroy(demo->pointer); + if (demo->seat) wl_seat_destroy(demo->seat); + xdg_toplevel_destroy(demo->xdg_toplevel); + xdg_surface_destroy(demo->xdg_surface); + wl_surface_destroy(demo->window); + xdg_wm_base_destroy(demo->xdg_wm_base); + if (demo->xdg_decoration_mgr) { + zxdg_toplevel_decoration_v1_destroy(demo->toplevel_decoration); + zxdg_decoration_manager_v1_destroy(demo->xdg_decoration_mgr); + } + wl_compositor_destroy(demo->compositor); + wl_registry_destroy(demo->registry); + wl_display_disconnect(demo->wayland_display); + } +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (demo->wsi_platform == WSI_PLATFORM_DIRECTFB) { + demo->event_buffer->Release(demo->event_buffer); + demo->directfb_window->Release(demo->directfb_window); + demo->dfb->Release(demo->dfb); + } +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + if (demo->wsi_platform == WSI_PLATFORM_QNX) { + screen_destroy_event(demo->screen_event); + screen_destroy_window(demo->screen_window); + screen_destroy_context(demo->screen_context); + } #endif vkDestroyInstance(demo->inst, NULL); @@ -2641,7 +2761,8 @@ static void demo_create_window(struct demo *demo) { demo->minsize.x = GetSystemMetrics(SM_CXMINTRACK); demo->minsize.y = GetSystemMetrics(SM_CYMINTRACK) + 1; } -#elif defined(VK_USE_PLATFORM_XLIB_KHR) +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) static void demo_create_xlib_window(struct demo *demo) { const char *display_envar = getenv("DISPLAY"); if (display_envar == NULL || display_envar[0] == '\0') { @@ -2651,15 +2772,15 @@ static void demo_create_xlib_window(struct demo *demo) { } XInitThreads(); - demo->display = XOpenDisplay(NULL); + demo->xlib_display = XOpenDisplay(NULL); long visualMask = VisualScreenMask; int numberOfVisuals; XVisualInfo vInfoTemplate = {}; - vInfoTemplate.screen = DefaultScreen(demo->display); - XVisualInfo *visualInfo = XGetVisualInfo(demo->display, visualMask, &vInfoTemplate, &numberOfVisuals); + vInfoTemplate.screen = DefaultScreen(demo->xlib_display); + XVisualInfo *visualInfo = XGetVisualInfo(demo->xlib_display, visualMask, &vInfoTemplate, &numberOfVisuals); Colormap colormap = - XCreateColormap(demo->display, RootWindow(demo->display, vInfoTemplate.screen), visualInfo->visual, AllocNone); + XCreateColormap(demo->xlib_display, RootWindow(demo->xlib_display, vInfoTemplate.screen), visualInfo->visual, AllocNone); XSetWindowAttributes windowAttributes = {}; windowAttributes.colormap = colormap; @@ -2667,14 +2788,14 @@ static void demo_create_xlib_window(struct demo *demo) { windowAttributes.border_pixel = 0; windowAttributes.event_mask = KeyPressMask | KeyReleaseMask | StructureNotifyMask | ExposureMask; - demo->xlib_window = XCreateWindow(demo->display, RootWindow(demo->display, vInfoTemplate.screen), 0, 0, demo->width, + demo->xlib_window = XCreateWindow(demo->xlib_display, RootWindow(demo->xlib_display, vInfoTemplate.screen), 0, 0, demo->width, demo->height, 0, visualInfo->depth, InputOutput, visualInfo->visual, CWBackPixel | CWBorderPixel | CWEventMask | CWColormap, &windowAttributes); - XSelectInput(demo->display, demo->xlib_window, ExposureMask | KeyPressMask); - XMapWindow(demo->display, demo->xlib_window); - XFlush(demo->display); - demo->xlib_wm_delete_window = XInternAtom(demo->display, "WM_DELETE_WINDOW", False); + XSelectInput(demo->xlib_display, demo->xlib_window, ExposureMask | KeyPressMask); + XMapWindow(demo->xlib_display, demo->xlib_window); + XFlush(demo->xlib_display); + demo->xlib_wm_delete_window = XInternAtom(demo->xlib_display, "WM_DELETE_WINDOW", False); } static void demo_handle_xlib_event(struct demo *demo, const XEvent *event) { switch (event->type) { @@ -2714,11 +2835,11 @@ static void demo_run_xlib(struct demo *demo) { XEvent event; if (demo->pause) { - XNextEvent(demo->display, &event); + XNextEvent(demo->xlib_display, &event); demo_handle_xlib_event(demo, &event); } - while (XPending(demo->display) > 0) { - XNextEvent(demo->display, &event); + while (XPending(demo->xlib_display) > 0) { + XNextEvent(demo->xlib_display, &event); demo_handle_xlib_event(demo, &event); } @@ -2727,7 +2848,8 @@ static void demo_run_xlib(struct demo *demo) { if (demo->frameCount != INT32_MAX && demo->curFrame == demo->frameCount) demo->quit = true; } } -#elif defined(VK_USE_PLATFORM_XCB_KHR) +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) static void demo_handle_xcb_event(struct demo *demo, const xcb_generic_event_t *event) { uint8_t event_code = event->response_type & 0x7f; switch (event_code) { @@ -2824,26 +2946,27 @@ static void demo_create_xcb_window(struct demo *demo) { xcb_configure_window(demo->connection, demo->xcb_window, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, coords); } // VK_USE_PLATFORM_XCB_KHR -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) static void demo_run(struct demo *demo) { while (!demo->quit) { // Flush any commands to the server - wl_display_flush(demo->display); + wl_display_flush(demo->wayland_display); if (demo->pause) { // block and wait for input - wl_display_dispatch(demo->display); + wl_display_dispatch(demo->wayland_display); } else { // Lock the display event queue in case the driver is doing something on another thread // while we wait, keep pumping events - while (wl_display_prepare_read(demo->display) != 0) { - wl_display_dispatch_pending(demo->display); + while (wl_display_prepare_read(demo->wayland_display) != 0) { + wl_display_dispatch_pending(demo->wayland_display); } // Actually do the read from the socket - wl_display_read_events(demo->display); + wl_display_read_events(demo->wayland_display); // Pump events - wl_display_dispatch_pending(demo->display); + wl_display_dispatch_pending(demo->wayland_display); demo_draw(demo); demo->curFrame++; @@ -2884,7 +3007,7 @@ static void handle_toplevel_close(void *data, struct xdg_toplevel *xdg_toplevel static const struct xdg_toplevel_listener xdg_toplevel_listener = {handle_toplevel_configure, handle_toplevel_close}; -static void demo_create_window(struct demo *demo) { +static void demo_create_wayland_window(struct demo *demo) { if (!demo->xdg_wm_base) { printf("Compositor did not provide the standard protocol xdg-wm-base\n"); fflush(stdout); @@ -2922,7 +3045,8 @@ static void demo_create_window(struct demo *demo) { wl_surface_commit(demo->window); } -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) static void demo_create_directfb_window(struct demo *demo) { DFBResult ret; @@ -2945,7 +3069,7 @@ static void demo_create_directfb_window(struct demo *demo) { desc.caps = DSCAPS_PRIMARY; desc.width = demo->width; desc.height = demo->height; - ret = demo->dfb->CreateSurface(demo->dfb, &desc, &demo->window); + ret = demo->dfb->CreateSurface(demo->dfb, &desc, &demo->directfb_window); if (ret) { printf("CreateSurface failed to create DirectFB surface interface!\n"); fflush(stdout); @@ -2996,14 +3120,16 @@ static void demo_run_directfb(struct demo *demo) { } } } -#elif defined(VK_USE_PLATFORM_ANDROID_KHR) +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) static void demo_run(struct demo *demo) { if (!demo->prepared) return; demo_draw(demo); demo->curFrame++; } -#elif defined(VK_USE_PLATFORM_METAL_EXT) +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) static void demo_run(struct demo *demo) { demo_draw(demo); demo->curFrame++; @@ -3011,7 +3137,8 @@ static void demo_run(struct demo *demo) { demo->quit = TRUE; } } -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) static VkResult demo_create_display_surface(struct demo *demo) { VkResult U_ASSERT_ONLY err; uint32_t display_count; @@ -3106,8 +3233,6 @@ static VkResult demo_create_display_surface(struct demo *demo) { exit(1); } - free(plane_props); - VkDisplayPlaneCapabilitiesKHR planeCaps; vkGetDisplayPlaneCapabilitiesKHR(demo->gpu, mode_props.displayMode, plane_index, &planeCaps); // Find a supported alpha mode @@ -3138,6 +3263,8 @@ static VkResult demo_create_display_surface(struct demo *demo) { create_info.globalAlpha = 1.0f; create_info.imageExtent = image_extent; + free(plane_props); + return vkCreateDisplayPlaneSurfaceKHR(demo->inst, &create_info, NULL, &demo->surface); } @@ -3151,7 +3278,8 @@ static void demo_run_display(struct demo *demo) { } } } -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) #include @@ -3257,7 +3385,7 @@ static void demo_run(struct demo *demo) { } } -static void demo_create_window(struct demo *demo) { +static void demo_create_screen_window(struct demo *demo) { const char *idstr = APP_SHORT_NAME; int size[2]; int usage = SCREEN_USAGE_VULKAN; @@ -3361,199 +3489,599 @@ int find_display_gpu(int gpu_number, uint32_t gpu_count, VkPhysicalDevice *physi return -1; } #endif -static void demo_init_vk(struct demo *demo) { - VkResult err; - uint32_t instance_extension_count = 0; - uint32_t instance_layer_count = 0; - char *instance_validation_layers[] = {"VK_LAYER_KHRONOS_validation"}; - demo->enabled_extension_count = 0; - demo->enabled_layer_count = 0; - demo->is_minimized = false; - demo->cmd_pool = VK_NULL_HANDLE; - err = volkInitialize(); - if (err != VK_SUCCESS) { - ERR_EXIT( - "Unable to find the Vulkan runtime on the system.\n\n" - "This likely indicates that no Vulkan capable drivers are installed.", - "Installation Failure"); - } - // Look for validation layers - VkBool32 validation_found = 0; - if (demo->validate) { - err = vkEnumerateInstanceLayerProperties(&instance_layer_count, NULL); - assert(!err); +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) +static void pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t sx, + wl_fixed_t sy) {} - if (instance_layer_count > 0) { - VkLayerProperties *instance_layers = malloc(sizeof(VkLayerProperties) * instance_layer_count); - err = vkEnumerateInstanceLayerProperties(&instance_layer_count, instance_layers); - assert(!err); +static void pointer_handle_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface) {} - validation_found = demo_check_layers(ARRAY_SIZE(instance_validation_layers), instance_validation_layers, - instance_layer_count, instance_layers); - if (validation_found) { - demo->enabled_layer_count = ARRAY_SIZE(instance_validation_layers); - demo->enabled_layers[0] = "VK_LAYER_KHRONOS_validation"; - } - free(instance_layers); - } +static void pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t sx, wl_fixed_t sy) {} - if (!validation_found) { - ERR_EXIT( - "vkEnumerateInstanceLayerProperties failed to find required validation layer.\n\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); - } +static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial, uint32_t time, uint32_t button, + uint32_t state) { + struct demo *demo = data; + if (button == BTN_LEFT && state == WL_POINTER_BUTTON_STATE_PRESSED) { + xdg_toplevel_move(demo->xdg_toplevel, demo->seat, serial); } +} - /* Look for instance extensions */ - VkBool32 surfaceExtFound = 0; - VkBool32 platformSurfaceExtFound = 0; - bool portabilityEnumerationActive = false; - memset(demo->extension_names, 0, sizeof(demo->extension_names)); +static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis, wl_fixed_t value) {} - err = vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, NULL); - assert(!err); +static const struct wl_pointer_listener pointer_listener = { + pointer_handle_enter, pointer_handle_leave, pointer_handle_motion, pointer_handle_button, pointer_handle_axis, +}; - if (instance_extension_count > 0) { - VkExtensionProperties *instance_extensions = malloc(sizeof(VkExtensionProperties) * instance_extension_count); - err = vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, instance_extensions); - assert(!err); - for (uint32_t i = 0; i < instance_extension_count; i++) { - if (!strcmp(VK_KHR_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - surfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = VK_KHR_SURFACE_EXTENSION_NAME; - } -#if defined(VK_USE_PLATFORM_WIN32_KHR) - if (!strcmp(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = VK_KHR_WIN32_SURFACE_EXTENSION_NAME; - } -#elif defined(VK_USE_PLATFORM_XLIB_KHR) - if (!strcmp(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = VK_KHR_XLIB_SURFACE_EXTENSION_NAME; - } -#elif defined(VK_USE_PLATFORM_XCB_KHR) - if (!strcmp(VK_KHR_XCB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = VK_KHR_XCB_SURFACE_EXTENSION_NAME; - } -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - if (!strcmp(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME; - } -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) - if (!strcmp(VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME; - } -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - if (!strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = VK_KHR_DISPLAY_EXTENSION_NAME; - } -#elif defined(VK_USE_PLATFORM_ANDROID_KHR) - if (!strcmp(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = VK_KHR_ANDROID_SURFACE_EXTENSION_NAME; - } -#elif defined(VK_USE_PLATFORM_METAL_EXT) - if (!strcmp(VK_EXT_METAL_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = VK_EXT_METAL_SURFACE_EXTENSION_NAME; - } -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) - if (!strcmp(VK_QNX_SCREEN_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = VK_QNX_SCREEN_SURFACE_EXTENSION_NAME; - } -#endif - if (!strcmp(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, instance_extensions[i].extensionName)) { - demo->extension_names[demo->enabled_extension_count++] = VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME; - } - if (!strcmp(VK_EXT_DEBUG_UTILS_EXTENSION_NAME, instance_extensions[i].extensionName)) { - if (demo->validate) { - demo->extension_names[demo->enabled_extension_count++] = VK_EXT_DEBUG_UTILS_EXTENSION_NAME; - } - } - // We want cube to be able to enumerate drivers that support the portability_subset extension, so we have to enable the - // portability enumeration extension. - if (!strcmp(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME, instance_extensions[i].extensionName)) { - portabilityEnumerationActive = true; - demo->extension_names[demo->enabled_extension_count++] = VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME; - } - assert(demo->enabled_extension_count < 64); - } +static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size) {} - free(instance_extensions); +static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, + struct wl_array *keys) {} + +static void keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface) {} + +static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, + uint32_t state) { + if (state != WL_KEYBOARD_KEY_STATE_RELEASED) return; + struct demo *demo = data; + switch (key) { + case KEY_ESC: // Escape + demo->quit = true; + break; + case KEY_LEFT: // left arrow key + demo->spin_angle -= demo->spin_increment; + break; + case KEY_RIGHT: // right arrow key + demo->spin_angle += demo->spin_increment; + break; + case KEY_SPACE: // space bar + demo->pause = !demo->pause; + break; } +} - if (!surfaceExtFound) { - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); +static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, + uint32_t mods_latched, uint32_t mods_locked, uint32_t group) {} + +static const struct wl_keyboard_listener keyboard_listener = { + keyboard_handle_keymap, keyboard_handle_enter, keyboard_handle_leave, keyboard_handle_key, keyboard_handle_modifiers, +}; + +static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) { + // Subscribe to pointer events + struct demo *demo = data; + if ((caps & WL_SEAT_CAPABILITY_POINTER) && !demo->pointer) { + demo->pointer = wl_seat_get_pointer(seat); + wl_pointer_add_listener(demo->pointer, &pointer_listener, demo); + } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && demo->pointer) { + wl_pointer_destroy(demo->pointer); + demo->pointer = NULL; } - if (!platformSurfaceExtFound) { -#if defined(VK_USE_PLATFORM_WIN32_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_WIN32_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_METAL_EXT) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_EXT_METAL_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_XCB_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XCB_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_DISPLAY_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_ANDROID_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_ANDROID_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_XLIB_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_QNX_SCREEN_SURFACE_EXTENSION_NAME + // Subscribe to keyboard events + if (caps & WL_SEAT_CAPABILITY_KEYBOARD) { + demo->keyboard = wl_seat_get_keyboard(seat); + wl_keyboard_add_listener(demo->keyboard, &keyboard_listener, demo); + } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && demo->keyboard) { + wl_keyboard_destroy(demo->keyboard); + demo->keyboard = NULL; + } +} + +static const struct wl_seat_listener seat_listener = { + seat_handle_capabilities, +}; + +static void wm_base_ping(void *data UNUSED, struct xdg_wm_base *xdg_wm_base, uint32_t serial) { + xdg_wm_base_pong(xdg_wm_base, serial); +} + +static const struct xdg_wm_base_listener wm_base_listener = {wm_base_ping}; + +static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, + uint32_t version UNUSED) { + struct demo *demo = data; + // pickup wayland objects when they appear + if (strcmp(interface, wl_compositor_interface.name) == 0) { + uint32_t minVersion = version < 4 ? version : 4; + demo->compositor = wl_registry_bind(registry, id, &wl_compositor_interface, minVersion); + if (demo->VK_KHR_incremental_present_enabled && minVersion < 4) { + fprintf(stderr, "Wayland compositor doesn't support VK_KHR_incremental_present, disabling.\n"); + demo->VK_KHR_incremental_present_enabled = false; + } + } else if (strcmp(interface, xdg_wm_base_interface.name) == 0) { + demo->xdg_wm_base = wl_registry_bind(registry, id, &xdg_wm_base_interface, 1); + xdg_wm_base_add_listener(demo->xdg_wm_base, &wm_base_listener, NULL); + } else if (strcmp(interface, wl_seat_interface.name) == 0) { + demo->seat = wl_registry_bind(registry, id, &wl_seat_interface, 1); + wl_seat_add_listener(demo->seat, &seat_listener, demo); + } else if (strcmp(interface, zxdg_decoration_manager_v1_interface.name) == 0) { + demo->xdg_decoration_mgr = wl_registry_bind(registry, id, &zxdg_decoration_manager_v1_interface, 1); + } +} + +static void registry_handle_global_remove(void *data UNUSED, struct wl_registry *registry UNUSED, uint32_t name UNUSED) {} + +static const struct wl_registry_listener registry_listener = {registry_handle_global, registry_handle_global_remove}; +#endif + +#if defined(VK_USE_PLATFORM_XCB_KHR) +static const char *demo_init_xcb_connection(struct demo *demo) { + demo->xcb_library = initialize_xcb(); + if (NULL == demo->xcb_library) { + return "Cannot load XCB dynamic library."; + } + + const xcb_setup_t *setup; + xcb_screen_iterator_t iter; + int scr; + + const char *display_envar = getenv("DISPLAY"); + if (display_envar == NULL || display_envar[0] == '\0') { + return "Environment variable DISPLAY requires a valid value.n"; + } + + demo->connection = xcb_connect(NULL, &scr); + if (xcb_connection_has_error(demo->connection) > 0) { + return "Cannot connect to XCB."; + } + + setup = xcb_get_setup(demo->connection); + iter = xcb_setup_roots_iterator(setup); + while (scr-- > 0) xcb_screen_next(&iter); + + demo->screen = iter.data; + return NULL; +} +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) +static const char *demo_init_xlib_connection(struct demo *demo) { + demo->xlib_library = initialize_xlib(); + if (NULL == demo->xlib_library) { + return "Cannot load XLIB dynamic library."; + } + return NULL; +} +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) +static const char *demo_init_wayland_connection(struct demo *demo) { + demo->wayland_library = initialize_wayland(); + if (NULL == demo->wayland_library) { + return "Cannot load wayland dynamic library."; + } + + demo->wayland_display = wl_display_connect(NULL); + + if (demo->wayland_display == NULL) { + return "Cannot connect to wayland."; + } + + demo->registry = wl_display_get_registry(demo->wayland_display); + wl_registry_add_listener(demo->registry, ®istry_listener, demo); + wl_display_roundtrip(demo->wayland_display); + return NULL; +} +#endif + +// Check that WSI platforms are available - only necessary when multiple WSI platforms exist, like on linux +// If the wsi_platform is AUTO, this function also sets wsi_platform to the first available WSI platform +// Otherwise, it errors out if the specified wsi_platform isn't available +static void demo_check_and_set_wsi_platform(struct demo *demo) { +#if defined(VK_USE_PLATFORM_XCB_KHR) + if (demo->wsi_platform == WSI_PLATFORM_XCB || demo->wsi_platform == WSI_PLATFORM_AUTO) { + bool xcb_extension_available = false; + for (uint32_t i = 0; i < demo->enabled_extension_count; i++) { + if (strcmp(demo->extension_names[i], VK_KHR_XCB_SURFACE_EXTENSION_NAME) == 0) { + xcb_extension_available = true; + break; + } + } + if (xcb_extension_available) { + const char *error_msg = demo_init_xcb_connection(demo); + if (error_msg != NULL) { + if (demo->wsi_platform == WSI_PLATFORM_XCB) { + fprintf(stderr, "%s\nExiting ...\n", error_msg); + fflush(stdout); + exit(1); + } + } else { + demo->wsi_platform = WSI_PLATFORM_XCB; + return; + } + } + } +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + if (demo->wsi_platform == WSI_PLATFORM_XLIB || demo->wsi_platform == WSI_PLATFORM_AUTO) { + bool xlib_extension_available = false; + for (uint32_t i = 0; i < demo->enabled_extension_count; i++) { + if (strcmp(demo->extension_names[i], VK_KHR_XLIB_SURFACE_EXTENSION_NAME) == 0) { + xlib_extension_available = true; + break; + } + } + if (xlib_extension_available) { + const char *error_msg = demo_init_xlib_connection(demo); + if (error_msg != NULL) { + if (demo->wsi_platform == WSI_PLATFORM_XLIB) { + fprintf(stderr, "%s\nExiting ...\n", error_msg); + fflush(stdout); + exit(1); + } + } else { + demo->wsi_platform = WSI_PLATFORM_XLIB; + return; + } + } + } +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + if (demo->wsi_platform == WSI_PLATFORM_WAYLAND || demo->wsi_platform == WSI_PLATFORM_AUTO) { + bool wayland_extension_available = false; + for (uint32_t i = 0; i < demo->enabled_extension_count; i++) { + if (strcmp(demo->extension_names[i], VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME) == 0) { + wayland_extension_available = true; + break; + } + } + if (wayland_extension_available) { + const char *error_msg = demo_init_wayland_connection(demo); + if (error_msg != NULL) { + if (demo->wsi_platform == WSI_PLATFORM_WAYLAND) { + fprintf(stderr, "%s\nExiting ...\n", error_msg); + fflush(stdout); + exit(1); + } + } else { + demo->wsi_platform = WSI_PLATFORM_WAYLAND; + return; + } + } + } +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (demo->wsi_platform == WSI_PLATFORM_DIRECTFB || demo->wsi_platform == WSI_PLATFORM_AUTO) { + bool direftfb_extension_available = false; + for (uint32_t i = 0; i < demo->enabled_extension_count; i++) { + if (strcmp(demo->extension_names[i], VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME) == 0) { + direftfb_extension_available = true; + break; + } + } + if (direftfb_extension_available) { + // Because DirectFB is still linked in, we can assume that it works if we got here + demo->wsi_platform = WSI_PLATFORM_DIRECTFB; + return; + } + } +#endif +#if defined(VK_USE_PLATFORM_WIN32_KHR) + if (demo->wsi_platform == WSI_PLATFORM_WIN32 || demo->wsi_platform == WSI_PLATFORM_AUTO) { + bool win32_extension_available = false; + for (uint32_t i = 0; i < demo->enabled_extension_count; i++) { + if (strcmp(demo->extension_names[i], VK_KHR_WIN32_SURFACE_EXTENSION_NAME) == 0) { + win32_extension_available = true; + break; + } + } + if (win32_extension_available) { + demo->wsi_platform = WSI_PLATFORM_WIN32; + return; + } + } +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + if (demo->wsi_platform == WSI_PLATFORM_METAL || demo->wsi_platform == WSI_PLATFORM_AUTO) { + bool metal_extension_available = false; + for (uint32_t i = 0; i < demo->enabled_extension_count; i++) { + if (strcmp(demo->extension_names[i], VK_EXT_METAL_SURFACE_EXTENSION_NAME) == 0) { + metal_extension_available = true; + break; + } + } + if (metal_extension_available) { + demo->wsi_platform = WSI_PLATFORM_METAL; + return; + } + } +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + if (demo->wsi_platform == WSI_PLATFORM_ANDROID || demo->wsi_platform == WSI_PLATFORM_AUTO) { + bool android_extension_available = false; + for (uint32_t i = 0; i < demo->enabled_extension_count; i++) { + if (strcmp(demo->extension_names[i], VK_KHR_ANDROID_SURFACE_EXTENSION_NAME) == 0) { + android_extension_available = true; + break; + } + } + if (android_extension_available) { + demo->wsi_platform = WSI_PLATFORM_ANDROID; + return; + } + } +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + if (demo->wsi_platform == WSI_PLATFORM_QNX || demo->wsi_platform == WSI_PLATFORM_AUTO) { + bool qnx_extension_available = false; + for (uint32_t i = 0; i < demo->enabled_extension_count; i++) { + if (strcmp(demo->extension_names[i], VK_QNX_SCREEN_SURFACE_EXTENSION_NAME) == 0) { + qnx_extension_available = true; + break; + } + } + if (qnx_extension_available) { + demo->wsi_platform = WSI_PLATFORM_ANDROID; + return; + } + } +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + if (demo->wsi_platform == WSI_PLATFORM_DISPLAY || demo->wsi_platform == WSI_PLATFORM_AUTO) { + bool display_extension_available = false; + for (uint32_t i = 0; i < demo->enabled_extension_count; i++) { + if (strcmp(demo->extension_names[i], VK_KHR_DISPLAY_EXTENSION_NAME) == 0) { + display_extension_available = true; + break; + } + } + if (display_extension_available) { + // Because DISPLAY doesn't require additional libraries, we can assume that it works if we got here + demo->wsi_platform = WSI_PLATFORM_DISPLAY; + return; + } + } +#endif +} + +static void demo_init_vk(struct demo *demo) { + VkResult err; + uint32_t instance_extension_count = 0; + uint32_t instance_layer_count = 0; + char *instance_validation_layers[] = {"VK_LAYER_KHRONOS_validation"}; + demo->enabled_extension_count = 0; + demo->enabled_layer_count = 0; + demo->is_minimized = false; + demo->cmd_pool = VK_NULL_HANDLE; + + err = volkInitialize(); + if (err != VK_SUCCESS) { + ERR_EXIT( + "Unable to find the Vulkan runtime on the system.\n\n" + "This likely indicates that no Vulkan capable drivers are installed.", + "Installation Failure"); + } + // Look for validation layers + VkBool32 validation_found = 0; + if (demo->validate) { + err = vkEnumerateInstanceLayerProperties(&instance_layer_count, NULL); + assert(!err); + + if (instance_layer_count > 0) { + VkLayerProperties *instance_layers = malloc(sizeof(VkLayerProperties) * instance_layer_count); + err = vkEnumerateInstanceLayerProperties(&instance_layer_count, instance_layers); + assert(!err); + + validation_found = demo_check_layers(ARRAY_SIZE(instance_validation_layers), instance_validation_layers, + instance_layer_count, instance_layers); + if (validation_found) { + demo->enabled_layer_count = ARRAY_SIZE(instance_validation_layers); + demo->enabled_layers[0] = "VK_LAYER_KHRONOS_validation"; + } + free(instance_layers); + } + + if (!validation_found) { + ERR_EXIT( + "vkEnumerateInstanceLayerProperties failed to find required validation layer.\n\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } + } + + /* Look for instance extensions */ + VkBool32 surfaceExtFound = false; + VkBool32 platformSurfaceExtFound = false; + bool portabilityEnumerationActive = false; + memset(demo->extension_names, 0, sizeof(demo->extension_names)); + + err = vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, NULL); + assert(!err); + + if (instance_extension_count > 0) { + VkExtensionProperties *instance_extensions = malloc(sizeof(VkExtensionProperties) * instance_extension_count); + err = vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, instance_extensions); + assert(!err); + for (uint32_t i = 0; i < instance_extension_count; i++) { + if (!strcmp(VK_KHR_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { + surfaceExtFound = true; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_SURFACE_EXTENSION_NAME; + } +#if defined(VK_USE_PLATFORM_WIN32_KHR) + if (!strcmp(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName) && + (demo->wsi_platform == WSI_PLATFORM_AUTO || demo->wsi_platform == WSI_PLATFORM_WIN32)) { + platformSurfaceExtFound = true; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_WIN32_SURFACE_EXTENSION_NAME; + } +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + if (!strcmp(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName) && + (demo->wsi_platform == WSI_PLATFORM_AUTO || demo->wsi_platform == WSI_PLATFORM_XLIB)) { + platformSurfaceExtFound = true; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_XLIB_SURFACE_EXTENSION_NAME; + } +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + if (!strcmp(VK_KHR_XCB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName) && + (demo->wsi_platform == WSI_PLATFORM_AUTO || demo->wsi_platform == WSI_PLATFORM_XCB)) { + platformSurfaceExtFound = true; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_XCB_SURFACE_EXTENSION_NAME; + } +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + if (!strcmp(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName) && + (demo->wsi_platform == WSI_PLATFORM_AUTO || demo->wsi_platform == WSI_PLATFORM_WAYLAND)) { + platformSurfaceExtFound = true; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME; + } +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (!strcmp(VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName) && + (demo->wsi_platform == WSI_PLATFORM_AUTO || demo->wsi_platform == WSI_PLATFORM_DIRECTFB)) { + platformSurfaceExtFound = true; + demo->extension_names[demo->enabled_extension_count++] = VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME; + } +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + if (!strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, instance_extensions[i].extensionName) && + (demo->wsi_platform == WSI_PLATFORM_AUTO || demo->wsi_platform == WSI_PLATFORM_DISPLAY)) { + platformSurfaceExtFound = true; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_DISPLAY_EXTENSION_NAME; + } +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + if (!strcmp(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName) && + (demo->wsi_platform == WSI_PLATFORM_AUTO || demo->wsi_platform == WSI_PLATFORM_ANDROID)) { + platformSurfaceExtFound = true; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_ANDROID_SURFACE_EXTENSION_NAME; + } +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + if (!strcmp(VK_EXT_METAL_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName) && + (demo->wsi_platform == WSI_PLATFORM_AUTO || demo->wsi_platform == WSI_PLATFORM_METAL)) { + platformSurfaceExtFound = true; + demo->extension_names[demo->enabled_extension_count++] = VK_EXT_METAL_SURFACE_EXTENSION_NAME; + } +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + if (!strcmp(VK_QNX_SCREEN_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName) && + (demo->wsi_platform == WSI_PLATFORM_AUTO || demo->wsi_platform == WSI_PLATFORM_QNX)) { + platformSurfaceExtFound = true; + demo->extension_names[demo->enabled_extension_count++] = VK_QNX_SCREEN_SURFACE_EXTENSION_NAME; + } +#endif + if (!strcmp(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, instance_extensions[i].extensionName)) { + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME; + } + if (!strcmp(VK_EXT_DEBUG_UTILS_EXTENSION_NAME, instance_extensions[i].extensionName)) { + if (demo->validate) { + demo->extension_names[demo->enabled_extension_count++] = VK_EXT_DEBUG_UTILS_EXTENSION_NAME; + } + } + // We want cube to be able to enumerate drivers that support the portability_subset extension, so we have to enable + // the portability enumeration extension. + if (!strcmp(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME, instance_extensions[i].extensionName)) { + portabilityEnumerationActive = true; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME; + } + assert(demo->enabled_extension_count < 64); + } + + free(instance_extensions); + } + + if (!surfaceExtFound) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_SURFACE_EXTENSION_NAME " extension.\n\n" "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" "Please look at the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); + } + if (!platformSurfaceExtFound) { +#if defined(VK_USE_PLATFORM_WIN32_KHR) + if (demo->wsi_platform == WSI_PLATFORM_WIN32) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_WIN32_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + if (demo->wsi_platform == WSI_PLATFORM_METAL) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_EXT_METAL_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + if (demo->wsi_platform == WSI_PLATFORM_XCB) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XCB_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + if (demo->wsi_platform == WSI_PLATFORM_WAYLAND) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + if (demo->wsi_platform == WSI_PLATFORM_DISPLAY) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_DISPLAY_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + if (demo->wsi_platform == WSI_PLATFORM_ANDROID) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_ANDROID_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + if (demo->wsi_platform == WSI_PLATFORM_XLIB) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } #endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (demo->wsi_platform == WSI_PLATFORM_DIRECTFB) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + if (demo->wsi_platform == WSI_PLATFORM_WIN32) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_QNX_SCREEN_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif + ERR_EXIT( + "vkEnumerateInstanceExtensionProperties failed to find any supported WSI surface extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } + + bool auto_wsi_platform = demo->wsi_platform == WSI_PLATFORM_AUTO; + + demo_check_and_set_wsi_platform(demo); + + // Print a message to indicate the automatically set WSI platform + if (auto_wsi_platform && demo->wsi_platform != WSI_PLATFORM_AUTO) { + fprintf(stderr, "Selected WSI platform: %s\n", wsi_to_string(demo->wsi_platform)); } + const VkApplicationInfo app = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pNext = NULL, @@ -3615,7 +4143,10 @@ static void demo_init_vk(struct demo *demo) { } volkLoadInstance(demo->inst); +} +static void demo_select_physical_device(struct demo *demo) { + VkResult err; /* Make initial call to query gpu_count, then second call for gpu info */ uint32_t gpu_count = 0; err = vkEnumeratePhysicalDevices(demo->inst, &gpu_count, NULL); @@ -3637,48 +4168,63 @@ static void demo_init_vk(struct demo *demo) { ERR_EXIT("Specified GPU number is not present", "User Error"); } + if (demo->wsi_platform == WSI_PLATFORM_DISPLAY) { #if defined(VK_USE_PLATFORM_DISPLAY_KHR) - demo->gpu_number = find_display_gpu(demo->gpu_number, gpu_count, physical_devices); - if (demo->gpu_number < 0) { - printf("Cannot find any display!\n"); + demo->gpu_number = find_display_gpu(demo->gpu_number, gpu_count, physical_devices); + if (demo->gpu_number < 0) { + printf("Cannot find any display!\n"); + fflush(stdout); + exit(1); + } +#else + printf("WSI selection was set to DISPLAY but vkcube was not compiled with support for the DISPLAY platform, exiting \n"); fflush(stdout); exit(1); - } -#else - /* Try to auto select most suitable device */ - if (demo->gpu_number == -1) { - uint32_t count_device_type[VK_PHYSICAL_DEVICE_TYPE_CPU + 1]; - memset(count_device_type, 0, sizeof(count_device_type)); - - VkPhysicalDeviceProperties physicalDeviceProperties; - for (uint32_t i = 0; i < gpu_count; i++) { - vkGetPhysicalDeviceProperties(physical_devices[i], &physicalDeviceProperties); - assert(physicalDeviceProperties.deviceType <= VK_PHYSICAL_DEVICE_TYPE_CPU); - count_device_type[physicalDeviceProperties.deviceType]++; - } - - VkPhysicalDeviceType search_for_device_type = VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU; - if (count_device_type[VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU]) { - search_for_device_type = VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU; - } else if (count_device_type[VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU]) { - search_for_device_type = VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU; - } else if (count_device_type[VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU]) { - search_for_device_type = VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU; - } else if (count_device_type[VK_PHYSICAL_DEVICE_TYPE_CPU]) { - search_for_device_type = VK_PHYSICAL_DEVICE_TYPE_CPU; - } else if (count_device_type[VK_PHYSICAL_DEVICE_TYPE_OTHER]) { - search_for_device_type = VK_PHYSICAL_DEVICE_TYPE_OTHER; - } +#endif + } else { + /* Try to auto select most suitable device */ + if (demo->gpu_number == -1) { + VkPhysicalDeviceProperties physicalDeviceProperties; + int prev_priority = 0; + for (uint32_t i = 0; i < gpu_count; i++) { + vkGetPhysicalDeviceProperties(physical_devices[i], &physicalDeviceProperties); + assert(physicalDeviceProperties.deviceType <= VK_PHYSICAL_DEVICE_TYPE_CPU); + + // Continue next gpu if this gpu does not support the surface. + VkBool32 supported = VK_FALSE; + VkResult result = vkGetPhysicalDeviceSurfaceSupportKHR(physical_devices[i], 0, demo->surface, &supported); + if (result != VK_SUCCESS || !supported) continue; + + int priority = 0; + switch (physicalDeviceProperties.deviceType) { + case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU: + priority = 5; + break; + case VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU: + priority = 4; + break; + case VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU: + priority = 3; + break; + case VK_PHYSICAL_DEVICE_TYPE_CPU: + priority = 2; + break; + case VK_PHYSICAL_DEVICE_TYPE_OTHER: + priority = 1; + break; + default: + priority = -1; + break; + } - for (uint32_t i = 0; i < gpu_count; i++) { - vkGetPhysicalDeviceProperties(physical_devices[i], &physicalDeviceProperties); - if (physicalDeviceProperties.deviceType == search_for_device_type) { - demo->gpu_number = i; - break; + if (priority > prev_priority) { + demo->gpu_number = i; + prev_priority = priority; + } } } } -#endif + assert(demo->gpu_number >= 0); demo->gpu = physical_devices[demo->gpu_number]; { @@ -3763,6 +4309,24 @@ static void demo_init_vk(struct demo *demo) { } if (demo->validate) { + /* + * This is info for a temp callback to use during CreateInstance. + * After the instance is created, we use the instance-based + * function to register the final callback. + */ + VkDebugUtilsMessengerCreateInfoEXT dbg_messenger_create_info; + // VK_EXT_debug_utils style + dbg_messenger_create_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT; + dbg_messenger_create_info.pNext = NULL; + dbg_messenger_create_info.flags = 0; + dbg_messenger_create_info.messageSeverity = + VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; + dbg_messenger_create_info.messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT | + VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT | + VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT; + dbg_messenger_create_info.pfnUserCallback = debug_messenger_callback; + dbg_messenger_create_info.pUserData = demo; + err = vkCreateDebugUtilsMessengerEXT(demo->inst, &dbg_messenger_create_info, NULL, &demo->dbg_messenger); switch (err) { case VK_SUCCESS: @@ -3822,88 +4386,115 @@ static void demo_create_device(struct demo *demo) { queues[1].flags = 0; device.queueCreateInfoCount = 2; } - err = vkCreateDevice(demo->gpu, &device, NULL, &demo->device); - assert(!err); + err = vkCreateDevice(demo->gpu, &device, NULL, &demo->device); + assert(!err); + + volkLoadDevice(demo->device); +} + +static void demo_create_surface(struct demo *demo) { + VkResult U_ASSERT_ONLY err = VK_SUCCESS; + +// Create a WSI surface for the window: +#if defined(VK_USE_PLATFORM_WIN32_KHR) + if (demo->wsi_platform == WSI_PLATFORM_WIN32) { + VkWin32SurfaceCreateInfoKHR win32_createInfo; + win32_createInfo.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; + win32_createInfo.pNext = NULL; + win32_createInfo.flags = 0; + win32_createInfo.hinstance = demo->connection; + win32_createInfo.hwnd = demo->window; + + err = vkCreateWin32SurfaceKHR(demo->inst, &win32_createInfo, NULL, &demo->surface); + } +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + if (demo->wsi_platform == WSI_PLATFORM_WAYLAND) { + VkWaylandSurfaceCreateInfoKHR wayland_createInfo; + wayland_createInfo.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR; + wayland_createInfo.pNext = NULL; + wayland_createInfo.flags = 0; + wayland_createInfo.display = demo->wayland_display; + wayland_createInfo.surface = demo->window; + + err = vkCreateWaylandSurfaceKHR(demo->inst, &wayland_createInfo, NULL, &demo->surface); + } +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + if (demo->wsi_platform == WSI_PLATFORM_ANDROID) { + VkAndroidSurfaceCreateInfoKHR android_createInfo; + android_createInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR; + android_createInfo.pNext = NULL; + android_createInfo.flags = 0; + android_createInfo.window = (struct ANativeWindow *)(demo->window); - volkLoadDevice(demo->device); -} + err = vkCreateAndroidSurfaceKHR(demo->inst, &android_createInfo, NULL, &demo->surface); + } +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + if (demo->wsi_platform == WSI_PLATFORM_XLIB) { + VkXlibSurfaceCreateInfoKHR xlib_createInfo; + xlib_createInfo.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR; + xlib_createInfo.pNext = NULL; + xlib_createInfo.flags = 0; + xlib_createInfo.dpy = demo->xlib_display; + xlib_createInfo.window = demo->xlib_window; -static void demo_create_surface(struct demo *demo) { - VkResult U_ASSERT_ONLY err; + err = vkCreateXlibSurfaceKHR(demo->inst, &xlib_createInfo, NULL, &demo->surface); + } +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + if (demo->wsi_platform == WSI_PLATFORM_XCB) { + VkXcbSurfaceCreateInfoKHR xcb_createInfo; + xcb_createInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; + xcb_createInfo.pNext = NULL; + xcb_createInfo.flags = 0; + xcb_createInfo.connection = demo->connection; + xcb_createInfo.window = demo->xcb_window; -// Create a WSI surface for the window: -#if defined(VK_USE_PLATFORM_WIN32_KHR) - VkWin32SurfaceCreateInfoKHR createInfo; - createInfo.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; - createInfo.pNext = NULL; - createInfo.flags = 0; - createInfo.hinstance = demo->connection; - createInfo.hwnd = demo->window; - - err = vkCreateWin32SurfaceKHR(demo->inst, &createInfo, NULL, &demo->surface); -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - VkWaylandSurfaceCreateInfoKHR createInfo; - createInfo.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR; - createInfo.pNext = NULL; - createInfo.flags = 0; - createInfo.display = demo->display; - createInfo.surface = demo->window; - - err = vkCreateWaylandSurfaceKHR(demo->inst, &createInfo, NULL, &demo->surface); -#elif defined(VK_USE_PLATFORM_ANDROID_KHR) - VkAndroidSurfaceCreateInfoKHR createInfo; - createInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR; - createInfo.pNext = NULL; - createInfo.flags = 0; - createInfo.window = (struct ANativeWindow *)(demo->window); - - err = vkCreateAndroidSurfaceKHR(demo->inst, &createInfo, NULL, &demo->surface); -#elif defined(VK_USE_PLATFORM_XLIB_KHR) - VkXlibSurfaceCreateInfoKHR createInfo; - createInfo.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR; - createInfo.pNext = NULL; - createInfo.flags = 0; - createInfo.dpy = demo->display; - createInfo.window = demo->xlib_window; - - err = vkCreateXlibSurfaceKHR(demo->inst, &createInfo, NULL, &demo->surface); -#elif defined(VK_USE_PLATFORM_XCB_KHR) - VkXcbSurfaceCreateInfoKHR createInfo; - createInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; - createInfo.pNext = NULL; - createInfo.flags = 0; - createInfo.connection = demo->connection; - createInfo.window = demo->xcb_window; - - err = vkCreateXcbSurfaceKHR(demo->inst, &createInfo, NULL, &demo->surface); -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) - VkDirectFBSurfaceCreateInfoEXT createInfo; - createInfo.sType = VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT; - createInfo.pNext = NULL; - createInfo.flags = 0; - createInfo.dfb = demo->dfb; - createInfo.surface = demo->window; - - err = vkCreateDirectFBSurfaceEXT(demo->inst, &createInfo, NULL, &demo->surface); -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - err = demo_create_display_surface(demo); -#elif defined(VK_USE_PLATFORM_METAL_EXT) - VkMetalSurfaceCreateInfoEXT surface; - surface.sType = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT; - surface.pNext = NULL; - surface.flags = 0; - surface.pLayer = demo->caMetalLayer; - - err = vkCreateMetalSurfaceEXT(demo->inst, &surface, NULL, &demo->surface); -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) - VkScreenSurfaceCreateInfoQNX createInfo; - createInfo.sType = VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX; - createInfo.pNext = NULL; - createInfo.flags = 0; - createInfo.context = demo->screen_context; - createInfo.window = demo->screen_window; - - err = vkCreateScreenSurfaceQNX(demo->inst, &createInfo, NULL, &demo->surface); + err = vkCreateXcbSurfaceKHR(demo->inst, &xcb_createInfo, NULL, &demo->surface); + } +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (demo->wsi_platform == WSI_PLATFORM_DIRECTFB) { + VkDirectFBSurfaceCreateInfoEXT directfb_createInfo; + directfb_createInfo.sType = VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT; + directfb_createInfo.pNext = NULL; + directfb_createInfo.flags = 0; + directfb_createInfo.dfb = demo->dfb; + directfb_createInfo.surface = demo->directfb_window; + + err = vkCreateDirectFBSurfaceEXT(demo->inst, &directfb_createInfo, NULL, &demo->surface); + } + +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + if (demo->wsi_platform == WSI_PLATFORM_DISPLAY) { + err = demo_create_display_surface(demo); + } +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + if (demo->wsi_platform == WSI_PLATFORM_METAL) { + VkMetalSurfaceCreateInfoEXT metal_createInfo; + metal_createInfo.sType = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT; + metal_createInfo.pNext = NULL; + metal_createInfo.flags = 0; + metal_createInfo.pLayer = demo->caMetalLayer; + + err = vkCreateMetalSurfaceEXT(demo->inst, &metal_createInfo, NULL, &demo->surface); + } +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + if (demo->wsi_platform == WSI_PLATFORM_QNX) { + VkScreenSurfaceCreateInfoQNX qnx_createInfo; + qnx_createInfo.sType = VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX; + qnx_createInfo.pNext = NULL; + qnx_createInfo.flags = 0; + qnx_createInfo.context = demo->screen_context; + qnx_createInfo.window = demo->screen_window; + + err = vkCreateScreenSurfaceQNX(demo->inst, &qnx_createInfo, NULL, &demo->surface); + } #endif assert(!err); } @@ -3930,8 +4521,6 @@ static VkSurfaceFormatKHR pick_surface_format(const VkSurfaceFormatKHR *surfaceF static void demo_init_vk_swapchain(struct demo *demo) { VkResult U_ASSERT_ONLY err; - demo_create_surface(demo); - // Iterate over each queue to learn whether it supports presenting: VkBool32 *supportsPresent = (VkBool32 *)malloc(demo->queue_family_count * sizeof(VkBool32)); for (uint32_t i = 0; i < demo->queue_family_count; i++) { @@ -4039,159 +4628,6 @@ static void demo_init_vk_swapchain(struct demo *demo) { vkGetPhysicalDeviceMemoryProperties(demo->gpu, &demo->memory_properties); } -#if defined(VK_USE_PLATFORM_WAYLAND_KHR) -static void pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t sx, - wl_fixed_t sy) {} - -static void pointer_handle_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface) {} - -static void pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t sx, wl_fixed_t sy) {} - -static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial, uint32_t time, uint32_t button, - uint32_t state) { - struct demo *demo = data; - if (button == BTN_LEFT && state == WL_POINTER_BUTTON_STATE_PRESSED) { - xdg_toplevel_move(demo->xdg_toplevel, demo->seat, serial); - } -} - -static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis, wl_fixed_t value) {} - -static const struct wl_pointer_listener pointer_listener = { - pointer_handle_enter, pointer_handle_leave, pointer_handle_motion, pointer_handle_button, pointer_handle_axis, -}; - -static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size) {} - -static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, - struct wl_array *keys) {} - -static void keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface) {} - -static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, - uint32_t state) { - if (state != WL_KEYBOARD_KEY_STATE_RELEASED) return; - struct demo *demo = data; - switch (key) { - case KEY_ESC: // Escape - demo->quit = true; - break; - case KEY_LEFT: // left arrow key - demo->spin_angle -= demo->spin_increment; - break; - case KEY_RIGHT: // right arrow key - demo->spin_angle += demo->spin_increment; - break; - case KEY_SPACE: // space bar - demo->pause = !demo->pause; - break; - } -} - -static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, - uint32_t mods_latched, uint32_t mods_locked, uint32_t group) {} - -static const struct wl_keyboard_listener keyboard_listener = { - keyboard_handle_keymap, keyboard_handle_enter, keyboard_handle_leave, keyboard_handle_key, keyboard_handle_modifiers, -}; - -static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) { - // Subscribe to pointer events - struct demo *demo = data; - if ((caps & WL_SEAT_CAPABILITY_POINTER) && !demo->pointer) { - demo->pointer = wl_seat_get_pointer(seat); - wl_pointer_add_listener(demo->pointer, &pointer_listener, demo); - } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && demo->pointer) { - wl_pointer_destroy(demo->pointer); - demo->pointer = NULL; - } - // Subscribe to keyboard events - if (caps & WL_SEAT_CAPABILITY_KEYBOARD) { - demo->keyboard = wl_seat_get_keyboard(seat); - wl_keyboard_add_listener(demo->keyboard, &keyboard_listener, demo); - } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && demo->keyboard) { - wl_keyboard_destroy(demo->keyboard); - demo->keyboard = NULL; - } -} - -static const struct wl_seat_listener seat_listener = { - seat_handle_capabilities, -}; - -static void wm_base_ping(void *data UNUSED, struct xdg_wm_base *xdg_wm_base, uint32_t serial) { - xdg_wm_base_pong(xdg_wm_base, serial); -} - -static const struct xdg_wm_base_listener wm_base_listener = {wm_base_ping}; - -static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, - uint32_t version UNUSED) { - struct demo *demo = data; - // pickup wayland objects when they appear - if (strcmp(interface, wl_compositor_interface.name) == 0) { - uint32_t minVersion = version < 4 ? version : 4; - demo->compositor = wl_registry_bind(registry, id, &wl_compositor_interface, minVersion); - if (demo->VK_KHR_incremental_present_enabled && minVersion < 4) { - fprintf(stderr, "Wayland compositor doesn't support VK_KHR_incremental_present, disabling.\n"); - demo->VK_KHR_incremental_present_enabled = false; - } - } else if (strcmp(interface, xdg_wm_base_interface.name) == 0) { - demo->xdg_wm_base = wl_registry_bind(registry, id, &xdg_wm_base_interface, 1); - xdg_wm_base_add_listener(demo->xdg_wm_base, &wm_base_listener, NULL); - } else if (strcmp(interface, wl_seat_interface.name) == 0) { - demo->seat = wl_registry_bind(registry, id, &wl_seat_interface, 1); - wl_seat_add_listener(demo->seat, &seat_listener, demo); - } else if (strcmp(interface, zxdg_decoration_manager_v1_interface.name) == 0) { - demo->xdg_decoration_mgr = wl_registry_bind(registry, id, &zxdg_decoration_manager_v1_interface, 1); - } -} - -static void registry_handle_global_remove(void *data UNUSED, struct wl_registry *registry UNUSED, uint32_t name UNUSED) {} - -static const struct wl_registry_listener registry_listener = {registry_handle_global, registry_handle_global_remove}; -#endif - -static void demo_init_connection(struct demo *demo) { -#if defined(VK_USE_PLATFORM_XCB_KHR) - const xcb_setup_t *setup; - xcb_screen_iterator_t iter; - int scr; - - const char *display_envar = getenv("DISPLAY"); - if (display_envar == NULL || display_envar[0] == '\0') { - printf("Environment variable DISPLAY requires a valid value.\nExiting ...\n"); - fflush(stdout); - exit(1); - } - - demo->connection = xcb_connect(NULL, &scr); - if (xcb_connection_has_error(demo->connection) > 0) { - printf("Cannot connect to XCB.\nExiting ...\n"); - fflush(stdout); - exit(1); - } - - setup = xcb_get_setup(demo->connection); - iter = xcb_setup_roots_iterator(setup); - while (scr-- > 0) xcb_screen_next(&iter); - - demo->screen = iter.data; -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - demo->display = wl_display_connect(NULL); - - if (demo->display == NULL) { - printf("Cannot connect to wayland.\nExiting ...\n"); - fflush(stdout); - exit(1); - } - - demo->registry = wl_display_get_registry(demo->display); - wl_registry_add_listener(demo->registry, ®istry_listener, demo); - wl_display_roundtrip(demo->display); -#endif -} - static void demo_init(struct demo *demo, int argc, char **argv) { vec3 eye = {0.0f, 3.0f, 5.0f}; vec3 origin = {0, 0, 0}; @@ -4223,13 +4659,8 @@ static void demo_init(struct demo *demo, int argc, char **argv) { demo->validate = true; continue; } - if (strcmp(argv[i], "--validate-checks-disabled") == 0) { - demo->validate = true; - demo->validate_checks_disabled = true; - continue; - } if (strcmp(argv[i], "--xlib") == 0) { - fprintf(stderr, "--xlib is deprecated and no longer does anything"); + fprintf(stderr, "--xlib is deprecated and no longer does anything\n"); continue; } if (strcmp(argv[i], "--c") == 0 && demo->frameCount == INT32_MAX && i < argc - 1 && @@ -4281,31 +4712,107 @@ static void demo_init(struct demo *demo, int argc, char **argv) { demo->force_errors = true; continue; } - + if ((strcmp(argv[i], "--wsi") == 0) && (i < argc - 1)) { + size_t argc_len = strlen(argv[i + 1]); + for (size_t argc_i = 0; argc_i < argc_len; argc_i++) { + argv[i + 1][argc_i] = tolower(argv[i + 1][argc_i]); + } + WSI_PLATFORM selection = wsi_from_string(argv[i + 1]); + if (selection == WSI_PLATFORM_INVALID) { + printf( + "The --wsi parameter %s is not a supported WSI platform. The list of available platforms is available from " + "--help\n", + (const char *)&(argv[i + 1][0])); + fflush(stdout); + exit(1); + } + demo->wsi_platform = selection; + i++; + continue; + } #if defined(ANDROID) ERR_EXIT("Usage: vkcube [--validate]\n", "Usage"); #else + + // Making the help for --wsi nice requires a little extra work since the list depends on what is available at + // compile time + size_t max_str_len = 100; + char *available_wsi_platforms = (char *)malloc(max_str_len); + memset(available_wsi_platforms, 0, max_str_len); +#if defined(VK_USE_PLATFORM_XCB_KHR) + strncat(available_wsi_platforms, "xcb", max_str_len); +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + if (strlen(available_wsi_platforms) > 0) { + strncat(available_wsi_platforms, "|", max_str_len); + } + strncat(available_wsi_platforms, "xlib", max_str_len); +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + if (strlen(available_wsi_platforms) > 0) { + strncat(available_wsi_platforms, "|", max_str_len); + } + strncat(available_wsi_platforms, "wayland", max_str_len); +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (strlen(available_wsi_platforms) > 0) { + strncat(available_wsi_platforms, "|", max_str_len); + } + strncat(available_wsi_platforms, "directfb", max_str_len); +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + if (strlen(available_wsi_platforms) > 0) { + strncat(available_wsi_platforms, "|", max_str_len); + } + strncat(available_wsi_platforms, "display", max_str_len); +#endif +#if defined(VK_USE_PLATFORM_WIN32_KHR) + if (strlen(available_wsi_platforms) > 0) { + strncat(available_wsi_platforms, "|", max_str_len); + } + strncat(available_wsi_platforms, "win32", max_str_len); +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + if (strlen(available_wsi_platforms) > 0) { + strncat(available_wsi_platforms, "|", max_str_len); + } + strncat(available_wsi_platforms, "android", max_str_len); +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + if (strlen(available_wsi_platforms) > 0) { + strncat(available_wsi_platforms, "|", max_str_len); + } + strncat(available_wsi_platforms, "metal", max_str_len); +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + if (strlen(available_wsi_platforms) > 0) { + strncat(available_wsi_platforms, "|", max_str_len); + } + strncat(available_wsi_platforms, "qnx", max_str_len); +#endif + char *message = - "Usage:\n %s\t[--use_staging] [--validate] [--validate-checks-disabled]\n" + "Usage:\n %s\t[--use_staging] [--validate]\n" "\t[--break] [--c ] [--suppress_popups]\n" "\t[--incremental_present] [--display_timing]\n" "\t[--gpu_number ]\n" "\t[--present_mode ]\n" "\t[--width ] [--height ]\n" "\t[--force_errors]\n" + "\t[--wsi <%s>]\n" "\t\n" "\t\tVK_PRESENT_MODE_IMMEDIATE_KHR = %d\n" "\t\tVK_PRESENT_MODE_MAILBOX_KHR = %d\n" "\t\tVK_PRESENT_MODE_FIFO_KHR = %d\n" "\t\tVK_PRESENT_MODE_FIFO_RELAXED_KHR = %d\n"; - int length = snprintf(NULL, 0, message, APP_SHORT_NAME, VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_MAILBOX_KHR, - VK_PRESENT_MODE_FIFO_KHR, VK_PRESENT_MODE_FIFO_RELAXED_KHR); + int length = snprintf(NULL, 0, message, APP_SHORT_NAME, available_wsi_platforms, VK_PRESENT_MODE_IMMEDIATE_KHR, + VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_FIFO_KHR, VK_PRESENT_MODE_FIFO_RELAXED_KHR); char *usage = (char *)malloc(length + 1); if (!usage) { exit(1); } - snprintf(usage, length + 1, message, APP_SHORT_NAME, VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_MAILBOX_KHR, - VK_PRESENT_MODE_FIFO_KHR, VK_PRESENT_MODE_FIFO_RELAXED_KHR); + snprintf(usage, length + 1, message, APP_SHORT_NAME, available_wsi_platforms, VK_PRESENT_MODE_IMMEDIATE_KHR, + VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_FIFO_KHR, VK_PRESENT_MODE_FIFO_RELAXED_KHR); #if defined(_WIN32) if (!demo->suppress_popups) MessageBox(NULL, usage, "Usage Error", MB_OK); #else @@ -4317,8 +4824,6 @@ static void demo_init(struct demo *demo, int argc, char **argv) { #endif } - demo_init_connection(demo); - demo_init_vk(demo); demo->spin_angle = 4.0f; @@ -4390,6 +4895,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLine, demo.connection = hInstance; strncpy(demo.name, "Vulkan Cube", APP_NAME_STR_LEN); demo_create_window(&demo); + demo_create_surface(&demo); + demo_select_physical_device(&demo); demo_init_vk_swapchain(&demo); demo_prepare(&demo); @@ -4424,16 +4931,20 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLine, return (int)msg.wParam; } -#elif defined(VK_USE_PLATFORM_METAL_EXT) +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) static void demo_main(struct demo *demo, void *caMetalLayer, int argc, const char *argv[]) { demo_init(demo, argc, (char **)argv); demo->caMetalLayer = caMetalLayer; + demo_create_surface(demo); + demo_select_physical_device(demo); demo_init_vk_swapchain(demo); demo_prepare(demo); demo->spin_angle = 0.4f; } -#elif defined(VK_USE_PLATFORM_ANDROID_KHR) +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) #include #include #include "android_util.h" @@ -4479,6 +4990,8 @@ static void processCommand(struct android_app *app, int32_t cmd) { for (int i = 0; i < argc; i++) free(argv[i]); demo.window = (void *)app->window; + demo_create_surface(&demo); + demo_select_physical_device(&demo); demo_init_vk_swapchain(&demo); demo_prepare(&demo); initialized = true; @@ -4520,40 +5033,96 @@ void android_main(struct android_app *app) { } } } -#else +#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__QNX__) || defined(__GNU__) int main(int argc, char **argv) { struct demo demo; demo_init(&demo, argc, argv); + switch (demo.wsi_platform) { + default: + case (WSI_PLATFORM_AUTO): + fprintf(stderr, + "WSI platform should have already been set, indicating a bug. Please set a WSI platform manually with " + "--wsi\n"); + exit(1); + break; #if defined(VK_USE_PLATFORM_XCB_KHR) - demo_create_xcb_window(&demo); -#elif defined(VK_USE_PLATFORM_XLIB_KHR) - demo_create_xlib_window(&demo); -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - demo_create_window(&demo); -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) - demo_create_directfb_window(&demo); -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) - demo_create_window(&demo); + case (WSI_PLATFORM_XCB): + demo_create_xcb_window(&demo); + break; +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + case (WSI_PLATFORM_XLIB): + demo_create_xlib_window(&demo); + break; +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + case (WSI_PLATFORM_WAYLAND): + demo_create_wayland_window(&demo); + break; +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + case (WSI_PLATFORM_DIRECTFB): + demo_create_directfb_window(&demo); + break; +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + case (WSI_PLATFORM_QNX): + demo_create_screen_window(&demo); + break; #endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + case (WSI_PLATFORM_DISPLAY): + // nothing to do here + break; +#endif + } + demo_create_surface(&demo); + demo_select_physical_device(&demo); demo_init_vk_swapchain(&demo); demo_prepare(&demo); + switch (demo.wsi_platform) { + default: + case (WSI_PLATFORM_AUTO): + fprintf(stderr, + "WSI platform should have already been set, indicating a bug. Please set a WSI platform manually with " + "--wsi\n"); + exit(1); + break; #if defined(VK_USE_PLATFORM_XCB_KHR) - demo_run_xcb(&demo); -#elif defined(VK_USE_PLATFORM_XLIB_KHR) - demo_run_xlib(&demo); -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - demo_run(&demo); -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) - demo_run_directfb(&demo); -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - demo_run_display(&demo); -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) - demo_run(&demo); + case (WSI_PLATFORM_XCB): + demo_run_xcb(&demo); + break; #endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + case (WSI_PLATFORM_XLIB): + demo_run_xlib(&demo); + break; +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + case (WSI_PLATFORM_WAYLAND): + demo_run(&demo); + break; +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + case (WSI_PLATFORM_DIRECTFB): + demo_run_directfb(&demo); + break; +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + case (WSI_PLATFORM_DISPLAY): + demo_run_display(&demo); + break; +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + case (WSI_PLATFORM_QNX): + demo_run(&demo); + break; +#endif + } demo_cleanup(&demo); diff --git a/cube/cube.cpp b/cube/cube.cpp index 46b6fdb31..12cc2dfb6 100644 --- a/cube/cube.cpp +++ b/cube/cube.cpp @@ -2,6 +2,7 @@ * Copyright (c) 2015-2019 The Khronos Group Inc. * Copyright (c) 2015-2019 Valve Corporation * Copyright (c) 2015-2019 LunarG, Inc. + * Copyright (c) 2025 The Fuchsia Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +20,7 @@ * Author: Charles Giessen */ -#if defined(VK_USE_PLATFORM_XLIB_KHR) || defined(VK_USE_PLATFORM_XCB_KHR) -#include -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) -#include -#include "xdg-shell-client-header.h" -#include "xdg-decoration-client-header.h" -#endif - +#include #include #include #include @@ -37,6 +31,27 @@ #include #include #include +#include + +#if defined(VK_USE_PLATFORM_XLIB_KHR) +#include "xlib_loader.h" +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) +#include "xcb_loader.h" +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) +#include +#include "wayland_loader.h" +#endif +#if defined(VK_USE_PLATFORM_FUCHSIA) +#include +#include +#include +#include +#include + +#include "fuchsia/flatland_view.h" +#endif #define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1 #define VULKAN_HPP_NO_EXCEPTIONS @@ -197,6 +212,108 @@ static const float g_uv_buffer_data[] = { 1.0f, 0.0f, }; // clang-format on +enum class WsiPlatform { + auto_ = 0, + win32, + metal, + android, + qnx, + xcb, + xlib, + wayland, + directfb, + display, + fuchsia_display, + fuchsia_scenic, + invalid, // Sentinel just to indicate invalid user input +}; + +WsiPlatform wsi_from_string(std::string const &str) { + if (str == "auto") return WsiPlatform::auto_; +#if defined(VK_USE_PLATFORM_WIN32_KHR) + if (str == "win32") return WsiPlatform::win32; +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + if (str == "metal") return WsiPlatform::metal; +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + if (str == "android") return WsiPlatform::android; +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + if (str == "qnx") return WsiPlatform::qnx; +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + if (str == "xcb") return WsiPlatform::xcb; +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + if (str == "xlib") return WsiPlatform::xlib; +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + if (str == "wayland") return WsiPlatform::wayland; +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (str == "directfb") return WsiPlatform::directfb; +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + if (str == "display") return WsiPlatform::display; +#endif +#if defined(VK_USE_PLATFORM_FUCHSIA) + if (str == "fuchsia_display") return WsiPlatform::fuchsia_display; + if (str == "fuchsia_scenic") return WsiPlatform::fuchsia_scenic; +#endif + return WsiPlatform::invalid; +}; + +const char *wsi_to_string(WsiPlatform wsi_platform) { + switch (wsi_platform) { + case (WsiPlatform::auto_): + return "auto"; +#if defined(VK_USE_PLATFORM_WIN32_KHR) + case (WsiPlatform::win32): + return "win32"; +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + case (WsiPlatform::metal): + return "metal"; +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + case (WsiPlatform::android): + return "android"; +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + case (WsiPlatform::qnx): + return "qnx"; +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + case (WsiPlatform::xcb): + return "xcb"; +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + case (WsiPlatform::xlib): + return "xlib"; +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + case (WsiPlatform::wayland): + return "wayland"; +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + case (WsiPlatform::directfb): + return "directfb"; +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + case (WsiPlatform::display): + return "display"; +#endif +#if defined(VK_USE_PLATFORM_FUCHSIA) + case (WsiPlatform::fuchsia_display): + return "fuchsia_display"; + case (WsiPlatform::fuchsia_scenic): + return "fuchsia_scenic"; +#endif + default: + return "unknown"; + } +}; struct SwapchainImageResources { vk::Image image; @@ -222,8 +339,9 @@ struct Demo { void prepare_init_cmd(); void flush_init_cmd(); void init(int argc, char **argv); - void init_connection(); + void check_and_set_wsi_platform(); void init_vk(); + void select_physical_device(); void init_vk_swapchain(); void prepare(); void prepare_buffers(); @@ -252,58 +370,80 @@ struct Demo { bool memory_type_from_properties(uint32_t typeBits, vk::MemoryPropertyFlags requirements_mask, uint32_t &typeIndex); vk::SurfaceFormatKHR pick_surface_format(const std::vector &surface_formats); - static VKAPI_ATTR VkBool32 VKAPI_CALL debug_messenger_callback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VkDebugUtilsMessageTypeFlagsEXT messageType, - const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, - void *pUserData); + static VKAPI_ATTR vk::Bool32 VKAPI_CALL debug_messenger_callback(vk::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + vk::DebugUtilsMessageTypeFlagsEXT messageType, + const vk::DebugUtilsMessengerCallbackDataEXT *pCallbackData, + void *pUserData); #if defined(VK_USE_PLATFORM_WIN32_KHR) void run(); void create_window(); -#elif defined(VK_USE_PLATFORM_XLIB_KHR) +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + const char *init_xlib_connection(); void create_xlib_window(); void handle_xlib_event(const XEvent *event); void run_xlib(); -#elif defined(VK_USE_PLATFORM_XCB_KHR) +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + const char *init_xcb_connection(); void handle_xcb_event(const xcb_generic_event_t *event); void run_xcb(); void create_xcb_window(); -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - void run(); - void create_window(); -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + const char *init_wayland_connection(); + void run_wayland(); + void create_wayland_window(); +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) void handle_directfb_event(const DFBInputEvent *event); void run_directfb(); void create_directfb_window(); -#elif defined(VK_USE_PLATFORM_METAL_EXT) +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) void run(); -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) vk::Result create_display_surface(); void run_display(); -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) void run(); void create_window(); #endif +#if defined(VK_USE_PLATFORM_FUCHSIA) + // Returns a layer name of static storage duration. + const char *get_fuchsia_image_pipe_layer() const; + void create_flatland_view(); + void run(); +#endif std::string name = "vkcubepp"; // Name to put on the window/icon #if defined(VK_USE_PLATFORM_WIN32_KHR) HINSTANCE connection = nullptr; // hInstance - Windows Instance HWND window = nullptr; // hWnd - window handle POINT minsize = {0, 0}; // minimum window size -#elif defined(VK_USE_PLATFORM_XLIB_KHR) +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + void *xlib_library; Window xlib_window = 0; Atom xlib_wm_delete_window = 0; - Display *display = nullptr; -#elif defined(VK_USE_PLATFORM_XCB_KHR) + Display *xlib_display = nullptr; +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + void *xcb_library; xcb_window_t xcb_window = 0; xcb_screen_t *screen = nullptr; xcb_connection_t *connection = nullptr; xcb_intern_atom_reply_t *atom_wm_delete_window = nullptr; -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - wl_display *display = nullptr; +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + void *wayland_library = nullptr; + wl_display *wayland_display = nullptr; wl_registry *registry = nullptr; wl_compositor *compositor = nullptr; - wl_surface *window = nullptr; + wl_surface *wayland_window = nullptr; xdg_wm_base *wm_base = nullptr; zxdg_decoration_manager_v1 *xdg_decoration_mgr = nullptr; zxdg_toplevel_decoration_v1 *toplevel_decoration = nullptr; @@ -313,18 +453,29 @@ struct Demo { wl_seat *seat = nullptr; wl_pointer *pointer = nullptr; wl_keyboard *keyboard = nullptr; -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) IDirectFB *dfb = nullptr; - IDirectFBSurface *window = nullptr; + IDirectFBSurface *directfb_window = nullptr; IDirectFBEventBuffer *event_buffer = nullptr; -#elif defined(VK_USE_PLATFORM_METAL_EXT) +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) void *caMetalLayer; -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) screen_context_t screen_context = nullptr; screen_window_t screen_window = nullptr; screen_event_t screen_event = nullptr; #endif - +#if defined(VK_USE_PLATFORM_FUCHSIA) + fuchsia_ui_views::ViewCreationToken view_creation_token; + async::Loop loop{&kAsyncLoopConfigNeverAttachToThread}; + fidl::ClientEnd incoming; + std::unique_ptr outgoing; + std::unique_ptr view_provider_service; + std::unique_ptr flatland_view; +#endif + WsiPlatform wsi_platform = WsiPlatform::auto_; vk::SurfaceKHR surface; bool prepared = false; bool use_staging_buffer = false; @@ -596,32 +747,44 @@ void Demo::cleanup() { inst.destroySurfaceKHR(surface); #if defined(VK_USE_PLATFORM_XLIB_KHR) - XDestroyWindow(display, xlib_window); - XCloseDisplay(display); -#elif defined(VK_USE_PLATFORM_XCB_KHR) - xcb_destroy_window(connection, xcb_window); - xcb_disconnect(connection); - free(atom_wm_delete_window); -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - if (keyboard) wl_keyboard_destroy(keyboard); - if (pointer) wl_pointer_destroy(pointer); - if (seat) wl_seat_destroy(seat); - xdg_toplevel_destroy(window_toplevel); - xdg_surface_destroy(window_surface); - wl_surface_destroy(window); - xdg_wm_base_destroy(wm_base); - if (xdg_decoration_mgr) { - zxdg_toplevel_decoration_v1_destroy(toplevel_decoration); - zxdg_decoration_manager_v1_destroy(xdg_decoration_mgr); - } - wl_compositor_destroy(compositor); - wl_registry_destroy(registry); - wl_display_disconnect(display); -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) - event_buffer->Release(event_buffer); - window->Release(window); - dfb->Release(dfb); -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) + if (wsi_platform == WsiPlatform::xlib) { + XDestroyWindow(xlib_display, xlib_window); + XCloseDisplay(xlib_display); + } +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + if (wsi_platform == WsiPlatform::xcb) { + xcb_destroy_window(connection, xcb_window); + xcb_disconnect(connection); + free(atom_wm_delete_window); + } +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + if (wsi_platform == WsiPlatform::wayland) { + if (keyboard) wl_keyboard_destroy(keyboard); + if (pointer) wl_pointer_destroy(pointer); + if (seat) wl_seat_destroy(seat); + xdg_toplevel_destroy(window_toplevel); + xdg_surface_destroy(window_surface); + wl_surface_destroy(wayland_window); + xdg_wm_base_destroy(wm_base); + if (xdg_decoration_mgr) { + zxdg_toplevel_decoration_v1_destroy(toplevel_decoration); + zxdg_decoration_manager_v1_destroy(xdg_decoration_mgr); + } + wl_compositor_destroy(compositor); + wl_registry_destroy(registry); + wl_display_disconnect(wayland_display); + } +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (wsi_platform == WsiPlatform::directfb) { + event_buffer->Release(event_buffer); + directfb_window->Release(directfb_window); + dfb->Release(dfb); + } +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) screen_destroy_event(screen_event); screen_destroy_window(screen_window); screen_destroy_context(screen_context); @@ -887,7 +1050,7 @@ void Demo::init(int argc, char **argv) { continue; } if (strcmp(argv[i], "--xlib") == 0) { - fprintf(stderr, "--xlib is deprecated and no longer does anything"); + fprintf(stderr, "--xlib is deprecated and no longer does anything\n"); continue; } if (strcmp(argv[i], "--c") == 0 && frameCount == UINT32_MAX && i < argc - 1 && @@ -935,6 +1098,67 @@ void Demo::init(int argc, char **argv) { force_errors = true; continue; } + if ((strcmp(argv[i], "--wsi") == 0) && (i < argc - 1)) { + std::string selection_input = argv[i + 1]; + for (char &c : selection_input) { + c = static_cast(std::tolower(c)); + } + WsiPlatform selection = wsi_from_string(selection_input); + if (selection == WsiPlatform::invalid) { + printf( + "The --wsi parameter %s is not a supported WSI platform. The list of available platforms is available from " + "--help\n", + (const char *)&(argv[i + 1][0])); + fflush(stdout); + exit(1); + } + wsi_platform = selection; + i++; + continue; + } + + std::string wsi_platforms; +#if defined(VK_USE_PLATFORM_XCB_KHR) + wsi_platforms.append("xcb"); +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + if (!wsi_platforms.empty()) wsi_platforms.append("|"); + wsi_platforms.append("xlib"); +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + if (!wsi_platforms.empty()) wsi_platforms.append("|"); + wsi_platforms.append("wayland"); +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (!wsi_platforms.empty()) wsi_platforms.append("|"); + wsi_platforms.append("directfb"); +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + if (!wsi_platforms.empty()) wsi_platforms.append("|"); + wsi_platforms.append("display"); +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + if (!wsi_platforms.empty()) wsi_platforms.append("|"); + wsi_platforms.append("metal"); +#endif +#if defined(VK_USE_PLATFORM_WIN32_KHR) + if (!wsi_platforms.empty()) wsi_platforms.append("|"); + wsi_platforms.append("win32"); +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + if (!wsi_platforms.empty()) wsi_platforms.append("|"); + wsi_platforms.append("android"); +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + if (!wsi_platforms.empty()) wsi_platforms.append("|"); + wsi_platforms.append("qnx"); +#endif +#if defined(VK_USE_PLATFORM_FUCHSIA) + if (!wsi_platforms.empty()) wsi_platforms.append("|"); + wsi_platforms.append("fuchsia_display"); + if (!wsi_platforms.empty()) wsi_platforms.append("|"); + wsi_platforms.append("fuchsia_scenic"); +#endif std::stringstream usage; usage << "Usage:\n " << APP_SHORT_NAME << "\t[--use_staging] [--validate]\n" << "\t[--break] [--c ] [--suppress_popups]\n" @@ -942,6 +1166,7 @@ void Demo::init(int argc, char **argv) { << "\t[--present_mode ]\n" << "\t[--width ] [--height ]\n" << "\t[--force_errors]\n" + << "\t[--wsi <" << wsi_platforms << ">]\n" << "\t\n" << "\t\tVK_PRESENT_MODE_IMMEDIATE_KHR = " << VK_PRESENT_MODE_IMMEDIATE_KHR << "\n" << "\t\tVK_PRESENT_MODE_MAILBOX_KHR = " << VK_PRESENT_MODE_MAILBOX_KHR << "\n" @@ -957,8 +1182,6 @@ void Demo::init(int argc, char **argv) { exit(1); } - init_connection(); - init_vk(); spin_angle = 4.0f; @@ -972,24 +1195,24 @@ void Demo::init(int argc, char **argv) { projection_matrix[1][1] *= -1; // Flip projection matrix from GL to Vulkan orientation. } -void Demo::init_connection() { #if defined(VK_USE_PLATFORM_XCB_KHR) +const char *Demo::init_xcb_connection() { + xcb_library = initialize_xcb(); + if (NULL == xcb_library) { + return "Cannot load XLIB dynamic library."; + } const xcb_setup_t *setup; xcb_screen_iterator_t iter; int scr; const char *display_envar = getenv("DISPLAY"); if (display_envar == nullptr || display_envar[0] == '\0') { - printf("Environment variable DISPLAY requires a valid value.\nExiting ...\n"); - fflush(stdout); - exit(1); + return "Environment variable DISPLAY requires a valid value."; } connection = xcb_connect(nullptr, &scr); if (xcb_connection_has_error(connection) > 0) { - printf("Cannot connect to XCB.\nExiting ...\n"); - fflush(stdout); - exit(1); + return "Cannot connect to XCB."; } setup = xcb_get_setup(connection); @@ -997,18 +1220,160 @@ void Demo::init_connection() { while (scr-- > 0) xcb_screen_next(&iter); screen = iter.data; -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - display = wl_display_connect(nullptr); + return NULL; +} +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) +const char *Demo::init_xlib_connection() { + xlib_library = initialize_xlib(); + if (NULL == xlib_library) { + return "Cannot load XLIB dynamic library."; + } + return NULL; +} +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) +const char *Demo::init_wayland_connection() { + wayland_library = initialize_wayland(); + if (NULL == wayland_library) { + return "Cannot load wayland dynamic library."; + } + wayland_display = wl_display_connect(nullptr); - if (display == nullptr) { - printf("Cannot connect to wayland.\nExiting ...\n"); - fflush(stdout); - exit(1); + if (wayland_display == nullptr) { + return "Cannot connect to wayland."; } - registry = wl_display_get_registry(display); + registry = wl_display_get_registry(wayland_display); wl_registry_add_listener(registry, ®istry_listener, this); - wl_display_dispatch(display); + wl_display_dispatch(wayland_display); + return NULL; +} +#endif + +void Demo::check_and_set_wsi_platform() { +#if defined(VK_USE_PLATFORM_XCB_KHR) + if (wsi_platform == WsiPlatform::xcb || wsi_platform == WsiPlatform::auto_) { + auto found = std::find_if(enabled_instance_extensions.begin(), enabled_instance_extensions.end(), + [](const char *str) { return 0 == strcmp(str, VK_KHR_XCB_SURFACE_EXTENSION_NAME); }); + if (found != enabled_instance_extensions.end()) { + const char *error_msg = init_xcb_connection(); + if (error_msg != NULL) { + if (wsi_platform == WsiPlatform::xcb) { + fprintf(stderr, "%s\nExiting ...\n", error_msg); + fflush(stdout); + exit(1); + } + } else { + wsi_platform = WsiPlatform::xcb; + return; + } + } + } +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + if (wsi_platform == WsiPlatform::xlib || wsi_platform == WsiPlatform::auto_) { + auto found = std::find_if(enabled_instance_extensions.begin(), enabled_instance_extensions.end(), + [](const char *str) { return 0 == strcmp(str, VK_KHR_XLIB_SURFACE_EXTENSION_NAME); }); + if (found != enabled_instance_extensions.end()) { + const char *error_msg = init_xlib_connection(); + if (error_msg != NULL) { + if (wsi_platform == WsiPlatform::xlib) { + fprintf(stderr, "%s\nExiting ...\n", error_msg); + fflush(stdout); + exit(1); + } + } else { + wsi_platform = WsiPlatform::xlib; + return; + } + } + } +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + if (wsi_platform == WsiPlatform::wayland || wsi_platform == WsiPlatform::auto_) { + auto found = std::find_if(enabled_instance_extensions.begin(), enabled_instance_extensions.end(), + [](const char *str) { return 0 == strcmp(str, VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME); }); + if (found != enabled_instance_extensions.end()) { + const char *error_msg = init_wayland_connection(); + if (error_msg != NULL) { + if (wsi_platform == WsiPlatform::wayland) { + fprintf(stderr, "%s\nExiting ...\n", error_msg); + fflush(stdout); + exit(1); + } + } else { + wsi_platform = WsiPlatform::wayland; + return; + } + } + } +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (wsi_platform == WsiPlatform::directfb || wsi_platform == WsiPlatform::auto_) { + auto found = std::find_if(enabled_instance_extensions.begin(), enabled_instance_extensions.end(), + [](const char *str) { return 0 == strcmp(str, VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME); }); + if (found != enabled_instance_extensions.end()) { + // Because DirectFB is still linked in, we can assume that it works if we got here + wsi_platform = WsiPlatform::directfb; + return; + } + } +#endif +#if defined(VK_USE_PLATFORM_WIN32_KHR) + if (wsi_platform == WsiPlatform::win32 || wsi_platform == WsiPlatform::auto_) { + auto found = std::find_if(enabled_instance_extensions.begin(), enabled_instance_extensions.end(), + [](const char *str) { return 0 == strcmp(str, VK_KHR_WIN32_SURFACE_EXTENSION_NAME); }); + if (found != enabled_instance_extensions.end()) { + wsi_platform = WsiPlatform::win32; + return; + } + } +#endif +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + if (wsi_platform == WsiPlatform::android || wsi_platform == WsiPlatform::auto_) { + auto found = std::find_if(enabled_instance_extensions.begin(), enabled_instance_extensions.end(), + [](const char *str) { return 0 == strcmp(str, VK_KHR_ANDROID_SURFACE_EXTENSION_NAME); }); + if (found != enabled_instance_extensions.end()) { + wsi_platform = WsiPlatform::android; + return; + } + } +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + if (wsi_platform == WsiPlatform::metal || wsi_platform == WsiPlatform::auto_) { + auto found = std::find_if(enabled_instance_extensions.begin(), enabled_instance_extensions.end(), + [](const char *str) { return 0 == strcmp(str, VK_EXT_METAL_SURFACE_EXTENSION_NAME); }); + if (found != enabled_instance_extensions.end()) { + wsi_platform = WsiPlatform::metal; + return; + } + } +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + if (wsi_platform == WsiPlatform::qnx || wsi_platform == WsiPlatform::auto_) { + auto found = std::find_if(enabled_instance_extensions.begin(), enabled_instance_extensions.end(), + [](const char *str) { return 0 == strcmp(str, VK_QNX_SCREEN_SURFACE_EXTENSION_NAME); }); + if (found != enabled_instance_extensions.end()) { + wsi_platform = WsiPlatform::qnx; + return; + } + } +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + if (wsi_platform == WsiPlatform::display || wsi_platform == WsiPlatform::auto_) { + auto found = std::find_if(enabled_instance_extensions.begin(), enabled_instance_extensions.end(), + [](const char *str) { return 0 == strcmp(str, VK_KHR_DISPLAY_EXTENSION_NAME); }); + if (found != enabled_instance_extensions.end()) { + wsi_platform = WsiPlatform::display; + return; + } + } +#endif +#if defined(VK_USE_PLATFORM_FUCHSIA) + if (wsi_platform == WsiPlatform::auto_) { + ERR_EXIT("auto WSI platform is not supported on Fuchsia", "check_and_set_wsi_platform error"); + } #endif } #if defined(VK_USE_PLATFORM_DISPLAY_KHR) @@ -1018,13 +1383,13 @@ int find_display_gpu(int gpu_number, const std::vector &phys if (gpu_number >= 0) { auto display_props_return = physical_devices[gpu_number].getDisplayPropertiesKHR(); VERIFY(display_props_return.result == vk::Result::eSuccess); - display_count = display_props_return.value.size(); + display_count = static_cast(display_props_return.value.size()); } else { for (uint32_t i = 0; i < physical_devices.size(); i++) { auto display_props_return = physical_devices[i].getDisplayPropertiesKHR(); VERIFY(display_props_return.result == vk::Result::eSuccess); if (display_props_return.value.size() > 0) { - display_count = display_props_return.value.size(); + display_count = static_cast(display_props_return.value.size()); gpu_return = i; break; } @@ -1036,10 +1401,10 @@ int find_display_gpu(int gpu_number, const std::vector &phys return -1; } #endif -VKAPI_ATTR VkBool32 VKAPI_CALL Demo::debug_messenger_callback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VkDebugUtilsMessageTypeFlagsEXT messageType, - const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, - void *pUserData) { +VKAPI_ATTR vk::Bool32 VKAPI_CALL Demo::debug_messenger_callback(vk::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + vk::DebugUtilsMessageTypeFlagsEXT messageType, + const vk::DebugUtilsMessengerCallbackDataEXT *pCallbackData, + void *pUserData) { std::ostringstream message; Demo &demo = *static_cast(pUserData); @@ -1068,9 +1433,9 @@ VKAPI_ATTR VkBool32 VKAPI_CALL Demo::debug_messenger_callback(VkDebugUtilsMessag << vk::to_string(vk::ObjectType(pCallbackData->pObjects[object].objectType)) << ", Handle "; // Print handle correctly if it is a dispatchable handle - aka a pointer - VkObjectType t = pCallbackData->pObjects[object].objectType; - if (t == VK_OBJECT_TYPE_INSTANCE || t == VK_OBJECT_TYPE_PHYSICAL_DEVICE || t == VK_OBJECT_TYPE_DEVICE || - t == VK_OBJECT_TYPE_COMMAND_BUFFER || t == VK_OBJECT_TYPE_QUEUE) { + vk::ObjectType t = pCallbackData->pObjects[object].objectType; + if (t == vk::ObjectType::eInstance || t == vk::ObjectType::ePhysicalDevice || t == vk::ObjectType::eDevice || + t == vk::ObjectType::eCommandBuffer || t == vk::ObjectType::eQueue) { message << reinterpret_cast(static_cast(pCallbackData->pObjects[object].objectHandle)); } else { message << pCallbackData->pObjects[object].objectHandle; @@ -1162,7 +1527,19 @@ void Demo::init_vk() { vk::Bool32 platformSurfaceExtFound = VK_FALSE; bool portabilityEnumerationActive = false; - auto instance_extensions_return = vk::enumerateInstanceExtensionProperties(); + // Some platforms (for example, Fuchsia) may have their WSI instance + // extension in layers and require the client to manually specify the + // instance extension layer. + vk::Optional instance_extension_layer = nullptr; +#if VK_USE_PLATFORM_FUCHSIA + const char *image_pipe_layer_name = get_fuchsia_image_pipe_layer(); + enabled_layers.push_back(image_pipe_layer_name); + + const std::string image_pipe_layer_name_str = image_pipe_layer_name; + instance_extension_layer = image_pipe_layer_name_str; +#endif // VK_USE_PLATFORM_FUCHSIA + + auto instance_extensions_return = vk::enumerateInstanceExtensionProperties(instance_extension_layer); VERIFY(instance_extensions_return.result == vk::Result::eSuccess); for (const auto &extension : instance_extensions_return.value) { @@ -1181,45 +1558,66 @@ void Demo::init_vk() { enabled_instance_extensions.push_back(VK_KHR_SURFACE_EXTENSION_NAME); } #if defined(VK_USE_PLATFORM_WIN32_KHR) - else if (!strcmp(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, extension.extensionName)) { + else if (!strcmp(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, extension.extensionName) && + (wsi_platform == WsiPlatform::auto_ || wsi_platform == WsiPlatform::win32)) { platformSurfaceExtFound = 1; enabled_instance_extensions.push_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME); } -#elif defined(VK_USE_PLATFORM_XLIB_KHR) - else if (!strcmp(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, extension.extensionName)) { +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + else if (!strcmp(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, extension.extensionName) && + (wsi_platform == WsiPlatform::auto_ || wsi_platform == WsiPlatform::xlib)) { platformSurfaceExtFound = 1; enabled_instance_extensions.push_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME); } -#elif defined(VK_USE_PLATFORM_XCB_KHR) - else if (!strcmp(VK_KHR_XCB_SURFACE_EXTENSION_NAME, extension.extensionName)) { +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + else if (!strcmp(VK_KHR_XCB_SURFACE_EXTENSION_NAME, extension.extensionName) && + (wsi_platform == WsiPlatform::auto_ || wsi_platform == WsiPlatform::xcb)) { platformSurfaceExtFound = 1; enabled_instance_extensions.push_back(VK_KHR_XCB_SURFACE_EXTENSION_NAME); } -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - else if (!strcmp(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, extension.extensionName)) { +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + else if (!strcmp(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, extension.extensionName) && + (wsi_platform == WsiPlatform::auto_ || wsi_platform == WsiPlatform::wayland)) { platformSurfaceExtFound = 1; enabled_instance_extensions.push_back(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME); } -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) - else if (!strcmp(VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME, extension.extensionName)) { +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + else if (!strcmp(VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME, extension.extensionName) && + (wsi_platform == WsiPlatform::auto_ || wsi_platform == WsiPlatform::directfb)) { platformSurfaceExtFound = 1; enabled_instance_extensions.push_back(VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME); } -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - else if (!strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, extension.extensionName)) { +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + else if (!strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, extension.extensionName) && + (wsi_platform == WsiPlatform::auto_ || wsi_platform == WsiPlatform::display)) { platformSurfaceExtFound = 1; enabled_instance_extensions.push_back(VK_KHR_DISPLAY_EXTENSION_NAME); } -#elif defined(VK_USE_PLATFORM_METAL_EXT) - else if (!strcmp(VK_EXT_METAL_SURFACE_EXTENSION_NAME, extension.extensionName)) { +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + else if (!strcmp(VK_EXT_METAL_SURFACE_EXTENSION_NAME, extension.extensionName) && + (wsi_platform == WsiPlatform::auto_ || wsi_platform == WsiPlatform::metal)) { platformSurfaceExtFound = 1; enabled_instance_extensions.push_back(VK_EXT_METAL_SURFACE_EXTENSION_NAME); } -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) - else if (!strcmp(VK_QNX_SCREEN_SURFACE_EXTENSION_NAME, extension.extensionName)) { +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + else if (!strcmp(VK_QNX_SCREEN_SURFACE_EXTENSION_NAME, extension.extensionName) && + (wsi_platform == WsiPlatform::auto_ || wsi_platform == WsiPlatform::qnx)) { platformSurfaceExtFound = 1; enabled_instance_extensions.push_back(VK_QNX_SCREEN_SURFACE_EXTENSION_NAME); } +#endif +#if defined(VK_USE_PLATFORM_FUCHSIA) + else if (!strcmp(VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME, extension.extensionName)) { + platformSurfaceExtFound = 1; + enabled_instance_extensions.push_back(VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME); + } #endif } @@ -1233,56 +1631,103 @@ void Demo::init_vk() { if (!platformSurfaceExtFound) { #if defined(VK_USE_PLATFORM_WIN32_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_WIN32_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_XCB_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XCB_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_XLIB_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_DISPLAY_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_METAL_EXT) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_EXT_METAL_SURFACE_EXTENSION_NAME - " extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_QNX_SCREEN_SURFACE_EXTENSION_NAME - " extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); + if (wsi_platform == WsiPlatform::win32) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_WIN32_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } #endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + if (wsi_platform == WsiPlatform::xcb) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XCB_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + if (wsi_platform == WsiPlatform::wayland) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + if (wsi_platform == WsiPlatform::xlib) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (wsi_platform == WsiPlatform::directfb) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + if (wsi_platform == WsiPlatform::display) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_DISPLAY_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) + if (wsi_platform == WsiPlatform::metal) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_EXT_METAL_SURFACE_EXTENSION_NAME + " extension.\n\nDo you have a compatible " + "Vulkan installable client driver (ICD) installed?\nPlease " + "look at the Getting Started guide for additional " + "information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + if (wsi_platform == WsiPlatform::qnx) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_QNX_SCREEN_SURFACE_EXTENSION_NAME + " extension.\n\nDo you have a compatible " + "Vulkan installable client driver (ICD) installed?\nPlease " + "look at the Getting Started guide for additional " + "information.\n", + "vkCreateInstance Failure"); + } +#endif +#if defined(VK_USE_PLATFORM_FUCHSIA) + if (wsi_platform == WsiPlatform::fuchsia_display || wsi_platform == WsiPlatform::fuchsia_scenic) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME + " extension.\n\nDo you have a compatible " + "Vulkan installable client driver (ICD) installed?\nPlease " + "look at the Getting Started guide for additional " + "information.\n", + "vkCreateInstance Failure"); + } +#endif + ERR_EXIT( + "vkEnumerateInstanceExtensionProperties failed to find any supported WSI surface extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } + + bool auto_wsi_platform = wsi_platform == WsiPlatform::auto_; + + check_and_set_wsi_platform(); + + // Print a message to indicate the automatically set WSI platform + if (auto_wsi_platform && wsi_platform != WsiPlatform::auto_) { + fprintf(stderr, "Selected WSI platform: %s\n", wsi_to_string(wsi_platform)); } vk::DebugUtilsMessageSeverityFlagsEXT severityFlags(vk::DebugUtilsMessageSeverityFlagBitsEXT::eWarning | @@ -1333,7 +1778,9 @@ void Demo::init_vk() { VERIFY(create_debug_messenger_return.result == vk::Result::eSuccess); debug_messenger = create_debug_messenger_return.value; } +} +void Demo::select_physical_device() { auto physical_device_return = inst.enumeratePhysicalDevices(); VERIFY(physical_device_return.result == vk::Result::eSuccess); auto physical_devices = physical_device_return.value; @@ -1350,46 +1797,54 @@ void Demo::init_vk() { fprintf(stderr, "GPU %d specified is not present, GPU count = %zu\n", gpu_number, physical_devices.size()); ERR_EXIT("Specified GPU number is not present", "User Error"); } + + if (wsi_platform == WsiPlatform::display) { #if defined(VK_USE_PLATFORM_DISPLAY_KHR) - gpu_number = find_display_gpu(gpu_number, physical_devices); - if (gpu_number < 0) { - printf("Cannot find any display!\n"); + gpu_number = find_display_gpu(gpu_number, physical_devices); + if (gpu_number < 0) { + printf("Cannot find any display!\n"); + fflush(stdout); + exit(1); + } +#else + printf("WSI selection was set to DISPLAY but vkcubepp was not compiled with support for the DISPLAY platform, exiting \n"); fflush(stdout); exit(1); - } -#else - /* Try to auto select most suitable device */ - if (gpu_number == -1) { - constexpr uint32_t device_type_count = static_cast(vk::PhysicalDeviceType::eCpu) + 1; - std::array count_device_type{}; - - for (uint32_t i = 0; i < physical_devices.size(); i++) { - const auto physicalDeviceProperties = physical_devices[i].getProperties(); - assert(physicalDeviceProperties.deviceType <= vk::PhysicalDeviceType::eCpu); - count_device_type[static_cast(physicalDeviceProperties.deviceType)]++; - } - - std::array const device_type_preference = { - vk::PhysicalDeviceType::eDiscreteGpu, vk::PhysicalDeviceType::eIntegratedGpu, vk::PhysicalDeviceType::eVirtualGpu, - vk::PhysicalDeviceType::eCpu, vk::PhysicalDeviceType::eOther}; +#endif + } else { + /* Try to auto select most suitable device */ + if (gpu_number == -1) { + int prev_priority = 0; + for (uint32_t i = 0; i < physical_devices.size(); i++) { + const auto physicalDeviceProperties = physical_devices[i].getProperties(); + assert(physicalDeviceProperties.deviceType <= vk::PhysicalDeviceType::eCpu); + + auto support_result = physical_devices[i].getSurfaceSupportKHR(0, surface); + if (support_result.result != vk::Result::eSuccess || + support_result.value != vk::True) { + continue; + } - vk::PhysicalDeviceType search_for_device_type = vk::PhysicalDeviceType::eDiscreteGpu; - for (uint32_t i = 0; i < sizeof(device_type_preference) / sizeof(vk::PhysicalDeviceType); i++) { - if (count_device_type[static_cast(device_type_preference[i])]) { - search_for_device_type = device_type_preference[i]; - break; - } - } + std::map device_type_priorities = { + {vk::PhysicalDeviceType::eDiscreteGpu, 5}, + {vk::PhysicalDeviceType::eIntegratedGpu, 4}, + {vk::PhysicalDeviceType::eVirtualGpu, 3}, + {vk::PhysicalDeviceType::eCpu, 2}, + {vk::PhysicalDeviceType::eOther, 1}, + }; + int priority = -1; + if (device_type_priorities.find(physicalDeviceProperties.deviceType) != + device_type_priorities.end()) { + priority = device_type_priorities[physicalDeviceProperties.deviceType]; + } - for (uint32_t i = 0; i < physical_devices.size(); i++) { - const auto physicalDeviceProperties = physical_devices[i].getProperties(); - if (physicalDeviceProperties.deviceType == search_for_device_type) { - gpu_number = i; - break; + if (priority > prev_priority) { + gpu_number = i; + prev_priority = priority; + } } } } -#endif assert(gpu_number >= 0); gpu = physical_devices[gpu_number]; { @@ -1401,7 +1856,22 @@ void Demo::init_vk() { /* Look for device extensions */ vk::Bool32 swapchainExtFound = VK_FALSE; - auto device_extension_return = gpu.enumerateDeviceExtensionProperties(); + // Some platforms (for example, Fuchsia) may have their device swapchain + // extension in layers and require the client to manually specify the + // device swapchain extension layer. + vk::Optional device_extension_layer = nullptr; +#if VK_USE_PLATFORM_FUCHSIA + const std::string image_pipe_layer_name = get_fuchsia_image_pipe_layer(); + device_extension_layer = image_pipe_layer_name; +#endif // VK_USE_PLATFORM_FUCHSIA + + // Currently we assume that the device swapchain extension layer is always + // enabled when the instance is initialized. + assert((!device_extension_layer) || (std::any_of(enabled_layers.begin(), enabled_layers.end(), [&](const char *layer_name) { + return *device_extension_layer == layer_name; + }))); + + auto device_extension_return = gpu.enumerateDeviceExtensionProperties(device_extension_layer); VERIFY(device_extension_return.result == vk::Result::eSuccess); for (const auto &extension : device_extension_return.value) { @@ -1437,64 +1907,87 @@ void Demo::init_vk() { void Demo::create_surface() { // Create a WSI surface for the window: #if defined(VK_USE_PLATFORM_WIN32_KHR) - { + if (wsi_platform == WsiPlatform::win32) { auto const createInfo = vk::Win32SurfaceCreateInfoKHR().setHinstance(connection).setHwnd(window); auto result = inst.createWin32SurfaceKHR(&createInfo, nullptr, &surface); VERIFY(result == vk::Result::eSuccess); } -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - { - auto const createInfo = vk::WaylandSurfaceCreateInfoKHR().setDisplay(display).setSurface(window); +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + + if (wsi_platform == WsiPlatform::wayland) { + auto const createInfo = vk::WaylandSurfaceCreateInfoKHR().setDisplay(wayland_display).setSurface(wayland_window); auto result = inst.createWaylandSurfaceKHR(&createInfo, nullptr, &surface); VERIFY(result == vk::Result::eSuccess); + return; } -#elif defined(VK_USE_PLATFORM_XLIB_KHR) - { - auto const createInfo = vk::XlibSurfaceCreateInfoKHR().setDpy(display).setWindow(xlib_window); +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + if (wsi_platform == WsiPlatform::xlib) { + auto const createInfo = vk::XlibSurfaceCreateInfoKHR().setDpy(xlib_display).setWindow(xlib_window); auto result = inst.createXlibSurfaceKHR(&createInfo, nullptr, &surface); VERIFY(result == vk::Result::eSuccess); } -#elif defined(VK_USE_PLATFORM_XCB_KHR) - { +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) + if (wsi_platform == WsiPlatform::xcb) { auto const createInfo = vk::XcbSurfaceCreateInfoKHR().setConnection(connection).setWindow(xcb_window); auto result = inst.createXcbSurfaceKHR(&createInfo, nullptr, &surface); VERIFY(result == vk::Result::eSuccess); } -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) - { - auto const createInfo = vk::DirectFBSurfaceCreateInfoEXT().setDfb(dfb).setSurface(window); +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + if (wsi_platform == WsiPlatform::directfb) { + auto const createInfo = vk::DirectFBSurfaceCreateInfoEXT().setDfb(dfb).setSurface(directfb_window); auto result = inst.createDirectFBSurfaceEXT(&createInfo, nullptr, &surface); VERIFY(result == vk::Result::eSuccess); } -#elif defined(VK_USE_PLATFORM_METAL_EXT) +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) { auto const createInfo = vk::MetalSurfaceCreateInfoEXT().setPLayer(static_cast(caMetalLayer)); auto result = inst.createMetalSurfaceEXT(&createInfo, nullptr, &surface); VERIFY(result == vk::Result::eSuccess); } -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - { +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + if (wsi_platform == WsiPlatform::display) { auto result = create_display_surface(); VERIFY(result == vk::Result::eSuccess); } -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) - { +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + if (wsi_platform == WsiPlatform::qnx) { auto const createInfo = vk::ScreenSurfaceCreateInfoQNX().setContext(screen_context).setWindow(screen_window); auto result = inst.createScreenSurfaceQNX(&createInfo, nullptr, &surface); VERIFY(result == vk::Result::eSuccess); } #endif +#if defined(VK_USE_PLATFORM_FUCHSIA) + if (wsi_platform == WsiPlatform::fuchsia_display) { + auto createInfo = vk::ImagePipeSurfaceCreateInfoFUCHSIA(); + auto result = inst.createImagePipeSurfaceFUCHSIA(&createInfo, nullptr, &surface); + VERIFY(result == vk::Result::eSuccess); + } + if (wsi_platform == WsiPlatform::fuchsia_scenic) { + auto createInfo = vk::ImagePipeSurfaceCreateInfoFUCHSIA(); + // We are using ImagePipeSurface here, but it is being migrated to Flatland and the handle parameter is Flatland's + // ViewCreationToken during this process. + createInfo.setImagePipeHandle(std::move(view_creation_token).value().release()); + auto result = inst.createImagePipeSurfaceFUCHSIA(&createInfo, nullptr, &surface); + VERIFY(result == vk::Result::eSuccess); + } +#endif } void Demo::init_vk_swapchain() { - create_surface(); // Iterate over each queue to learn whether it supports presenting: std::vector supportsPresent; for (uint32_t i = 0; i < static_cast(queue_props.size()); i++) { @@ -2007,7 +2500,11 @@ void Demo::prepare_framebuffers() { vk::ShaderModule Demo::prepare_fs() { const uint32_t fragShaderCode[] = { +#ifdef CUBE_FRAG_INC +#include CUBE_FRAG_INC +#else #include "cube.frag.inc" +#endif }; frag_shader_module = prepare_shader_module(fragShaderCode, sizeof(fragShaderCode)); @@ -2207,7 +2704,7 @@ void Demo::prepare_texture_image(const char *filename, texture_object &tex_obj, auto const image_create_info = vk::ImageCreateInfo() .setImageType(vk::ImageType::e2D) - .setFormat(vk::Format::eR8G8B8A8Unorm) + .setFormat(vk::Format::eR8G8B8A8Srgb) .setExtent({tex_obj.tex_width, tex_obj.tex_height, 1}) .setMipLevels(1) .setArrayLayers(1) @@ -2254,7 +2751,7 @@ void Demo::prepare_texture_image(const char *filename, texture_object &tex_obj, } void Demo::prepare_textures() { - vk::Format const tex_format = vk::Format::eR8G8B8A8Unorm; + vk::Format const tex_format = vk::Format::eR8G8B8A8Srgb; vk::FormatProperties props; gpu.getFormatProperties(tex_format, &props); @@ -2302,7 +2799,7 @@ void Demo::prepare_textures() { textures[i].imageLayout, vk::AccessFlagBits::eTransferWrite, vk::PipelineStageFlagBits::eTransfer, vk::PipelineStageFlagBits::eFragmentShader); } else { - assert(!"No support for R8G8B8A8_UNORM as texture image format"); + assert(false && "No support for R8G8B8A8_SRGB as texture image format"); } auto const samplerInfo = vk::SamplerCreateInfo() @@ -2338,7 +2835,11 @@ void Demo::prepare_textures() { vk::ShaderModule Demo::prepare_vs() { const uint32_t vertShaderCode[] = { +#ifdef CUBE_VERT_INC +#include CUBE_VERT_INC +#else #include "cube.vert.inc" +#endif }; vert_shader_module = prepare_shader_module(vertShaderCode, sizeof(vertShaderCode)); @@ -2470,7 +2971,11 @@ void Demo::update_data_buffer() { } /* Convert ppm image data from header file into RGBA texture image */ +#ifdef TEXTURE_PPM_H +#include TEXTURE_PPM_H +#else #include "lunarg.ppm.h" +#endif bool Demo::loadTexture(const char *filename, uint8_t *rgba_data, vk::SubresourceLayout &layout, uint32_t &width, uint32_t &height) { (void)filename; char *cPtr; @@ -2607,7 +3112,8 @@ void Demo::create_window() { minsize.x = GetSystemMetrics(SM_CXMINTRACK); minsize.y = GetSystemMetrics(SM_CYMINTRACK) + 1; } -#elif defined(VK_USE_PLATFORM_XLIB_KHR) +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) void Demo::create_xlib_window() { const char *display_envar = getenv("DISPLAY"); @@ -2618,14 +3124,15 @@ void Demo::create_xlib_window() { } XInitThreads(); - display = XOpenDisplay(nullptr); + xlib_display = XOpenDisplay(nullptr); long visualMask = VisualScreenMask; int numberOfVisuals; XVisualInfo vInfoTemplate = {}; - vInfoTemplate.screen = DefaultScreen(display); - XVisualInfo *visualInfo = XGetVisualInfo(display, visualMask, &vInfoTemplate, &numberOfVisuals); + vInfoTemplate.screen = DefaultScreen(xlib_display); + XVisualInfo *visualInfo = XGetVisualInfo(xlib_display, visualMask, &vInfoTemplate, &numberOfVisuals); - Colormap colormap = XCreateColormap(display, RootWindow(display, vInfoTemplate.screen), visualInfo->visual, AllocNone); + Colormap colormap = + XCreateColormap(xlib_display, RootWindow(xlib_display, vInfoTemplate.screen), visualInfo->visual, AllocNone); XSetWindowAttributes windowAttributes = {}; windowAttributes.colormap = colormap; @@ -2634,13 +3141,13 @@ void Demo::create_xlib_window() { windowAttributes.event_mask = KeyPressMask | KeyReleaseMask | StructureNotifyMask | ExposureMask; xlib_window = - XCreateWindow(display, RootWindow(display, vInfoTemplate.screen), 0, 0, width, height, 0, visualInfo->depth, InputOutput, - visualInfo->visual, CWBackPixel | CWBorderPixel | CWEventMask | CWColormap, &windowAttributes); + XCreateWindow(xlib_display, RootWindow(xlib_display, vInfoTemplate.screen), 0, 0, width, height, 0, visualInfo->depth, + InputOutput, visualInfo->visual, CWBackPixel | CWBorderPixel | CWEventMask | CWColormap, &windowAttributes); - XSelectInput(display, xlib_window, ExposureMask | KeyPressMask); - XMapWindow(display, xlib_window); - XFlush(display); - xlib_wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False); + XSelectInput(xlib_display, xlib_window, ExposureMask | KeyPressMask); + XMapWindow(xlib_display, xlib_window); + XFlush(xlib_display); + xlib_wm_delete_window = XInternAtom(xlib_display, "WM_DELETE_WINDOW", False); } void Demo::handle_xlib_event(const XEvent *event) { @@ -2683,11 +3190,11 @@ void Demo::run_xlib() { XEvent event; if (pause) { - XNextEvent(display, &event); + XNextEvent(xlib_display, &event); handle_xlib_event(&event); } - while (XPending(display) > 0) { - XNextEvent(display, &event); + while (XPending(xlib_display) > 0) { + XNextEvent(xlib_display, &event); handle_xlib_event(&event); } @@ -2699,7 +3206,8 @@ void Demo::run_xlib() { } } } -#elif defined(VK_USE_PLATFORM_XCB_KHR) +#endif +#if defined(VK_USE_PLATFORM_XCB_KHR) void Demo::handle_xcb_event(const xcb_generic_event_t *event) { uint8_t event_code = event->response_type & 0x7f; @@ -2799,14 +3307,15 @@ void Demo::create_xcb_window() { std::array const coords = {100, 100}; xcb_configure_window(connection, xcb_window, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, coords.data()); } -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) -void Demo::run() { +void Demo::run_wayland() { while (!quit) { if (pause) { - wl_display_dispatch(display); + wl_display_dispatch(wayland_display); } else { - wl_display_dispatch_pending(display); + wl_display_dispatch_pending(wayland_display); draw(); curFrame++; if (frameCount != UINT32_MAX && curFrame == frameCount) { @@ -2848,21 +3357,21 @@ static void handle_toplevel_close(void *data, xdg_toplevel *xdg_toplevel) { static const xdg_toplevel_listener toplevel_listener = {handle_toplevel_configure, handle_toplevel_close}; -void Demo::create_window() { +void Demo::create_wayland_window() { if (!wm_base) { printf("Compositor did not provide the standard protocol xdg-wm-base\n"); fflush(stdout); exit(1); } - window = wl_compositor_create_surface(compositor); - if (!window) { + wayland_window = wl_compositor_create_surface(compositor); + if (!wayland_window) { printf("Can not create wayland_surface from compositor!\n"); fflush(stdout); exit(1); } - window_surface = xdg_wm_base_get_xdg_surface(wm_base, window); + window_surface = xdg_wm_base_get_xdg_surface(wm_base, wayland_window); if (!window_surface) { printf("Can not get xdg_surface from wayland_surface!\n"); fflush(stdout); @@ -2883,9 +3392,10 @@ void Demo::create_window() { zxdg_toplevel_decoration_v1_set_mode(toplevel_decoration, ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE); } - wl_surface_commit(window); + wl_surface_commit(wayland_window); } -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) void Demo::handle_directfb_event(const DFBInputEvent *event) { if (event->type != DIET_KEYPRESS) return; @@ -2948,7 +3458,7 @@ void Demo::create_directfb_window() { desc.caps = DSCAPS_PRIMARY; desc.width = width; desc.height = height; - ret = dfb->CreateSurface(dfb, &desc, &window); + ret = dfb->CreateSurface(dfb, &desc, &directfb_window); if (ret) { printf("CreateSurface failed to create DirectFB surface interface!\n"); fflush(stdout); @@ -2962,7 +3472,8 @@ void Demo::create_directfb_window() { exit(1); } } -#elif defined(VK_USE_PLATFORM_METAL_EXT) +#endif +#if defined(VK_USE_PLATFORM_METAL_EXT) void Demo::run() { draw(); curFrame++; @@ -2970,7 +3481,8 @@ void Demo::run() { quit = true; } } -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) vk::Result Demo::create_display_surface() { auto display_properties_return = gpu.getDisplayPropertiesKHR(); @@ -3078,7 +3590,8 @@ void Demo::run_display() { } } -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) #include void Demo::run() { @@ -3241,6 +3754,115 @@ void Demo::create_window() { } } } +#endif +#if defined(VK_USE_PLATFORM_FUCHSIA) + +const char *Demo::get_fuchsia_image_pipe_layer() const { + switch (wsi_platform) { + case (WsiPlatform::fuchsia_display): + return "VK_LAYER_FUCHSIA_imagepipe_swapchain_fb"; + case (WsiPlatform::fuchsia_scenic): + return "VK_LAYER_FUCHSIA_imagepipe_swapchain"; + case (WsiPlatform::auto_): + ERR_EXIT("auto WSI platform is not supported on Fuchsia", "get_fuchsia_image_pipe_layer failure"); + default: + ERR_EXIT("Invalid WSI platform", "get_fuchsia_image_pipe_layer failure"); + } +} + +void Demo::create_flatland_view() { + if (flatland_view) return; + + zx::result > incoming_result = component::OpenServiceRoot(); + if (incoming_result.is_error()) { + printf("Failed to open incoming directory: %s\n", incoming_result.status_string()); + ERR_EXIT("Failed to open incoming directory", "create_flatland_view failure"); + } + incoming = std::move(incoming_result).value(); + + outgoing = std::make_unique(loop.dispatcher()); + + FlatlandViewProviderService::CreateView2Callback create_view_callback = [this](fuchsia_ui_app::CreateView2Args args) { + auto resize_callback = [this](uint32_t width, uint32_t height) { + this->width = width; + this->height = height; + if (prepared) { + resize(); + } + }; + + flatland_view = + FlatlandView::Create(incoming.borrow(), std::move(*args.view_creation_token()), resize_callback, loop.dispatcher()); + if (!flatland_view) ERR_EXIT("Failed to created FlatlandView", "create_flatland_view failure"); + + view_creation_token = flatland_view->TakeChildViewCreationToken(); + }; + + view_provider_service = std::make_unique(std::move(create_view_callback), loop.dispatcher()); + + zx::result<> add_protocol_result = outgoing->AddUnmanagedProtocol( + [view_provider_service = view_provider_service.get()](fidl::ServerEnd server_end) { + view_provider_service->HandleViewProviderRequest(std::move(server_end)); + }); + if (add_protocol_result.is_error()) { + printf("Failed to add protocol to outgoing directory: %s\n", add_protocol_result.status_string()); + ERR_EXIT("Failed to add protocol to outgoing directory", "create_flatland_view failure"); + } + + zx::result<> serve_result = outgoing->ServeFromStartupInfo(); + if (serve_result.is_error()) { + printf("Failed to serve outgoing directory: %s\n", serve_result.status_string()); + ERR_EXIT("Failed to serve outgoing directory", "create_flatland_view failure"); + } + + zx_status_t loop_status = ZX_OK; + + // Run message loop until view has been created. + while (!quit && !flatland_view && loop_status == ZX_OK) { + loop_status = loop.RunUntilIdle(); + } +} + +void Demo::run() { + uint32_t num_frames = 60; + uint32_t elapsed_frames = 0; + static const float kMsPerSec = 1000; + + double total_ms = 0; + auto t0 = std::chrono::high_resolution_clock::now(); + + while (!quit) { + if (wsi_platform == WsiPlatform::fuchsia_scenic) { + if (loop.RunUntilIdle() != ZX_OK) { + break; + } + } + auto t1 = std::chrono::high_resolution_clock::now(); + std::chrono::duration elapsed = t1 - t0; + total_ms += elapsed.count(); + t0 = t1; + + if (elapsed_frames && (elapsed_frames % num_frames) == 0) { + float fps = static_cast(num_frames / (total_ms / kMsPerSec)); + printf("Framerate average for last %u frames: %f frames per second\n", num_frames, fps); + fflush(stdout); + total_ms = 0; + // attempt to log once per second + num_frames = static_cast(fps); + elapsed_frames = 0; + } + + draw(); + + curFrame++; + elapsed_frames++; + + if (frameCount != UINT32_MAX && curFrame == frameCount) { + quit = true; + } + } +} + #endif #if _WIN32 @@ -3353,6 +3975,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLine, demo.connection = hInstance; demo.name = "Vulkan Cube"; demo.create_window(); + demo.create_surface(); + demo.select_physical_device(); demo.init_vk_swapchain(); demo.prepare(); @@ -3387,42 +4011,115 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLine, return static_cast(msg.wParam); } -#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__QNX__) || defined(__GNU__) +#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__QNX__) || defined(__GNU__) || \ + defined(__Fuchsia__) int main(int argc, char **argv) { Demo demo; demo.init(argc, argv); + switch (demo.wsi_platform) { + default: + case (WsiPlatform::auto_): + fprintf(stderr, + "WSI platform should have already been set, indicating a bug. Please set a WSI platform manually with " + "--wsi\n"); + exit(1); + break; #if defined(VK_USE_PLATFORM_XCB_KHR) - demo.create_xcb_window(); -#elif defined(VK_USE_PLATFORM_XLIB_KHR) - demo.create_xlib_window(); -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - demo.create_window(); -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) - demo.create_directfb_window(); -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) - demo.create_window(); + case (WsiPlatform::xcb): + demo.create_xcb_window(); + break; +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + case (WsiPlatform::xlib): + demo.create_xlib_window(); + break; +#endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + case (WsiPlatform::wayland): + demo.create_wayland_window(); + break; +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + case (WsiPlatform::directfb): + demo.create_directfb_window(); + break; +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + case (WsiPlatform::qnx): + demo.create_window(); + break; +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + case (WsiPlatform::display): + // nothing to do here + break; #endif +#if defined(VK_USE_PLATFORM_FUCHSIA) + case (WsiPlatform::fuchsia_display): + // nothing to do here + break; + case (WsiPlatform::fuchsia_scenic): + demo.create_flatland_view(); + break; +#endif + } + + demo.create_surface(); + + demo.select_physical_device(); demo.init_vk_swapchain(); demo.prepare(); + switch (demo.wsi_platform) { + default: + case (WsiPlatform::auto_): + fprintf(stderr, + "WSI platform should have already been set, indicating a bug. Please set a WSI platform manually with " + "--wsi\n"); + exit(1); + break; #if defined(VK_USE_PLATFORM_XCB_KHR) - demo.run_xcb(); -#elif defined(VK_USE_PLATFORM_XLIB_KHR) - demo.run_xlib(); -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - demo.run(); -#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT) - demo.run_directfb(); -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - demo.run_display(); -#elif defined(VK_USE_PLATFORM_SCREEN_QNX) - demo.run(); + case (WsiPlatform::xcb): + demo.run_xcb(); + break; +#endif +#if defined(VK_USE_PLATFORM_XLIB_KHR) + case (WsiPlatform::xlib): + demo.run_xlib(); + break; #endif +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + case (WsiPlatform::wayland): + demo.run_wayland(); + break; +#endif +#if defined(VK_USE_PLATFORM_DIRECTFB_EXT) + case (WsiPlatform::directfb): + demo.run_directfb(); + break; +#endif +#if defined(VK_USE_PLATFORM_DISPLAY_KHR) + case (WsiPlatform::display): + demo.run_display(); + break; +#endif +#if defined(VK_USE_PLATFORM_SCREEN_QNX) + case (WsiPlatform::qnx): + demo.run(); + break; +#endif +#if defined(VK_USE_PLATFORM_FUCHSIA) + case (WsiPlatform::fuchsia_display): + case (WsiPlatform::fuchsia_scenic): + demo.run(); + break; +#endif + } demo.cleanup(); @@ -3435,6 +4132,8 @@ int main(int argc, char **argv) { static void demo_main(Demo &demo, void *caMetalLayer, int argc, const char *argv[]) { demo.init(argc, (char **)argv); demo.caMetalLayer = caMetalLayer; + demo.create_surface(); + demo.select_physical_device(); demo.init_vk_swapchain(); demo.prepare(); demo.spin_angle = 0.4f; diff --git a/cube/cube.frag b/cube/cube.frag index 5bf6507a6..c68b98542 100644 --- a/cube/cube.frag +++ b/cube/cube.frag @@ -29,10 +29,26 @@ layout (location = 0) out vec4 uFragColor; const vec3 lightDir= vec3(0.424, 0.566, 0.707); +float linearToSrgb(float linear) { + if (linear <= 0.0031308) { + return linear * 12.92; + } else { + return (1.055 * pow(linear, 1.0/2.4)) - 0.055; + } +} + +vec3 linearToSrgb(vec3 linear) { + return vec3(linearToSrgb(linear.r), linearToSrgb(linear.g), linearToSrgb(linear.b)); +} + +vec4 linearToSrgb(vec4 linear) { + return vec4(linearToSrgb(linear.rgb), linear.a); +} + void main() { vec3 dX = dFdx(frag_pos); vec3 dY = dFdy(frag_pos); vec3 normal = normalize(cross(dX,dY)); float light = max(0.0, dot(lightDir, normal)); - uFragColor = light * texture(tex, texcoord.xy); + uFragColor = linearToSrgb(light * texture(tex, texcoord.xy)); } diff --git a/cube/cube.frag.inc b/cube/cube.frag.inc index 98ff52139..539636e5f 100644 --- a/cube/cube.frag.inc +++ b/cube/cube.frag.inc @@ -1,41 +1,84 @@ - // 7.9.2888 - 0x07230203,0x00010000,0x00080007,0x00000030,0x00000000,0x00020011,0x00000001,0x0006000b, + // 1115.1.0 + 0x07230203,0x00010000,0x0008000b,0x00000073,0x00000000,0x00020011,0x00000001,0x0006000b, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, - 0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x00000022,0x0000002a, + 0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000004e,0x00000063,0x0000006b, 0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47, 0x735f4252,0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004, 0x415f4c47,0x735f4252,0x69646168,0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361, - 0x00040005,0x00000004,0x6e69616d,0x00000000,0x00030005,0x00000009,0x00005864,0x00050005, - 0x0000000b,0x67617266,0x736f705f,0x00000000,0x00030005,0x0000000e,0x00005964,0x00040005, - 0x00000011,0x6d726f6e,0x00006c61,0x00040005,0x00000017,0x6867696c,0x00000074,0x00050005, - 0x00000022,0x61724675,0x6c6f4367,0x0000726f,0x00030005,0x00000027,0x00786574,0x00050005, - 0x0000002a,0x63786574,0x64726f6f,0x00000000,0x00040047,0x0000000b,0x0000001e,0x00000001, - 0x00040047,0x00000022,0x0000001e,0x00000000,0x00040047,0x00000027,0x00000022,0x00000000, - 0x00040047,0x00000027,0x00000021,0x00000001,0x00040047,0x0000002a,0x0000001e,0x00000000, - 0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020, - 0x00040017,0x00000007,0x00000006,0x00000003,0x00040020,0x00000008,0x00000007,0x00000007, - 0x00040020,0x0000000a,0x00000001,0x00000007,0x0004003b,0x0000000a,0x0000000b,0x00000001, - 0x00040020,0x00000016,0x00000007,0x00000006,0x0004002b,0x00000006,0x00000018,0x00000000, - 0x0004002b,0x00000006,0x00000019,0x3ed91687,0x0004002b,0x00000006,0x0000001a,0x3f10e560, - 0x0004002b,0x00000006,0x0000001b,0x3f34fdf4,0x0006002c,0x00000007,0x0000001c,0x00000019, - 0x0000001a,0x0000001b,0x00040017,0x00000020,0x00000006,0x00000004,0x00040020,0x00000021, - 0x00000003,0x00000020,0x0004003b,0x00000021,0x00000022,0x00000003,0x00090019,0x00000024, - 0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b, - 0x00000025,0x00000024,0x00040020,0x00000026,0x00000000,0x00000025,0x0004003b,0x00000026, - 0x00000027,0x00000000,0x00040020,0x00000029,0x00000001,0x00000020,0x0004003b,0x00000029, - 0x0000002a,0x00000001,0x00040017,0x0000002b,0x00000006,0x00000002,0x00050036,0x00000002, - 0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000008,0x00000009, - 0x00000007,0x0004003b,0x00000008,0x0000000e,0x00000007,0x0004003b,0x00000008,0x00000011, - 0x00000007,0x0004003b,0x00000016,0x00000017,0x00000007,0x0004003d,0x00000007,0x0000000c, - 0x0000000b,0x000400cf,0x00000007,0x0000000d,0x0000000c,0x0003003e,0x00000009,0x0000000d, - 0x0004003d,0x00000007,0x0000000f,0x0000000b,0x000400d0,0x00000007,0x00000010,0x0000000f, - 0x0003003e,0x0000000e,0x00000010,0x0004003d,0x00000007,0x00000012,0x00000009,0x0004003d, - 0x00000007,0x00000013,0x0000000e,0x0007000c,0x00000007,0x00000014,0x00000001,0x00000044, - 0x00000012,0x00000013,0x0006000c,0x00000007,0x00000015,0x00000001,0x00000045,0x00000014, - 0x0003003e,0x00000011,0x00000015,0x0004003d,0x00000007,0x0000001d,0x00000011,0x00050094, - 0x00000006,0x0000001e,0x0000001c,0x0000001d,0x0007000c,0x00000006,0x0000001f,0x00000001, - 0x00000028,0x00000018,0x0000001e,0x0003003e,0x00000017,0x0000001f,0x0004003d,0x00000006, - 0x00000023,0x00000017,0x0004003d,0x00000025,0x00000028,0x00000027,0x0004003d,0x00000020, - 0x0000002c,0x0000002a,0x0007004f,0x0000002b,0x0000002d,0x0000002c,0x0000002c,0x00000000, - 0x00000001,0x00050057,0x00000020,0x0000002e,0x00000028,0x0000002d,0x0005008e,0x00000020, - 0x0000002f,0x0000002e,0x00000023,0x0003003e,0x00000022,0x0000002f,0x000100fd,0x00010038 + 0x00040005,0x00000004,0x6e69616d,0x00000000,0x00070005,0x0000000a,0x656e696c,0x6f547261, + 0x62677253,0x3b316628,0x00000000,0x00040005,0x00000009,0x656e696c,0x00007261,0x00070005, + 0x00000010,0x656e696c,0x6f547261,0x62677253,0x33667628,0x0000003b,0x00040005,0x0000000f, + 0x656e696c,0x00007261,0x00070005,0x00000016,0x656e696c,0x6f547261,0x62677253,0x34667628, + 0x0000003b,0x00040005,0x00000015,0x656e696c,0x00007261,0x00040005,0x0000002c,0x61726170, + 0x0000006d,0x00040005,0x00000032,0x61726170,0x0000006d,0x00040005,0x00000037,0x61726170, + 0x0000006d,0x00040005,0x0000003f,0x61726170,0x0000006d,0x00030005,0x0000004c,0x00005864, + 0x00050005,0x0000004e,0x67617266,0x736f705f,0x00000000,0x00030005,0x00000051,0x00005964, + 0x00040005,0x00000054,0x6d726f6e,0x00006c61,0x00040005,0x00000059,0x6867696c,0x00000074, + 0x00050005,0x00000063,0x61724675,0x6c6f4367,0x0000726f,0x00030005,0x00000068,0x00786574, + 0x00050005,0x0000006b,0x63786574,0x64726f6f,0x00000000,0x00040005,0x00000071,0x61726170, + 0x0000006d,0x00040047,0x0000004e,0x0000001e,0x00000001,0x00040047,0x00000063,0x0000001e, + 0x00000000,0x00040047,0x00000068,0x00000021,0x00000001,0x00040047,0x00000068,0x00000022, + 0x00000000,0x00040047,0x0000006b,0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021, + 0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040020,0x00000007,0x00000007, + 0x00000006,0x00040021,0x00000008,0x00000006,0x00000007,0x00040017,0x0000000c,0x00000006, + 0x00000003,0x00040020,0x0000000d,0x00000007,0x0000000c,0x00040021,0x0000000e,0x0000000c, + 0x0000000d,0x00040017,0x00000012,0x00000006,0x00000004,0x00040020,0x00000013,0x00000007, + 0x00000012,0x00040021,0x00000014,0x00000012,0x00000013,0x0004002b,0x00000006,0x00000019, + 0x3b4d2e1c,0x00020014,0x0000001a,0x0004002b,0x00000006,0x0000001f,0x414eb852,0x0004002b, + 0x00000006,0x00000023,0x3f870a3d,0x0004002b,0x00000006,0x00000025,0x3ed55555,0x0004002b, + 0x00000006,0x00000028,0x3d6147ae,0x00040015,0x0000002d,0x00000020,0x00000000,0x0004002b, + 0x0000002d,0x0000002e,0x00000000,0x0004002b,0x0000002d,0x00000033,0x00000001,0x0004002b, + 0x0000002d,0x00000038,0x00000002,0x0004002b,0x0000002d,0x00000043,0x00000003,0x00040020, + 0x0000004d,0x00000001,0x0000000c,0x0004003b,0x0000004d,0x0000004e,0x00000001,0x0004002b, + 0x00000006,0x0000005a,0x00000000,0x0004002b,0x00000006,0x0000005b,0x3ed91687,0x0004002b, + 0x00000006,0x0000005c,0x3f10e560,0x0004002b,0x00000006,0x0000005d,0x3f34fdf4,0x0006002c, + 0x0000000c,0x0000005e,0x0000005b,0x0000005c,0x0000005d,0x00040020,0x00000062,0x00000003, + 0x00000012,0x0004003b,0x00000062,0x00000063,0x00000003,0x00090019,0x00000065,0x00000006, + 0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x00000066, + 0x00000065,0x00040020,0x00000067,0x00000000,0x00000066,0x0004003b,0x00000067,0x00000068, + 0x00000000,0x00040020,0x0000006a,0x00000001,0x00000012,0x0004003b,0x0000006a,0x0000006b, + 0x00000001,0x00040017,0x0000006c,0x00000006,0x00000002,0x00050036,0x00000002,0x00000004, + 0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x0000000d,0x0000004c,0x00000007, + 0x0004003b,0x0000000d,0x00000051,0x00000007,0x0004003b,0x0000000d,0x00000054,0x00000007, + 0x0004003b,0x00000007,0x00000059,0x00000007,0x0004003b,0x00000013,0x00000071,0x00000007, + 0x0004003d,0x0000000c,0x0000004f,0x0000004e,0x000400cf,0x0000000c,0x00000050,0x0000004f, + 0x0003003e,0x0000004c,0x00000050,0x0004003d,0x0000000c,0x00000052,0x0000004e,0x000400d0, + 0x0000000c,0x00000053,0x00000052,0x0003003e,0x00000051,0x00000053,0x0004003d,0x0000000c, + 0x00000055,0x0000004c,0x0004003d,0x0000000c,0x00000056,0x00000051,0x0007000c,0x0000000c, + 0x00000057,0x00000001,0x00000044,0x00000055,0x00000056,0x0006000c,0x0000000c,0x00000058, + 0x00000001,0x00000045,0x00000057,0x0003003e,0x00000054,0x00000058,0x0004003d,0x0000000c, + 0x0000005f,0x00000054,0x00050094,0x00000006,0x00000060,0x0000005e,0x0000005f,0x0007000c, + 0x00000006,0x00000061,0x00000001,0x00000028,0x0000005a,0x00000060,0x0003003e,0x00000059, + 0x00000061,0x0004003d,0x00000006,0x00000064,0x00000059,0x0004003d,0x00000066,0x00000069, + 0x00000068,0x0004003d,0x00000012,0x0000006d,0x0000006b,0x0007004f,0x0000006c,0x0000006e, + 0x0000006d,0x0000006d,0x00000000,0x00000001,0x00050057,0x00000012,0x0000006f,0x00000069, + 0x0000006e,0x0005008e,0x00000012,0x00000070,0x0000006f,0x00000064,0x0003003e,0x00000071, + 0x00000070,0x00050039,0x00000012,0x00000072,0x00000016,0x00000071,0x0003003e,0x00000063, + 0x00000072,0x000100fd,0x00010038,0x00050036,0x00000006,0x0000000a,0x00000000,0x00000008, + 0x00030037,0x00000007,0x00000009,0x000200f8,0x0000000b,0x0004003d,0x00000006,0x00000018, + 0x00000009,0x000500bc,0x0000001a,0x0000001b,0x00000018,0x00000019,0x000300f7,0x0000001d, + 0x00000000,0x000400fa,0x0000001b,0x0000001c,0x00000022,0x000200f8,0x0000001c,0x0004003d, + 0x00000006,0x0000001e,0x00000009,0x00050085,0x00000006,0x00000020,0x0000001e,0x0000001f, + 0x000200fe,0x00000020,0x000200f8,0x00000022,0x0004003d,0x00000006,0x00000024,0x00000009, + 0x0007000c,0x00000006,0x00000026,0x00000001,0x0000001a,0x00000024,0x00000025,0x00050085, + 0x00000006,0x00000027,0x00000023,0x00000026,0x00050083,0x00000006,0x00000029,0x00000027, + 0x00000028,0x000200fe,0x00000029,0x000200f8,0x0000001d,0x000100ff,0x00010038,0x00050036, + 0x0000000c,0x00000010,0x00000000,0x0000000e,0x00030037,0x0000000d,0x0000000f,0x000200f8, + 0x00000011,0x0004003b,0x00000007,0x0000002c,0x00000007,0x0004003b,0x00000007,0x00000032, + 0x00000007,0x0004003b,0x00000007,0x00000037,0x00000007,0x00050041,0x00000007,0x0000002f, + 0x0000000f,0x0000002e,0x0004003d,0x00000006,0x00000030,0x0000002f,0x0003003e,0x0000002c, + 0x00000030,0x00050039,0x00000006,0x00000031,0x0000000a,0x0000002c,0x00050041,0x00000007, + 0x00000034,0x0000000f,0x00000033,0x0004003d,0x00000006,0x00000035,0x00000034,0x0003003e, + 0x00000032,0x00000035,0x00050039,0x00000006,0x00000036,0x0000000a,0x00000032,0x00050041, + 0x00000007,0x00000039,0x0000000f,0x00000038,0x0004003d,0x00000006,0x0000003a,0x00000039, + 0x0003003e,0x00000037,0x0000003a,0x00050039,0x00000006,0x0000003b,0x0000000a,0x00000037, + 0x00060050,0x0000000c,0x0000003c,0x00000031,0x00000036,0x0000003b,0x000200fe,0x0000003c, + 0x00010038,0x00050036,0x00000012,0x00000016,0x00000000,0x00000014,0x00030037,0x00000013, + 0x00000015,0x000200f8,0x00000017,0x0004003b,0x0000000d,0x0000003f,0x00000007,0x0004003d, + 0x00000012,0x00000040,0x00000015,0x0008004f,0x0000000c,0x00000041,0x00000040,0x00000040, + 0x00000000,0x00000001,0x00000002,0x0003003e,0x0000003f,0x00000041,0x00050039,0x0000000c, + 0x00000042,0x00000010,0x0000003f,0x00050041,0x00000007,0x00000044,0x00000015,0x00000043, + 0x0004003d,0x00000006,0x00000045,0x00000044,0x00050051,0x00000006,0x00000046,0x00000042, + 0x00000000,0x00050051,0x00000006,0x00000047,0x00000042,0x00000001,0x00050051,0x00000006, + 0x00000048,0x00000042,0x00000002,0x00070050,0x00000012,0x00000049,0x00000046,0x00000047, + 0x00000048,0x00000045,0x000200fe,0x00000049,0x00010038 diff --git a/cube/cube.vert.inc b/cube/cube.vert.inc index 5d029c645..f5c3fef04 100644 --- a/cube/cube.vert.inc +++ b/cube/cube.vert.inc @@ -1,5 +1,5 @@ - // 7.9.2888 - 0x07230203,0x00010000,0x00080007,0x0000002f,0x00000000,0x00020011,0x00000001,0x0006000b, + // 1115.1.0 + 0x07230203,0x00010000,0x0008000b,0x0000002f,0x00000000,0x00020011,0x00000001,0x0006000b, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000015,0x0000001e, 0x0000002b,0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252,0x72617065, @@ -15,14 +15,14 @@ 0x00000002,0x435f6c67,0x4470696c,0x61747369,0x0065636e,0x00030005,0x0000001e,0x00000000, 0x00050005,0x0000002b,0x67617266,0x736f705f,0x00000000,0x00040047,0x00000009,0x0000001e, 0x00000000,0x00040047,0x0000000d,0x00000006,0x00000010,0x00040047,0x0000000e,0x00000006, - 0x00000010,0x00040048,0x0000000f,0x00000000,0x00000005,0x00050048,0x0000000f,0x00000000, - 0x00000023,0x00000000,0x00050048,0x0000000f,0x00000000,0x00000007,0x00000010,0x00050048, - 0x0000000f,0x00000001,0x00000023,0x00000040,0x00050048,0x0000000f,0x00000002,0x00000023, - 0x00000280,0x00030047,0x0000000f,0x00000002,0x00040047,0x00000011,0x00000022,0x00000000, - 0x00040047,0x00000011,0x00000021,0x00000000,0x00040047,0x00000015,0x0000000b,0x0000002a, - 0x00050048,0x0000001c,0x00000000,0x0000000b,0x00000000,0x00050048,0x0000001c,0x00000001, - 0x0000000b,0x00000001,0x00050048,0x0000001c,0x00000002,0x0000000b,0x00000003,0x00030047, - 0x0000001c,0x00000002,0x00040047,0x0000002b,0x0000001e,0x00000001,0x00020013,0x00000002, + 0x00000010,0x00030047,0x0000000f,0x00000002,0x00040048,0x0000000f,0x00000000,0x00000005, + 0x00050048,0x0000000f,0x00000000,0x00000007,0x00000010,0x00050048,0x0000000f,0x00000000, + 0x00000023,0x00000000,0x00050048,0x0000000f,0x00000001,0x00000023,0x00000040,0x00050048, + 0x0000000f,0x00000002,0x00000023,0x00000280,0x00040047,0x00000011,0x00000021,0x00000000, + 0x00040047,0x00000011,0x00000022,0x00000000,0x00040047,0x00000015,0x0000000b,0x0000002a, + 0x00030047,0x0000001c,0x00000002,0x00050048,0x0000001c,0x00000000,0x0000000b,0x00000000, + 0x00050048,0x0000001c,0x00000001,0x0000000b,0x00000001,0x00050048,0x0000001c,0x00000002, + 0x0000000b,0x00000003,0x00040047,0x0000002b,0x0000001e,0x00000001,0x00020013,0x00000002, 0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007, 0x00000006,0x00000004,0x00040020,0x00000008,0x00000003,0x00000007,0x0004003b,0x00000008, 0x00000009,0x00000003,0x00040018,0x0000000a,0x00000007,0x00000004,0x00040015,0x0000000b, diff --git a/cube/fuchsia/flatland_view.cpp b/cube/fuchsia/flatland_view.cpp new file mode 100644 index 000000000..029c07d3f --- /dev/null +++ b/cube/fuchsia/flatland_view.cpp @@ -0,0 +1,210 @@ +// Copyright (c) 2025 The Fuchsia Authors. +// +// 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. + +#include "flatland_view.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace { + +const char* const kTag = "FlatlandView"; + +const fuchsia_ui_composition::TransformId kRootTransform = {1}; +const fuchsia_ui_composition::ContentId kViewport = {1}; + +} // namespace + +// static +std::unique_ptr FlatlandView::Create(fidl::UnownedClientEnd service_directory, + fuchsia_ui_views::ViewCreationToken view_creation_token, + ResizeCallback resize_callback, async_dispatcher_t* dispatcher) { + ZX_DEBUG_ASSERT(dispatcher != nullptr); + auto view = std::make_unique(std::move(resize_callback), dispatcher); + if (!view) return nullptr; + if (!view->Init(service_directory, std::move(view_creation_token))) return nullptr; + return view; +} + +FlatlandView::FlatlandView(ResizeCallback resize_callback, async_dispatcher_t* dispatcher) + : resize_callback_(std::move(resize_callback)), dispatcher_(dispatcher) { + ZX_DEBUG_ASSERT(dispatcher != nullptr); +} + +bool FlatlandView::Init(fidl::UnownedClientEnd service_directory, + fuchsia_ui_views::ViewCreationToken view_creation_token) { + zx::result> connect_result = + component::ConnectAt(service_directory); + if (connect_result.is_error()) { + FX_LOGS(ERROR) << "Failed to connect to Flatland: " << connect_result.status_string(); + return false; + } + fidl::ClientEnd flatland_client = std::move(connect_result).value(); + flatland_.Bind(std::move(flatland_client), dispatcher_, /*event_handler=*/this); + fit::result set_debug_name_result = flatland_->SetDebugName({{.name = kTag}}); + if (set_debug_name_result.is_error()) { + FX_LOGS(ERROR) << "Failed to set debug name: " << set_debug_name_result.error_value().FormatDescription(); + } + + fit::result create_transform_result = flatland_->CreateTransform(kRootTransform); + if (create_transform_result.is_error()) { + FX_LOGS(ERROR) << "Failed to call CreateTransform: " << create_transform_result.error_value().FormatDescription(); + return false; + } + + fit::result set_root_transform_result = flatland_->SetRootTransform(kRootTransform); + if (set_root_transform_result.is_error()) { + FX_LOGS(ERROR) << "Failed to call SetRootTransform: " << set_root_transform_result.error_value().FormatDescription(); + return false; + } + + auto [parent_viewport_watcher_client, parent_viewport_watcher_server] = + fidl::Endpoints::Create(); + fit::result create_view2_result = flatland_->CreateView2({{ + .token = std::move(view_creation_token), + .view_identity = scenic::cpp::NewViewIdentityOnCreation(), + .protocols = {}, + .parent_viewport_watcher = std::move(parent_viewport_watcher_server), + }}); + if (create_view2_result.is_error()) { + FX_LOGS(ERROR) << "Failed to call CreateView2: " << set_root_transform_result.error_value().FormatDescription(); + return false; + } + + parent_viewport_watcher_.Bind(std::move(parent_viewport_watcher_client), dispatcher_); + parent_viewport_watcher_->GetLayout().Then( + [this](fidl::Result& result) { + if (result.is_error()) { + FX_LOGS(ERROR) << "GetLayout() failed: " << result.error_value().FormatDescription(); + return; + } + OnGetLayout(std::move(result.value().info())); + }); + + zx::channel::create(0, &viewport_creation_token_.value(), &child_view_creation_token_.value()); + + return true; +} + +void FlatlandView::OnGetLayout(fuchsia_ui_composition::LayoutInfo info) { + ZX_DEBUG_ASSERT(info.logical_size().has_value()); + const fuchsia_math::SizeU& logical_size = info.logical_size().value(); + resize_callback_(logical_size.width(), logical_size.height()); + + fuchsia_ui_composition::ViewportProperties properties = {{.logical_size = logical_size}}; + if (viewport_creation_token_.value().is_valid()) { + // The first time that we receive layout information, create a viewport using the token that was stashed during Init(). + // External code will attach a view to this viewport via the token obtained from TakeChildViewCreationToken(). + auto [child_view_watcher_client, child_view_watcher_server] = + fidl::Endpoints::Create(); + fit::result create_viewport_result = flatland_->CreateViewport({{ + .viewport_id = kViewport, + .token = std::move(viewport_creation_token_), + .properties = std::move(properties), + .child_view_watcher = std::move(child_view_watcher_server), + }}); + if (create_viewport_result.is_error()) { + FX_LOGS(ERROR) << "Failed to call CreateViewport(): " << create_viewport_result.error_value().FormatDescription(); + return; + } + + fit::result set_content_result = flatland_->SetContent({{ + .transform_id = kRootTransform, + .content_id = kViewport, + }}); + if (set_content_result.is_error()) { + FX_LOGS(ERROR) << "Failed to call SetContent(): " << set_content_result.error_value().FormatDescription(); + return; + } + } else { + auto set_viewport_properties_result = flatland_->SetViewportProperties({{ + .viewport_id = kViewport, + .properties = std::move(properties), + }}); + if (set_viewport_properties_result.is_error()) { + FX_LOGS(ERROR) << "Failed to call SetViewportProperties(): " + << set_viewport_properties_result.error_value().FormatDescription(); + return; + } + } + + Present(); + parent_viewport_watcher_->GetLayout().Then( + [this](fidl::Result& result) { + if (result.is_error()) { + FX_LOGS(ERROR) << "GetLayout() failed: " << result.error_value().FormatDescription(); + return; + } + OnGetLayout(std::move(result.value().info())); + }); +} + +void FlatlandView::OnError(fidl::Event& event) { + FX_LOGF(ERROR, kTag, "OnFlatlandError: %" PRIu32, static_cast(event.error())); +} + +void FlatlandView::Present() { + if (present_credits_ == 0) { + pending_present_ = true; + return; + } + --present_credits_; + fuchsia_ui_composition::PresentArgs present_args = {{ + .requested_presentation_time = 0, + .acquire_fences = {}, + .release_fences = {}, + .unsquashable = false, + }}; + fit::result present_result = flatland_->Present(std::move(present_args)); + if (present_result.is_error()) { + FX_LOGS(ERROR) << "Failed to call Present(): " << present_result.error_value().FormatDescription(); + } +} + +void FlatlandView::OnFramePresented(fidl::Event& event) {} + +void FlatlandView::OnNextFrameBegin(fidl::Event& event) { + present_credits_ += event.values().additional_present_credits().value_or(0); + if (present_credits_ > 0 && pending_present_) { + Present(); + pending_present_ = false; + } +} + +FlatlandViewProviderService::FlatlandViewProviderService(CreateView2Callback create_view_callback, async_dispatcher_t* dispatcher) + : create_view_callback_(std::move(create_view_callback)), dispatcher_(dispatcher) { + ZX_DEBUG_ASSERT(dispatcher != nullptr); +} + +void FlatlandViewProviderService::CreateViewWithViewRef(CreateViewWithViewRefRequest& request, + CreateViewWithViewRefCompleter::Sync& completer) { + FX_NOTIMPLEMENTED() << "Only Flatland is supported. This is a Gfx ViewProvider method."; +} + +void FlatlandViewProviderService::CreateView2(CreateView2Request& request, CreateView2Completer::Sync& completer) { + create_view_callback_(std::move(request.args())); +} + +void FlatlandViewProviderService::HandleViewProviderRequest(fidl::ServerEnd server_end) { + bindings_.AddBinding(dispatcher_, std::move(server_end), this, fidl::kIgnoreBindingClosure); +} diff --git a/cube/fuchsia/flatland_view.h b/cube/fuchsia/flatland_view.h new file mode 100644 index 000000000..01a8c6f98 --- /dev/null +++ b/cube/fuchsia/flatland_view.h @@ -0,0 +1,102 @@ +// Copyright (c) 2025 The Fuchsia Authors. +// +// 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 FUCHSIA_FLATLAND_VIEW_H_ +#define FUCHSIA_FLATLAND_VIEW_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +// This class provides a convenient wrapper around the scenic fidl apis needed to get a Flatland +// View. Only SDK available constructs should be used so that this code may be leveraged by Vulkan +// applications built with the SDK. +class FlatlandView : public fidl::AsyncEventHandler { + public: + using ResizeCallback = fit::function; + + // Creates and initializes a `FlatlandView` instance. + // + // `dispatcher` must be non-null. + static std::unique_ptr Create(fidl::UnownedClientEnd service_directory, + fuchsia_ui_views::ViewCreationToken view_creation_token, + ResizeCallback resize_callback, async_dispatcher_t* dispatcher); + + // Production code must use the `Create()` factory method. + // + // `dispatcher` must be non-null. + explicit FlatlandView(ResizeCallback resize_callback, async_dispatcher_t* dispatcher); + + fuchsia_ui_views::ViewCreationToken TakeChildViewCreationToken() { + FX_DCHECK(child_view_creation_token_.value().is_valid()); + return std::move(child_view_creation_token_); + } + + bool Init(fidl::UnownedClientEnd service_directory, + fuchsia_ui_views::ViewCreationToken view_creation_token); + + private: + void OnNextFrameBegin(fidl::Event& event) override; + void OnFramePresented(fidl::Event& event) override; + void OnError(fidl::Event& event) override; + + void OnGetLayout(fuchsia_ui_composition::LayoutInfo info); + void OnFlatlandError(fuchsia_ui_composition::FlatlandError error); + void Present(); + + fidl::SharedClient flatland_; + fidl::SharedClient parent_viewport_watcher_; + + fuchsia_ui_views::ViewportCreationToken viewport_creation_token_; + fuchsia_ui_views::ViewCreationToken child_view_creation_token_; + ResizeCallback resize_callback_; + + int64_t present_credits_ = 1; + bool pending_present_ = false; + + async_dispatcher_t* const dispatcher_; + + friend class FlatlandViewTest; +}; + +class FlatlandViewProviderService : public fidl::Server { + public: + using CreateView2Callback = fit::function; + + // `dispatcher` must be non-null. + explicit FlatlandViewProviderService(CreateView2Callback create_view_callback, async_dispatcher_t* dispatcher); + + // fuchsia::ui::app::ViewProvider methods. + void CreateViewWithViewRef(CreateViewWithViewRefRequest& request, CreateViewWithViewRefCompleter::Sync& completer) override; + void CreateView2(CreateView2Request& request, CreateView2Completer::Sync& completer) override; + + void HandleViewProviderRequest(fidl::ServerEnd server_end); + + private: + CreateView2Callback create_view_callback_; + fidl::ServerBindingGroup bindings_; + + async_dispatcher_t* const dispatcher_; +}; + +#endif // FUCHSIA_FLATLAND_VIEW_H_ diff --git a/cube/fuchsia/meta/vkcube-on-fb.cml b/cube/fuchsia/meta/vkcube-on-fb.cml new file mode 100644 index 000000000..eaa78aaea --- /dev/null +++ b/cube/fuchsia/meta/vkcube-on-fb.cml @@ -0,0 +1,26 @@ +// Copyright (c) 2025 The Fuchsia Authors. +// +// 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. +{ + include: [ + "//src/lib/vulkan/swapchain/VkLayer_image_pipe_swapchain_fb.shard.cml", + "sys/testing/elf_test_runner.shard.cml", + ], + program: { + binary: "bin/vkcube", + args: [ + "--wsi", + "fuchsia_display", + ], + }, +} diff --git a/cube/fuchsia/meta/vkcube-on-scenic.cml b/cube/fuchsia/meta/vkcube-on-scenic.cml new file mode 100644 index 000000000..cf940b5bf --- /dev/null +++ b/cube/fuchsia/meta/vkcube-on-scenic.cml @@ -0,0 +1,36 @@ +// Copyright (c) 2025 The Fuchsia Authors. +// +// 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. +{ + include: [ "//src/lib/vulkan/swapchain/VkLayer_image_pipe_swapchain.shard.cml" ], + program: { + runner: "elf", + binary: "bin/vkcube", + args: [ + "--wsi", + "fuchsia_scenic", + ], + }, + capabilities: [ + { + protocol: [ "fuchsia.ui.app.ViewProvider" ], + }, + ], + expose: [ + { + protocol: [ "fuchsia.ui.app.ViewProvider" ], + from: "self", + to: "parent", + }, + ], +} diff --git a/cube/macOS/cube/CMakeLists.txt b/cube/macOS/cube/CMakeLists.txt index 1fcc6c45e..3300d6b47 100644 --- a/cube/macOS/cube/CMakeLists.txt +++ b/cube/macOS/cube/CMakeLists.txt @@ -55,11 +55,10 @@ endif() add_dependencies(vkcube MoltenVK_icd-staging-json) # Include demo source code dir because the MacOS cube's Objective-C source includes the "original" cube application C source code. -# Also include the MoltenVK helper files. -target_include_directories(vkcube PRIVATE . ${MOLTENVK_DIR}/MoltenVK/include) +target_include_directories(vkcube PRIVATE ${CMAKE_CURRENT_LIST_DIR}) # We do this so vkcube is linked to an individual library and NOT a framework. -target_link_libraries(vkcube Vulkan::Loader volk::volk_headers "-framework Cocoa -framework QuartzCore") +target_link_libraries(vkcube Vulkan::Loader "-framework Cocoa -framework QuartzCore") # Disable warnings about sprintf target_compile_options(vkcube PRIVATE -Wno-deprecated-declarations) diff --git a/cube/macOS/cubepp/CMakeLists.txt b/cube/macOS/cubepp/CMakeLists.txt index 645d4da9f..cf0516547 100644 --- a/cube/macOS/cubepp/CMakeLists.txt +++ b/cube/macOS/cubepp/CMakeLists.txt @@ -55,11 +55,11 @@ endif() add_dependencies(vkcubepp MoltenVK_icd-staging-json) # Include demo source code dir because the MacOS vkcubepp's Objective-C source includes the "original" vkcubepp application C++ source -# code. Also include the MoltenVK helper files. -target_include_directories(vkcubepp PRIVATE ${CMAKE_CURRENT_LIST_DIR} ${MOLTENVK_DIR}/MoltenVK/include) +# code. +target_include_directories(vkcubepp PRIVATE ${CMAKE_CURRENT_LIST_DIR}) # We do this so vkcubepp is linked to an individual library and NOT a framework. -target_link_libraries(vkcubepp Vulkan::Loader volk::volk_headers "-framework Cocoa -framework QuartzCore") +target_link_libraries(vkcubepp Vulkan::Loader "-framework Cocoa -framework QuartzCore") set_target_properties(vkcubepp PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_LIST_DIR}/Info.plist) diff --git a/cube/wayland_loader.h b/cube/wayland_loader.h new file mode 100644 index 000000000..2afab6e97 --- /dev/null +++ b/cube/wayland_loader.h @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2024 The Khronos Group Inc. + * Copyright (c) 2024 Valve Corporation + * Copyright (c) 2024 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. + * + * Author: Charles Giessen + */ + +#pragma once + +#include +#include +#include + +#include + +typedef struct wl_display *(*PFN_wl_display_connect)(const char *name); +typedef int (*PFN_wl_display_flush)(struct wl_display *display); +typedef int (*PFN_wl_display_dispatch)(struct wl_display *display); +typedef int (*PFN_wl_display_prepare_read)(struct wl_display *display); +typedef int (*PFN_wl_display_dispatch_pending)(struct wl_display *display); +typedef int (*PFN_wl_display_read_events)(struct wl_display *display); +typedef void (*PFN_wl_proxy_marshal)(struct wl_proxy *p, uint32_t opcode, ...); +typedef struct wl_proxy *(*PFN_wl_proxy_marshal_constructor)(struct wl_proxy *proxy, uint32_t opcode, + const struct wl_interface *interface, ...); +typedef struct wl_proxy *(*PFN_wl_proxy_marshal_constructor_versioned)(struct wl_proxy *proxy, uint32_t opcode, + const struct wl_interface *interface, uint32_t version, ...); +typedef struct wl_proxy *(*PFN_wl_proxy_marshal_flags)(struct wl_proxy *proxy, uint32_t opcode, + const struct wl_interface *interface, uint32_t version, uint32_t flags, ...); +typedef uint32_t (*PFN_wl_proxy_get_version)(struct wl_proxy *proxy); +typedef int (*PFN_wl_proxy_add_listener)(struct wl_proxy *proxy, void (**implementation)(void), void *data); +typedef void (*PFN_wl_proxy_destroy)(struct wl_proxy *proxy); +typedef int (*PFN_wl_display_roundtrip)(struct wl_display *display); +typedef void (*PFN_wl_display_disconnect)(struct wl_display *display); + +static PFN_wl_display_connect cube_wl_display_connect = NULL; +static PFN_wl_display_flush cube_wl_display_flush = NULL; +static PFN_wl_display_dispatch cube_wl_display_dispatch = NULL; +static PFN_wl_display_prepare_read cube_wl_display_prepare_read = NULL; +static PFN_wl_display_dispatch_pending cube_wl_display_dispatch_pending = NULL; +static PFN_wl_display_read_events cube_wl_display_read_events = NULL; +static PFN_wl_proxy_marshal cube_wl_proxy_marshal = NULL; +static PFN_wl_proxy_marshal_constructor cube_wl_proxy_marshal_constructor = NULL; +static PFN_wl_proxy_marshal_constructor_versioned cube_wl_proxy_marshal_constructor_versioned = NULL; +static PFN_wl_proxy_marshal_flags cube_wl_proxy_marshal_flags = NULL; +static PFN_wl_proxy_get_version cube_wl_proxy_get_version = NULL; +static PFN_wl_proxy_add_listener cube_wl_proxy_add_listener = NULL; +static PFN_wl_proxy_destroy cube_wl_proxy_destroy = NULL; +static PFN_wl_display_roundtrip cube_wl_display_roundtrip = NULL; +static PFN_wl_display_disconnect cube_wl_display_disconnect = NULL; + +// Use macro's to redefine the PFN's as the functions in client code +#define wl_display_connect cube_wl_display_connect +#define wl_display_flush cube_wl_display_flush +#define wl_display_dispatch cube_wl_display_dispatch +#define wl_display_prepare_read cube_wl_display_prepare_read +#define wl_display_dispatch_pending cube_wl_display_dispatch_pending +#define wl_display_read_events cube_wl_display_read_events +#define wl_proxy_marshal cube_wl_proxy_marshal +#define wl_proxy_marshal_constructor cube_wl_proxy_marshal_constructor +#define wl_proxy_marshal_constructor_versioned cube_wl_proxy_marshal_constructor_versioned +#define wl_proxy_marshal_flags cube_wl_proxy_marshal_flags +#define wl_proxy_get_version cube_wl_proxy_get_version +#define wl_proxy_add_listener cube_wl_proxy_add_listener +#define wl_proxy_destroy cube_wl_proxy_destroy +#define wl_display_roundtrip cube_wl_display_roundtrip +#define wl_display_disconnect cube_wl_display_disconnect + +static inline void *initialize_wayland() { + void *wayland_library = NULL; +#if defined(WAYLAND_LIBRARY) + wayland_library = dlopen(WAYLAND_LIBRARY, RTLD_NOW | RTLD_LOCAL); +#endif + if (NULL == wayland_library) { + wayland_library = dlopen("libwayland-client.so.0", RTLD_NOW | RTLD_LOCAL); + } + if (NULL == wayland_library) { + wayland_library = dlopen("libwayland-client.so", RTLD_NOW | RTLD_LOCAL); + } + if (NULL == wayland_library) { + return NULL; + } + +#ifdef __cplusplus +#define TYPE_CONVERSION(type) reinterpret_cast +#else +#define TYPE_CONVERSION(type) +#endif + cube_wl_display_connect = TYPE_CONVERSION(PFN_wl_display_connect)(dlsym(wayland_library, "wl_display_connect")); + cube_wl_display_flush = TYPE_CONVERSION(PFN_wl_display_flush)(dlsym(wayland_library, "wl_display_flush")); + cube_wl_display_dispatch = TYPE_CONVERSION(PFN_wl_display_dispatch)(dlsym(wayland_library, "wl_display_dispatch")); + cube_wl_display_prepare_read = TYPE_CONVERSION(PFN_wl_display_prepare_read)(dlsym(wayland_library, "wl_display_prepare_read")); + cube_wl_display_dispatch_pending = + TYPE_CONVERSION(PFN_wl_display_dispatch_pending)(dlsym(wayland_library, "wl_display_dispatch_pending")); + cube_wl_display_read_events = TYPE_CONVERSION(PFN_wl_display_read_events)(dlsym(wayland_library, "wl_display_read_events")); + cube_wl_proxy_marshal = TYPE_CONVERSION(PFN_wl_proxy_marshal)(dlsym(wayland_library, "wl_proxy_marshal")); + cube_wl_proxy_marshal_constructor = + TYPE_CONVERSION(PFN_wl_proxy_marshal_constructor)(dlsym(wayland_library, "wl_proxy_marshal_constructor")); + cube_wl_proxy_marshal_constructor_versioned = TYPE_CONVERSION(PFN_wl_proxy_marshal_constructor_versioned)( + dlsym(wayland_library, "wl_proxy_marshal_constructor_versioned")); + cube_wl_proxy_marshal_flags = TYPE_CONVERSION(PFN_wl_proxy_marshal_flags)(dlsym(wayland_library, "wl_proxy_marshal_flags")); + cube_wl_proxy_get_version = TYPE_CONVERSION(PFN_wl_proxy_get_version)(dlsym(wayland_library, "wl_proxy_get_version")); + cube_wl_proxy_add_listener = TYPE_CONVERSION(PFN_wl_proxy_add_listener)(dlsym(wayland_library, "wl_proxy_add_listener")); + cube_wl_proxy_destroy = TYPE_CONVERSION(PFN_wl_proxy_destroy)(dlsym(wayland_library, "wl_proxy_destroy")); + cube_wl_display_roundtrip = TYPE_CONVERSION(PFN_wl_display_roundtrip)(dlsym(wayland_library, "wl_display_roundtrip")); + cube_wl_display_disconnect = TYPE_CONVERSION(PFN_wl_display_disconnect)(dlsym(wayland_library, "wl_display_disconnect")); + + return wayland_library; +} + +#include "xdg-shell-client-header.h" +#include "xdg-decoration-client-header.h" diff --git a/cube/xcb_loader.h b/cube/xcb_loader.h new file mode 100644 index 000000000..a94d5ab56 --- /dev/null +++ b/cube/xcb_loader.h @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2024 The Khronos Group Inc. + * Copyright (c) 2024 Valve Corporation + * Copyright (c) 2024 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. + * + * Author: Charles Giessen + */ + +#pragma once + +#include +#include + +#include + +typedef xcb_void_cookie_t (*PFN_xcb_destroy_window)(xcb_connection_t *c, xcb_window_t window); +typedef void (*PFN_xcb_disconnect)(xcb_connection_t *c); +typedef int (*PFN_xcb_flush)(xcb_connection_t *c); +typedef xcb_generic_event_t *(*PFN_xcb_wait_for_event)(xcb_connection_t *c); +typedef xcb_generic_event_t *(*PFN_xcb_poll_for_event)(xcb_connection_t *c); +typedef uint32_t (*PFN_xcb_generate_id)(xcb_connection_t *c); +typedef xcb_void_cookie_t (*PFN_xcb_create_window)(xcb_connection_t *c, uint8_t depth, xcb_window_t wid, xcb_window_t parent, + int16_t x, int16_t y, uint16_t width, uint16_t height, uint16_t border_width, + uint16_t _class, xcb_visualid_t visual, uint32_t value_mask, + const void *value_list); +typedef xcb_intern_atom_cookie_t (*PFN_xcb_intern_atom)(xcb_connection_t *c, uint8_t only_if_exists, uint16_t name_len, + const char *name); +typedef xcb_intern_atom_reply_t *(*PFN_xcb_intern_atom_reply)(xcb_connection_t *c, xcb_intern_atom_cookie_t cookie /**< */, + xcb_generic_error_t **e); +typedef xcb_void_cookie_t (*PFN_xcb_change_property)(xcb_connection_t *c, uint8_t mode, xcb_window_t window, xcb_atom_t property, + xcb_atom_t type, uint8_t format, uint32_t data_len, const void *data); +typedef xcb_void_cookie_t (*PFN_xcb_map_window)(xcb_connection_t *c, xcb_window_t window); +typedef xcb_void_cookie_t (*PFN_xcb_configure_window)(xcb_connection_t *c, xcb_window_t window, uint16_t value_mask, + const void *value_list); +typedef xcb_connection_t *(*PFN_xcb_connect)(const char *displayname, int *screenp); +typedef int (*PFN_xcb_connection_has_error)(xcb_connection_t *c); +typedef const struct xcb_setup_t *(*PFN_xcb_get_setup)(xcb_connection_t *c); +typedef xcb_screen_iterator_t (*PFN_xcb_setup_roots_iterator)(const xcb_setup_t *R); +typedef void (*PFN_xcb_screen_next)(xcb_screen_iterator_t *i); + +static PFN_xcb_destroy_window cube_xcb_destroy_window = NULL; +static PFN_xcb_disconnect cube_xcb_disconnect = NULL; +static PFN_xcb_flush cube_xcb_flush = NULL; +static PFN_xcb_wait_for_event cube_xcb_wait_for_event = NULL; +static PFN_xcb_poll_for_event cube_xcb_poll_for_event = NULL; +static PFN_xcb_generate_id cube_xcb_generate_id = NULL; +static PFN_xcb_create_window cube_xcb_create_window = NULL; +static PFN_xcb_intern_atom cube_xcb_intern_atom = NULL; +static PFN_xcb_intern_atom_reply cube_xcb_intern_atom_reply = NULL; +static PFN_xcb_change_property cube_xcb_change_property = NULL; +static PFN_xcb_map_window cube_xcb_map_window = NULL; +static PFN_xcb_configure_window cube_xcb_configure_window = NULL; +static PFN_xcb_connect cube_xcb_connect = NULL; +static PFN_xcb_connection_has_error cube_xcb_connection_has_error = NULL; +static PFN_xcb_get_setup cube_xcb_get_setup = NULL; +static PFN_xcb_setup_roots_iterator cube_xcb_setup_roots_iterator = NULL; +static PFN_xcb_screen_next cube_xcb_screen_next = NULL; + +#define xcb_destroy_window cube_xcb_destroy_window +#define xcb_disconnect cube_xcb_disconnect +#define xcb_flush cube_xcb_flush +#define xcb_wait_for_event cube_xcb_wait_for_event +#define xcb_poll_for_event cube_xcb_poll_for_event +#define xcb_generate_id cube_xcb_generate_id +#define xcb_create_window cube_xcb_create_window +#define xcb_intern_atom cube_xcb_intern_atom +#define xcb_intern_atom_reply cube_xcb_intern_atom_reply +#define xcb_change_property cube_xcb_change_property +#define xcb_map_window cube_xcb_map_window +#define xcb_configure_window cube_xcb_configure_window +#define xcb_connect cube_xcb_connect +#define xcb_connection_has_error cube_xcb_connection_has_error +#define xcb_get_setup cube_xcb_get_setup +#define xcb_setup_roots_iterator cube_xcb_setup_roots_iterator +#define xcb_screen_next cube_xcb_screen_next + +void *initialize_xcb() { + void *xcb_library = NULL; +#if defined(XCB_LIBRARY) + xcb_library = dlopen(XCB_LIBRARY, RTLD_NOW | RTLD_LOCAL); +#endif + if (NULL == xcb_library) { + xcb_library = dlopen("libxcb.so.1", RTLD_NOW | RTLD_LOCAL); + } + if (NULL == xcb_library) { + xcb_library = dlopen("libxcb.so", RTLD_NOW | RTLD_LOCAL); + } + if (NULL == xcb_library) { + return NULL; + } + +#ifdef __cplusplus +#define TYPE_CONVERSION(type) reinterpret_cast +#else +#define TYPE_CONVERSION(type) +#endif + + cube_xcb_destroy_window = TYPE_CONVERSION(PFN_xcb_destroy_window)(dlsym(xcb_library, "xcb_destroy_window")); + cube_xcb_disconnect = TYPE_CONVERSION(PFN_xcb_disconnect)(dlsym(xcb_library, "xcb_disconnect")); + cube_xcb_flush = TYPE_CONVERSION(PFN_xcb_flush)(dlsym(xcb_library, "xcb_flush")); + cube_xcb_wait_for_event = TYPE_CONVERSION(PFN_xcb_wait_for_event)(dlsym(xcb_library, "xcb_wait_for_event")); + cube_xcb_poll_for_event = TYPE_CONVERSION(PFN_xcb_poll_for_event)(dlsym(xcb_library, "xcb_poll_for_event")); + cube_xcb_generate_id = TYPE_CONVERSION(PFN_xcb_generate_id)(dlsym(xcb_library, "xcb_generate_id")); + cube_xcb_create_window = TYPE_CONVERSION(PFN_xcb_create_window)(dlsym(xcb_library, "xcb_create_window")); + cube_xcb_intern_atom = TYPE_CONVERSION(PFN_xcb_intern_atom)(dlsym(xcb_library, "xcb_intern_atom")); + cube_xcb_intern_atom_reply = TYPE_CONVERSION(PFN_xcb_intern_atom_reply)(dlsym(xcb_library, "xcb_intern_atom_reply")); + cube_xcb_change_property = TYPE_CONVERSION(PFN_xcb_change_property)(dlsym(xcb_library, "xcb_change_property")); + cube_xcb_map_window = TYPE_CONVERSION(PFN_xcb_map_window)(dlsym(xcb_library, "xcb_map_window")); + cube_xcb_configure_window = TYPE_CONVERSION(PFN_xcb_configure_window)(dlsym(xcb_library, "xcb_configure_window")); + cube_xcb_connect = TYPE_CONVERSION(PFN_xcb_connect)(dlsym(xcb_library, "xcb_connect")); + cube_xcb_connection_has_error = TYPE_CONVERSION(PFN_xcb_connection_has_error)(dlsym(xcb_library, "xcb_connection_has_error")); + cube_xcb_get_setup = TYPE_CONVERSION(PFN_xcb_get_setup)(dlsym(xcb_library, "xcb_get_setup")); + cube_xcb_setup_roots_iterator = TYPE_CONVERSION(PFN_xcb_setup_roots_iterator)(dlsym(xcb_library, "xcb_setup_roots_iterator")); + cube_xcb_screen_next = TYPE_CONVERSION(PFN_xcb_screen_next)(dlsym(xcb_library, "xcb_screen_next")); + + return xcb_library; +} diff --git a/cube/xlib_loader.h b/cube/xlib_loader.h new file mode 100644 index 000000000..c7874d0e7 --- /dev/null +++ b/cube/xlib_loader.h @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2024 The Khronos Group Inc. + * Copyright (c) 2024 Valve Corporation + * Copyright (c) 2024 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. + * + * Author: Charles Giessen + */ + +#pragma once + +#include +#include + +#include + +typedef int (*PFN_XDestroyWindow)(Display*, Window); +typedef Display* (*PFN_XOpenDisplay)(_Xconst char*); +typedef Colormap (*PFN_XCreateColormap)(Display*, Window, Visual*, int); +typedef Window (*PFN_XCreateWindow)(Display*, Window, int, int, unsigned int, unsigned int, unsigned int, int, unsigned int, + Visual*, unsigned long, XSetWindowAttributes*); +typedef int (*PFN_XSelectInput)(Display*, Window, long); +typedef int (*PFN_XMapWindow)(Display*, Window); +typedef Atom (*PFN_XInternAtom)(Display*, _Xconst char*, Bool); +typedef int (*PFN_XNextEvent)(Display*, XEvent*); +typedef int (*PFN_XPending)(Display*); +typedef XVisualInfo* (*PFN_XGetVisualInfo)(Display*, long, XVisualInfo*, int*); +typedef int (*PFN_XCloseDisplay)(Display* /* display */ +); +typedef Status (*PFN_XInitThreads)(void); +typedef int (*PFN_XFlush)(Display* /* display */ +); + +static PFN_XDestroyWindow cube_XDestroyWindow = NULL; +static PFN_XOpenDisplay cube_XOpenDisplay = NULL; +static PFN_XCreateColormap cube_XCreateColormap = NULL; +static PFN_XCreateWindow cube_XCreateWindow = NULL; +static PFN_XSelectInput cube_XSelectInput = NULL; +static PFN_XMapWindow cube_XMapWindow = NULL; +static PFN_XInternAtom cube_XInternAtom = NULL; +static PFN_XNextEvent cube_XNextEvent = NULL; +static PFN_XPending cube_XPending = NULL; +static PFN_XGetVisualInfo cube_XGetVisualInfo = NULL; +static PFN_XCloseDisplay cube_XCloseDisplay = NULL; +static PFN_XInitThreads cube_XInitThreads = NULL; +static PFN_XFlush cube_XFlush = NULL; + +#define XDestroyWindow cube_XDestroyWindow +#define XOpenDisplay cube_XOpenDisplay +#define XCreateColormap cube_XCreateColormap +#define XCreateWindow cube_XCreateWindow +#define XSelectInput cube_XSelectInput +#define XMapWindow cube_XMapWindow +#define XInternAtom cube_XInternAtom +#define XNextEvent cube_XNextEvent +#define XPending cube_XPending +#define XGetVisualInfo cube_XGetVisualInfo +#define XCloseDisplay cube_XCloseDisplay +#define XInitThreads cube_XInitThreads +#define XFlush cube_XFlush + +void* initialize_xlib() { + void* xlib_library = NULL; +#if defined(XLIB_LIBRARY) + xlib_library = dlopen(XLIB_LIBRARY, RTLD_NOW | RTLD_LOCAL); +#endif + if (NULL == xlib_library) { + xlib_library = dlopen("libX11.so.6", RTLD_NOW | RTLD_LOCAL); + } + if (NULL == xlib_library) { + xlib_library = dlopen("libX11.so", RTLD_NOW | RTLD_LOCAL); + } + if (NULL == xlib_library) { + return NULL; + } + +#ifdef __cplusplus +#define TYPE_CONVERSION(type) reinterpret_cast +#else +#define TYPE_CONVERSION(type) +#endif + + cube_XDestroyWindow = TYPE_CONVERSION(PFN_XDestroyWindow)(dlsym(xlib_library, "XDestroyWindow")); + cube_XOpenDisplay = TYPE_CONVERSION(PFN_XOpenDisplay)(dlsym(xlib_library, "XOpenDisplay")); + cube_XCreateColormap = TYPE_CONVERSION(PFN_XCreateColormap)(dlsym(xlib_library, "XCreateColormap")); + cube_XCreateWindow = TYPE_CONVERSION(PFN_XCreateWindow)(dlsym(xlib_library, "XCreateWindow")); + cube_XSelectInput = TYPE_CONVERSION(PFN_XSelectInput)(dlsym(xlib_library, "XSelectInput")); + cube_XMapWindow = TYPE_CONVERSION(PFN_XMapWindow)(dlsym(xlib_library, "XMapWindow")); + cube_XInternAtom = TYPE_CONVERSION(PFN_XInternAtom)(dlsym(xlib_library, "XInternAtom")); + cube_XNextEvent = TYPE_CONVERSION(PFN_XNextEvent)(dlsym(xlib_library, "XNextEvent")); + cube_XPending = TYPE_CONVERSION(PFN_XPending)(dlsym(xlib_library, "XPending")); + cube_XGetVisualInfo = TYPE_CONVERSION(PFN_XGetVisualInfo)(dlsym(xlib_library, "XGetVisualInfo")); + cube_XCloseDisplay = TYPE_CONVERSION(PFN_XCloseDisplay)(dlsym(xlib_library, "XCloseDisplay")); + cube_XInitThreads = TYPE_CONVERSION(PFN_XInitThreads)(dlsym(xlib_library, "XInitThreads")); + cube_XFlush = TYPE_CONVERSION(PFN_XFlush)(dlsym(xlib_library, "XFlush")); + + return xlib_library; +} diff --git a/icd/VkICD_mock_icd.json.in b/icd/VkICD_mock_icd.json.in index 867dabc43..490db3b86 100644 --- a/icd/VkICD_mock_icd.json.in +++ b/icd/VkICD_mock_icd.json.in @@ -2,6 +2,6 @@ "file_format_version": "1.0.1", "ICD": { "library_path": "@JSON_LIBRARY_PATH@", - "api_version": "1.3.293" + "api_version": "1.4.307" } } \ No newline at end of file diff --git a/icd/generated/function_declarations.h b/icd/generated/function_declarations.h index 4450c2c91..02dfc0aa7 100644 --- a/icd/generated/function_declarations.h +++ b/icd/generated/function_declarations.h @@ -1,5 +1,5 @@ /* -** Copyright (c) 2015-2024 The Khronos Group Inc. +** Copyright (c) 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. @@ -71,6 +71,7 @@ static const std::unordered_map instance_extension_map = {"VK_GOOGLE_surfaceless_query", 2}, {"VK_LUNARG_direct_driver_loading", 1}, {"VK_EXT_layer_settings", 2}, + {"VK_NV_display_stereo", 1}, }; // Map of device extension name to version static const std::unordered_map device_extension_map = { @@ -89,8 +90,8 @@ static const std::unordered_map device_extension_map = { {"VK_AMD_gcn_shader", 1}, {"VK_NV_dedicated_allocation", 1}, {"VK_EXT_transform_feedback", 1}, - {"VK_NVX_binary_import", 1}, - {"VK_NVX_image_view_handle", 2}, + {"VK_NVX_binary_import", 2}, + {"VK_NVX_image_view_handle", 3}, {"VK_AMD_draw_indirect_count", 2}, {"VK_AMD_negative_viewport_height", 1}, {"VK_AMD_gpu_shader_half_float", 2}, @@ -158,7 +159,7 @@ static const std::unordered_map device_extension_map = { {"VK_EXT_sampler_filter_minmax", 2}, {"VK_KHR_storage_buffer_storage_class", 1}, {"VK_AMD_gpu_shader_int16", 2}, - {"VK_AMDX_shader_enqueue", 1}, + {"VK_AMDX_shader_enqueue", 2}, {"VK_AMD_mixed_attachment_samples", 1}, {"VK_AMD_shader_fragment_mask", 1}, {"VK_EXT_inline_uniform_block", 1}, @@ -315,6 +316,7 @@ static const std::unordered_map device_extension_map = { {"VK_EXT_depth_clip_control", 1}, {"VK_EXT_primitive_topology_list_restart", 1}, {"VK_KHR_format_feature_flags2", 2}, + {"VK_EXT_present_mode_fifo_latest_ready", 1}, {"VK_FUCHSIA_external_memory", 1}, {"VK_FUCHSIA_external_semaphore", 1}, {"VK_FUCHSIA_buffer_collection", 2}, @@ -352,6 +354,7 @@ static const std::unordered_map device_extension_map = { {"VK_NV_copy_memory_indirect", 1}, {"VK_NV_memory_decompression", 1}, {"VK_NV_device_generated_commands_compute", 2}, + {"VK_NV_ray_tracing_linear_swept_spheres", 1}, {"VK_NV_linear_color_attachment", 1}, {"VK_KHR_shader_maximal_reconvergence", 1}, {"VK_EXT_image_compression_control_swapchain", 1}, @@ -370,10 +373,12 @@ static const std::unordered_map device_extension_map = { {"VK_AMD_anti_lag", 1}, {"VK_KHR_ray_tracing_position_fetch", 1}, {"VK_EXT_shader_object", 1}, + {"VK_KHR_pipeline_binary", 1}, {"VK_QCOM_tile_properties", 1}, {"VK_SEC_amigo_profiling", 1}, {"VK_QCOM_multiview_per_view_viewports", 1}, {"VK_NV_ray_tracing_invocation_reorder", 1}, + {"VK_NV_cooperative_vector", 4}, {"VK_NV_extended_sparse_address_space", 1}, {"VK_EXT_mutable_descriptor_type", 1}, {"VK_EXT_legacy_vertex_attributes", 1}, @@ -383,7 +388,9 @@ static const std::unordered_map device_extension_map = { {"VK_NV_low_latency2", 2}, {"VK_KHR_cooperative_matrix", 2}, {"VK_QCOM_multiview_per_view_render_areas", 1}, + {"VK_KHR_compute_shader_derivatives", 1}, {"VK_KHR_video_decode_av1", 1}, + {"VK_KHR_video_encode_av1", 1}, {"VK_KHR_video_maintenance1", 1}, {"VK_NV_per_stage_descriptor_set", 1}, {"VK_QCOM_image_processing2", 1}, @@ -402,6 +409,7 @@ static const std::unordered_map device_extension_map = { {"VK_KHR_shader_expect_assume", 1}, {"VK_KHR_maintenance6", 1}, {"VK_NV_descriptor_pool_overallocation", 1}, + {"VK_KHR_video_encode_quantization_map", 2}, {"VK_NV_raw_access_chains", 1}, {"VK_KHR_shader_relaxed_extended_instruction", 1}, {"VK_NV_command_buffer_inheritance", 1}, @@ -409,7 +417,19 @@ static const std::unordered_map device_extension_map = { {"VK_NV_shader_atomic_float16_vector", 1}, {"VK_EXT_shader_replicated_composites", 1}, {"VK_NV_ray_tracing_validation", 1}, + {"VK_NV_cluster_acceleration_structure", 2}, + {"VK_NV_partitioned_acceleration_structure", 1}, + {"VK_EXT_device_generated_commands", 1}, + {"VK_KHR_maintenance8", 1}, {"VK_MESA_image_alignment_control", 1}, + {"VK_EXT_depth_clamp_control", 1}, + {"VK_KHR_video_maintenance2", 1}, + {"VK_HUAWEI_hdr_vivid", 1}, + {"VK_NV_cooperative_matrix2", 1}, + {"VK_ARM_pipeline_opacity_micromap", 1}, + {"VK_EXT_external_memory_metal", 1}, + {"VK_KHR_depth_clamp_zero_one", 1}, + {"VK_EXT_vertex_attribute_robustness", 1}, }; @@ -1609,6 +1629,100 @@ static VKAPI_ATTR void VKAPI_CALL GetDeviceImageSparseMemoryRequirements( VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); +static VKAPI_ATTR void VKAPI_CALL CmdSetLineStipple( + VkCommandBuffer commandBuffer, + uint32_t lineStippleFactor, + uint16_t lineStipplePattern); + +static VKAPI_ATTR VkResult VKAPI_CALL MapMemory2( + VkDevice device, + const VkMemoryMapInfo* pMemoryMapInfo, + void** ppData); + +static VKAPI_ATTR VkResult VKAPI_CALL UnmapMemory2( + VkDevice device, + const VkMemoryUnmapInfo* pMemoryUnmapInfo); + +static VKAPI_ATTR void VKAPI_CALL CmdBindIndexBuffer2( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkDeviceSize size, + VkIndexType indexType); + +static VKAPI_ATTR void VKAPI_CALL GetRenderingAreaGranularity( + VkDevice device, + const VkRenderingAreaInfo* pRenderingAreaInfo, + VkExtent2D* pGranularity); + +static VKAPI_ATTR void VKAPI_CALL GetDeviceImageSubresourceLayout( + VkDevice device, + const VkDeviceImageSubresourceInfo* pInfo, + VkSubresourceLayout2* pLayout); + +static VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout2( + VkDevice device, + VkImage image, + const VkImageSubresource2* pSubresource, + VkSubresourceLayout2* pLayout); + +static VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSet( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t set, + uint32_t descriptorWriteCount, + const VkWriteDescriptorSet* pDescriptorWrites); + +static VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplate( + VkCommandBuffer commandBuffer, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + VkPipelineLayout layout, + uint32_t set, + const void* pData); + +static VKAPI_ATTR void VKAPI_CALL CmdSetRenderingAttachmentLocations( + VkCommandBuffer commandBuffer, + const VkRenderingAttachmentLocationInfo* pLocationInfo); + +static VKAPI_ATTR void VKAPI_CALL CmdSetRenderingInputAttachmentIndices( + VkCommandBuffer commandBuffer, + const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo); + +static VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets2( + VkCommandBuffer commandBuffer, + const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo); + +static VKAPI_ATTR void VKAPI_CALL CmdPushConstants2( + VkCommandBuffer commandBuffer, + const VkPushConstantsInfo* pPushConstantsInfo); + +static VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSet2( + VkCommandBuffer commandBuffer, + const VkPushDescriptorSetInfo* pPushDescriptorSetInfo); + +static VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplate2( + VkCommandBuffer commandBuffer, + const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo); + +static VKAPI_ATTR VkResult VKAPI_CALL CopyMemoryToImage( + VkDevice device, + const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo); + +static VKAPI_ATTR VkResult VKAPI_CALL CopyImageToMemory( + VkDevice device, + const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo); + +static VKAPI_ATTR VkResult VKAPI_CALL CopyImageToImage( + VkDevice device, + const VkCopyImageToImageInfo* pCopyImageToImageInfo); + +static VKAPI_ATTR VkResult VKAPI_CALL TransitionImageLayout( + VkDevice device, + uint32_t transitionCount, + const VkHostImageLayoutTransitionInfo* pTransitions); + + static VKAPI_ATTR void VKAPI_CALL DestroySurfaceKHR( VkInstance instance, VkSurfaceKHR surface, @@ -2279,11 +2393,11 @@ static VKAPI_ATTR void VKAPI_CALL CmdSetFragmentShadingRateKHR( static VKAPI_ATTR void VKAPI_CALL CmdSetRenderingAttachmentLocationsKHR( VkCommandBuffer commandBuffer, - const VkRenderingAttachmentLocationInfoKHR* pLocationInfo); + const VkRenderingAttachmentLocationInfo* pLocationInfo); static VKAPI_ATTR void VKAPI_CALL CmdSetRenderingInputAttachmentIndicesKHR( VkCommandBuffer commandBuffer, - const VkRenderingInputAttachmentIndexInfoKHR* pInputAttachmentIndexInfo); + const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo); @@ -2355,12 +2469,12 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutableInternalRepresentatio static VKAPI_ATTR VkResult VKAPI_CALL MapMemory2KHR( VkDevice device, - const VkMemoryMapInfoKHR* pMemoryMapInfo, + const VkMemoryMapInfo* pMemoryMapInfo, void** ppData); static VKAPI_ATTR VkResult VKAPI_CALL UnmapMemory2KHR( VkDevice device, - const VkMemoryUnmapInfoKHR* pMemoryUnmapInfo); + const VkMemoryUnmapInfo* pMemoryUnmapInfo); @@ -2416,18 +2530,6 @@ static VKAPI_ATTR VkResult VKAPI_CALL QueueSubmit2KHR( const VkSubmitInfo2* pSubmits, VkFence fence); -static VKAPI_ATTR void VKAPI_CALL CmdWriteBufferMarker2AMD( - VkCommandBuffer commandBuffer, - VkPipelineStageFlags2 stage, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - uint32_t marker); - -static VKAPI_ATTR void VKAPI_CALL GetQueueCheckpointData2NV( - VkQueue queue, - uint32_t* pCheckpointDataCount, - VkCheckpointData2NV* pCheckpointData); - @@ -2493,20 +2595,49 @@ static VKAPI_ATTR void VKAPI_CALL CmdBindIndexBuffer2KHR( static VKAPI_ATTR void VKAPI_CALL GetRenderingAreaGranularityKHR( VkDevice device, - const VkRenderingAreaInfoKHR* pRenderingAreaInfo, + const VkRenderingAreaInfo* pRenderingAreaInfo, VkExtent2D* pGranularity); static VKAPI_ATTR void VKAPI_CALL GetDeviceImageSubresourceLayoutKHR( VkDevice device, - const VkDeviceImageSubresourceInfoKHR* pInfo, - VkSubresourceLayout2KHR* pLayout); + const VkDeviceImageSubresourceInfo* pInfo, + VkSubresourceLayout2* pLayout); static VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout2KHR( VkDevice device, VkImage image, - const VkImageSubresource2KHR* pSubresource, - VkSubresourceLayout2KHR* pLayout); + const VkImageSubresource2* pSubresource, + VkSubresourceLayout2* pLayout); + + + +static VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineBinariesKHR( + VkDevice device, + const VkPipelineBinaryCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkPipelineBinaryHandlesInfoKHR* pBinaries); + +static VKAPI_ATTR void VKAPI_CALL DestroyPipelineBinaryKHR( + VkDevice device, + VkPipelineBinaryKHR pipelineBinary, + const VkAllocationCallbacks* pAllocator); + +static VKAPI_ATTR VkResult VKAPI_CALL GetPipelineKeyKHR( + VkDevice device, + const VkPipelineCreateInfoKHR* pPipelineCreateInfo, + VkPipelineBinaryKeyKHR* pPipelineKey); +static VKAPI_ATTR VkResult VKAPI_CALL GetPipelineBinaryDataKHR( + VkDevice device, + const VkPipelineBinaryDataInfoKHR* pInfo, + VkPipelineBinaryKeyKHR* pPipelineBinaryKey, + size_t* pPipelineBinaryDataSize, + void* pPipelineBinaryData); + +static VKAPI_ATTR VkResult VKAPI_CALL ReleaseCapturedPipelineDataKHR( + VkDevice device, + const VkReleaseCapturedPipelineDataInfoKHR* pInfo, + const VkAllocationCallbacks* pAllocator); static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeMatrixPropertiesKHR( @@ -2521,6 +2652,8 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeMatrixProperti + + static VKAPI_ATTR void VKAPI_CALL CmdSetLineStippleKHR( VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, @@ -2543,19 +2676,19 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetCalibratedTimestampsKHR( static VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets2KHR( VkCommandBuffer commandBuffer, - const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo); + const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo); static VKAPI_ATTR void VKAPI_CALL CmdPushConstants2KHR( VkCommandBuffer commandBuffer, - const VkPushConstantsInfoKHR* pPushConstantsInfo); + const VkPushConstantsInfo* pPushConstantsInfo); static VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSet2KHR( VkCommandBuffer commandBuffer, - const VkPushDescriptorSetInfoKHR* pPushDescriptorSetInfo); + const VkPushDescriptorSetInfo* pPushDescriptorSetInfo); static VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplate2KHR( VkCommandBuffer commandBuffer, - const VkPushDescriptorSetWithTemplateInfoKHR* pPushDescriptorSetWithTemplateInfo); + const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo); static VKAPI_ATTR void VKAPI_CALL CmdSetDescriptorBufferOffsets2EXT( VkCommandBuffer commandBuffer, @@ -2568,6 +2701,10 @@ static VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorBufferEmbeddedSamplers2EXT( + + + + static VKAPI_ATTR VkResult VKAPI_CALL CreateDebugReportCallbackEXT( VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, @@ -2694,6 +2831,10 @@ static VKAPI_ATTR uint32_t VKAPI_CALL GetImageViewHandleNVX( VkDevice device, const VkImageViewHandleInfoNVX* pInfo); +static VKAPI_ATTR uint64_t VKAPI_CALL GetImageViewHandle64NVX( + VkDevice device, + const VkImageViewHandleInfoNVX* pInfo); + static VKAPI_ATTR VkResult VKAPI_CALL GetImageViewAddressNVX( VkDevice device, VkImageView imageView, @@ -2996,21 +3137,26 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetExecutionGraphPipelineNodeIndexAMDX( static VKAPI_ATTR void VKAPI_CALL CmdInitializeGraphScratchMemoryAMDX( VkCommandBuffer commandBuffer, - VkDeviceAddress scratch); + VkPipeline executionGraph, + VkDeviceAddress scratch, + VkDeviceSize scratchSize); static VKAPI_ATTR void VKAPI_CALL CmdDispatchGraphAMDX( VkCommandBuffer commandBuffer, VkDeviceAddress scratch, + VkDeviceSize scratchSize, const VkDispatchGraphCountInfoAMDX* pCountInfo); static VKAPI_ATTR void VKAPI_CALL CmdDispatchGraphIndirectAMDX( VkCommandBuffer commandBuffer, VkDeviceAddress scratch, + VkDeviceSize scratchSize, const VkDispatchGraphCountInfoAMDX* pCountInfo); static VKAPI_ATTR void VKAPI_CALL CmdDispatchGraphIndirectCountAMDX( VkCommandBuffer commandBuffer, VkDeviceAddress scratch, + VkDeviceSize scratchSize, VkDeviceAddress countInfo); #endif /* VK_ENABLE_BETA_EXTENSIONS */ @@ -3202,6 +3348,13 @@ static VKAPI_ATTR void VKAPI_CALL CmdWriteBufferMarkerAMD( VkDeviceSize dstOffset, uint32_t marker); +static VKAPI_ATTR void VKAPI_CALL CmdWriteBufferMarker2AMD( + VkCommandBuffer commandBuffer, + VkPipelineStageFlags2 stage, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + uint32_t marker); + static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCalibrateableTimeDomainsEXT( @@ -3272,6 +3425,11 @@ static VKAPI_ATTR void VKAPI_CALL GetQueueCheckpointDataNV( uint32_t* pCheckpointDataCount, VkCheckpointDataNV* pCheckpointData); +static VKAPI_ATTR void VKAPI_CALL GetQueueCheckpointData2NV( + VkQueue queue, + uint32_t* pCheckpointDataCount, + VkCheckpointData2NV* pCheckpointData); + static VKAPI_ATTR VkResult VKAPI_CALL InitializePerformanceApiINTEL( @@ -3482,26 +3640,26 @@ static VKAPI_ATTR void VKAPI_CALL CmdSetStencilOpEXT( static VKAPI_ATTR VkResult VKAPI_CALL CopyMemoryToImageEXT( VkDevice device, - const VkCopyMemoryToImageInfoEXT* pCopyMemoryToImageInfo); + const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo); static VKAPI_ATTR VkResult VKAPI_CALL CopyImageToMemoryEXT( VkDevice device, - const VkCopyImageToMemoryInfoEXT* pCopyImageToMemoryInfo); + const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo); static VKAPI_ATTR VkResult VKAPI_CALL CopyImageToImageEXT( VkDevice device, - const VkCopyImageToImageInfoEXT* pCopyImageToImageInfo); + const VkCopyImageToImageInfo* pCopyImageToImageInfo); static VKAPI_ATTR VkResult VKAPI_CALL TransitionImageLayoutEXT( VkDevice device, uint32_t transitionCount, - const VkHostImageLayoutTransitionInfoEXT* pTransitions); + const VkHostImageLayoutTransitionInfo* pTransitions); static VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout2EXT( VkDevice device, VkImage image, - const VkImageSubresource2KHR* pSubresource, - VkSubresourceLayout2KHR* pLayout); + const VkImageSubresource2* pSubresource, + VkSubresourceLayout2* pLayout); @@ -3765,6 +3923,7 @@ static VKAPI_ATTR void VKAPI_CALL CmdSetVertexInputEXT( + #ifdef VK_USE_PLATFORM_FUCHSIA static VKAPI_ATTR VkResult VKAPI_CALL GetMemoryZirconHandleFUCHSIA( @@ -4082,6 +4241,7 @@ static VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetPipelineIndirectDeviceAddressNV( + static VKAPI_ATTR void VKAPI_CALL CmdSetDepthClampEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthClampEnable); @@ -4297,6 +4457,11 @@ static VKAPI_ATTR void VKAPI_CALL CmdBindShadersEXT( const VkShaderStageFlagBits* pStages, const VkShaderEXT* pShaders); +static VKAPI_ATTR void VKAPI_CALL CmdSetDepthClampRangeEXT( + VkCommandBuffer commandBuffer, + VkDepthClampModeEXT depthClampMode, + const VkDepthClampRangeEXT* pDepthClampRange); + static VKAPI_ATTR VkResult VKAPI_CALL GetFramebufferTilePropertiesQCOM( VkDevice device, @@ -4313,6 +4478,21 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetDynamicRenderingTilePropertiesQCOM( +static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeVectorPropertiesNV( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkCooperativeVectorPropertiesNV* pProperties); + +static VKAPI_ATTR VkResult VKAPI_CALL ConvertCooperativeVectorMatrixNV( + VkDevice device, + const VkConvertCooperativeVectorMatrixInfoNV* pInfo); + +static VKAPI_ATTR void VKAPI_CALL CmdConvertCooperativeVectorMatrixNV( + VkCommandBuffer commandBuffer, + uint32_t infoCount, + const VkConvertCooperativeVectorMatrixInfoNV* pInfos); + + @@ -4372,6 +4552,101 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetScreenBufferPropertiesQNX( +static VKAPI_ATTR void VKAPI_CALL GetClusterAccelerationStructureBuildSizesNV( + VkDevice device, + const VkClusterAccelerationStructureInputInfoNV* pInfo, + VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo); + +static VKAPI_ATTR void VKAPI_CALL CmdBuildClusterAccelerationStructureIndirectNV( + VkCommandBuffer commandBuffer, + const VkClusterAccelerationStructureCommandsInfoNV* pCommandInfos); + + +static VKAPI_ATTR void VKAPI_CALL GetPartitionedAccelerationStructuresBuildSizesNV( + VkDevice device, + const VkPartitionedAccelerationStructureInstancesInputNV* pInfo, + VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo); + +static VKAPI_ATTR void VKAPI_CALL CmdBuildPartitionedAccelerationStructuresNV( + VkCommandBuffer commandBuffer, + const VkBuildPartitionedAccelerationStructureInfoNV* pBuildInfo); + + +static VKAPI_ATTR void VKAPI_CALL GetGeneratedCommandsMemoryRequirementsEXT( + VkDevice device, + const VkGeneratedCommandsMemoryRequirementsInfoEXT* pInfo, + VkMemoryRequirements2* pMemoryRequirements); + +static VKAPI_ATTR void VKAPI_CALL CmdPreprocessGeneratedCommandsEXT( + VkCommandBuffer commandBuffer, + const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo, + VkCommandBuffer stateCommandBuffer); + +static VKAPI_ATTR void VKAPI_CALL CmdExecuteGeneratedCommandsEXT( + VkCommandBuffer commandBuffer, + VkBool32 isPreprocessed, + const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo); + +static VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutEXT( + VkDevice device, + const VkIndirectCommandsLayoutCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkIndirectCommandsLayoutEXT* pIndirectCommandsLayout); + +static VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutEXT( + VkDevice device, + VkIndirectCommandsLayoutEXT indirectCommandsLayout, + const VkAllocationCallbacks* pAllocator); + +static VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectExecutionSetEXT( + VkDevice device, + const VkIndirectExecutionSetCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkIndirectExecutionSetEXT* pIndirectExecutionSet); + +static VKAPI_ATTR void VKAPI_CALL DestroyIndirectExecutionSetEXT( + VkDevice device, + VkIndirectExecutionSetEXT indirectExecutionSet, + const VkAllocationCallbacks* pAllocator); + +static VKAPI_ATTR void VKAPI_CALL UpdateIndirectExecutionSetPipelineEXT( + VkDevice device, + VkIndirectExecutionSetEXT indirectExecutionSet, + uint32_t executionSetWriteCount, + const VkWriteIndirectExecutionSetPipelineEXT* pExecutionSetWrites); + +static VKAPI_ATTR void VKAPI_CALL UpdateIndirectExecutionSetShaderEXT( + VkDevice device, + VkIndirectExecutionSetEXT indirectExecutionSet, + uint32_t executionSetWriteCount, + const VkWriteIndirectExecutionSetShaderEXT* pExecutionSetWrites); + + + + + +static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkCooperativeMatrixFlexibleDimensionsPropertiesNV* pProperties); + + +#ifdef VK_USE_PLATFORM_METAL_EXT + +static VKAPI_ATTR VkResult VKAPI_CALL GetMemoryMetalHandleEXT( + VkDevice device, + const VkMemoryGetMetalHandleInfoEXT* pGetMetalHandleInfo, + void** pHandle); + +static VKAPI_ATTR VkResult VKAPI_CALL GetMemoryMetalHandlePropertiesEXT( + VkDevice device, + VkExternalMemoryHandleTypeFlagBits handleType, + const void* pHandle, + VkMemoryMetalHandlePropertiesEXT* pMemoryMetalHandleProperties); +#endif /* VK_USE_PLATFORM_METAL_EXT */ + + + static VKAPI_ATTR VkResult VKAPI_CALL CreateAccelerationStructureKHR( VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo, @@ -4751,6 +5026,25 @@ static const std::unordered_map name_to_funcptr_map = { {"vkGetDeviceBufferMemoryRequirements", (void*)GetDeviceBufferMemoryRequirements}, {"vkGetDeviceImageMemoryRequirements", (void*)GetDeviceImageMemoryRequirements}, {"vkGetDeviceImageSparseMemoryRequirements", (void*)GetDeviceImageSparseMemoryRequirements}, + {"vkCmdSetLineStipple", (void*)CmdSetLineStipple}, + {"vkMapMemory2", (void*)MapMemory2}, + {"vkUnmapMemory2", (void*)UnmapMemory2}, + {"vkCmdBindIndexBuffer2", (void*)CmdBindIndexBuffer2}, + {"vkGetRenderingAreaGranularity", (void*)GetRenderingAreaGranularity}, + {"vkGetDeviceImageSubresourceLayout", (void*)GetDeviceImageSubresourceLayout}, + {"vkGetImageSubresourceLayout2", (void*)GetImageSubresourceLayout2}, + {"vkCmdPushDescriptorSet", (void*)CmdPushDescriptorSet}, + {"vkCmdPushDescriptorSetWithTemplate", (void*)CmdPushDescriptorSetWithTemplate}, + {"vkCmdSetRenderingAttachmentLocations", (void*)CmdSetRenderingAttachmentLocations}, + {"vkCmdSetRenderingInputAttachmentIndices", (void*)CmdSetRenderingInputAttachmentIndices}, + {"vkCmdBindDescriptorSets2", (void*)CmdBindDescriptorSets2}, + {"vkCmdPushConstants2", (void*)CmdPushConstants2}, + {"vkCmdPushDescriptorSet2", (void*)CmdPushDescriptorSet2}, + {"vkCmdPushDescriptorSetWithTemplate2", (void*)CmdPushDescriptorSetWithTemplate2}, + {"vkCopyMemoryToImage", (void*)CopyMemoryToImage}, + {"vkCopyImageToMemory", (void*)CopyImageToMemory}, + {"vkCopyImageToImage", (void*)CopyImageToImage}, + {"vkTransitionImageLayout", (void*)TransitionImageLayout}, {"vkDestroySurfaceKHR", (void*)DestroySurfaceKHR}, {"vkGetPhysicalDeviceSurfaceSupportKHR", (void*)GetPhysicalDeviceSurfaceSupportKHR}, {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", (void*)GetPhysicalDeviceSurfaceCapabilitiesKHR}, @@ -4914,8 +5208,6 @@ static const std::unordered_map name_to_funcptr_map = { {"vkCmdPipelineBarrier2KHR", (void*)CmdPipelineBarrier2KHR}, {"vkCmdWriteTimestamp2KHR", (void*)CmdWriteTimestamp2KHR}, {"vkQueueSubmit2KHR", (void*)QueueSubmit2KHR}, - {"vkCmdWriteBufferMarker2AMD", (void*)CmdWriteBufferMarker2AMD}, - {"vkGetQueueCheckpointData2NV", (void*)GetQueueCheckpointData2NV}, {"vkCmdCopyBuffer2KHR", (void*)CmdCopyBuffer2KHR}, {"vkCmdCopyImage2KHR", (void*)CmdCopyImage2KHR}, {"vkCmdCopyBufferToImage2KHR", (void*)CmdCopyBufferToImage2KHR}, @@ -4930,6 +5222,11 @@ static const std::unordered_map name_to_funcptr_map = { {"vkGetRenderingAreaGranularityKHR", (void*)GetRenderingAreaGranularityKHR}, {"vkGetDeviceImageSubresourceLayoutKHR", (void*)GetDeviceImageSubresourceLayoutKHR}, {"vkGetImageSubresourceLayout2KHR", (void*)GetImageSubresourceLayout2KHR}, + {"vkCreatePipelineBinariesKHR", (void*)CreatePipelineBinariesKHR}, + {"vkDestroyPipelineBinaryKHR", (void*)DestroyPipelineBinaryKHR}, + {"vkGetPipelineKeyKHR", (void*)GetPipelineKeyKHR}, + {"vkGetPipelineBinaryDataKHR", (void*)GetPipelineBinaryDataKHR}, + {"vkReleaseCapturedPipelineDataKHR", (void*)ReleaseCapturedPipelineDataKHR}, {"vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR", (void*)GetPhysicalDeviceCooperativeMatrixPropertiesKHR}, {"vkCmdSetLineStippleKHR", (void*)CmdSetLineStippleKHR}, {"vkGetPhysicalDeviceCalibrateableTimeDomainsKHR", (void*)GetPhysicalDeviceCalibrateableTimeDomainsKHR}, @@ -4960,6 +5257,7 @@ static const std::unordered_map name_to_funcptr_map = { {"vkDestroyCuFunctionNVX", (void*)DestroyCuFunctionNVX}, {"vkCmdCuLaunchKernelNVX", (void*)CmdCuLaunchKernelNVX}, {"vkGetImageViewHandleNVX", (void*)GetImageViewHandleNVX}, + {"vkGetImageViewHandle64NVX", (void*)GetImageViewHandle64NVX}, {"vkGetImageViewAddressNVX", (void*)GetImageViewAddressNVX}, {"vkCmdDrawIndirectCountAMD", (void*)CmdDrawIndirectCountAMD}, {"vkCmdDrawIndexedIndirectCountAMD", (void*)CmdDrawIndexedIndirectCountAMD}, @@ -5064,6 +5362,7 @@ static const std::unordered_map name_to_funcptr_map = { {"vkCompileDeferredNV", (void*)CompileDeferredNV}, {"vkGetMemoryHostPointerPropertiesEXT", (void*)GetMemoryHostPointerPropertiesEXT}, {"vkCmdWriteBufferMarkerAMD", (void*)CmdWriteBufferMarkerAMD}, + {"vkCmdWriteBufferMarker2AMD", (void*)CmdWriteBufferMarker2AMD}, {"vkGetPhysicalDeviceCalibrateableTimeDomainsEXT", (void*)GetPhysicalDeviceCalibrateableTimeDomainsEXT}, {"vkGetCalibratedTimestampsEXT", (void*)GetCalibratedTimestampsEXT}, {"vkCmdDrawMeshTasksNV", (void*)CmdDrawMeshTasksNV}, @@ -5073,6 +5372,7 @@ static const std::unordered_map name_to_funcptr_map = { {"vkCmdSetExclusiveScissorNV", (void*)CmdSetExclusiveScissorNV}, {"vkCmdSetCheckpointNV", (void*)CmdSetCheckpointNV}, {"vkGetQueueCheckpointDataNV", (void*)GetQueueCheckpointDataNV}, + {"vkGetQueueCheckpointData2NV", (void*)GetQueueCheckpointData2NV}, {"vkInitializePerformanceApiINTEL", (void*)InitializePerformanceApiINTEL}, {"vkUninitializePerformanceApiINTEL", (void*)UninitializePerformanceApiINTEL}, {"vkCmdSetPerformanceMarkerINTEL", (void*)CmdSetPerformanceMarkerINTEL}, @@ -5289,8 +5589,12 @@ static const std::unordered_map name_to_funcptr_map = { {"vkDestroyShaderEXT", (void*)DestroyShaderEXT}, {"vkGetShaderBinaryDataEXT", (void*)GetShaderBinaryDataEXT}, {"vkCmdBindShadersEXT", (void*)CmdBindShadersEXT}, + {"vkCmdSetDepthClampRangeEXT", (void*)CmdSetDepthClampRangeEXT}, {"vkGetFramebufferTilePropertiesQCOM", (void*)GetFramebufferTilePropertiesQCOM}, {"vkGetDynamicRenderingTilePropertiesQCOM", (void*)GetDynamicRenderingTilePropertiesQCOM}, + {"vkGetPhysicalDeviceCooperativeVectorPropertiesNV", (void*)GetPhysicalDeviceCooperativeVectorPropertiesNV}, + {"vkConvertCooperativeVectorMatrixNV", (void*)ConvertCooperativeVectorMatrixNV}, + {"vkCmdConvertCooperativeVectorMatrixNV", (void*)CmdConvertCooperativeVectorMatrixNV}, {"vkSetLatencySleepModeNV", (void*)SetLatencySleepModeNV}, {"vkLatencySleepNV", (void*)LatencySleepNV}, {"vkSetLatencyMarkerNV", (void*)SetLatencyMarkerNV}, @@ -5299,6 +5603,26 @@ static const std::unordered_map name_to_funcptr_map = { {"vkCmdSetAttachmentFeedbackLoopEnableEXT", (void*)CmdSetAttachmentFeedbackLoopEnableEXT}, #ifdef VK_USE_PLATFORM_SCREEN_QNX {"vkGetScreenBufferPropertiesQNX", (void*)GetScreenBufferPropertiesQNX}, +#endif + {"vkGetClusterAccelerationStructureBuildSizesNV", (void*)GetClusterAccelerationStructureBuildSizesNV}, + {"vkCmdBuildClusterAccelerationStructureIndirectNV", (void*)CmdBuildClusterAccelerationStructureIndirectNV}, + {"vkGetPartitionedAccelerationStructuresBuildSizesNV", (void*)GetPartitionedAccelerationStructuresBuildSizesNV}, + {"vkCmdBuildPartitionedAccelerationStructuresNV", (void*)CmdBuildPartitionedAccelerationStructuresNV}, + {"vkGetGeneratedCommandsMemoryRequirementsEXT", (void*)GetGeneratedCommandsMemoryRequirementsEXT}, + {"vkCmdPreprocessGeneratedCommandsEXT", (void*)CmdPreprocessGeneratedCommandsEXT}, + {"vkCmdExecuteGeneratedCommandsEXT", (void*)CmdExecuteGeneratedCommandsEXT}, + {"vkCreateIndirectCommandsLayoutEXT", (void*)CreateIndirectCommandsLayoutEXT}, + {"vkDestroyIndirectCommandsLayoutEXT", (void*)DestroyIndirectCommandsLayoutEXT}, + {"vkCreateIndirectExecutionSetEXT", (void*)CreateIndirectExecutionSetEXT}, + {"vkDestroyIndirectExecutionSetEXT", (void*)DestroyIndirectExecutionSetEXT}, + {"vkUpdateIndirectExecutionSetPipelineEXT", (void*)UpdateIndirectExecutionSetPipelineEXT}, + {"vkUpdateIndirectExecutionSetShaderEXT", (void*)UpdateIndirectExecutionSetShaderEXT}, + {"vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV", (void*)GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV}, +#ifdef VK_USE_PLATFORM_METAL_EXT + {"vkGetMemoryMetalHandleEXT", (void*)GetMemoryMetalHandleEXT}, +#endif +#ifdef VK_USE_PLATFORM_METAL_EXT + {"vkGetMemoryMetalHandlePropertiesEXT", (void*)GetMemoryMetalHandlePropertiesEXT}, #endif {"vkCreateAccelerationStructureKHR", (void*)CreateAccelerationStructureKHR}, {"vkDestroyAccelerationStructureKHR", (void*)DestroyAccelerationStructureKHR}, diff --git a/icd/generated/function_definitions.h b/icd/generated/function_definitions.h index bbfbc2db0..bbcdde11b 100644 --- a/icd/generated/function_definitions.h +++ b/icd/generated/function_definitions.h @@ -1,5 +1,5 @@ /* -** Copyright (c) 2015-2024 The Khronos Group Inc. +** Copyright (c) 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. @@ -2338,6 +2338,161 @@ static VKAPI_ATTR void VKAPI_CALL GetDeviceImageSparseMemoryRequirements( } +static VKAPI_ATTR void VKAPI_CALL CmdSetLineStipple( + VkCommandBuffer commandBuffer, + uint32_t lineStippleFactor, + uint16_t lineStipplePattern) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR VkResult VKAPI_CALL MapMemory2( + VkDevice device, + const VkMemoryMapInfo* pMemoryMapInfo, + void** ppData) +{ + return MapMemory2KHR(device, pMemoryMapInfo, ppData); +} + +static VKAPI_ATTR VkResult VKAPI_CALL UnmapMemory2( + VkDevice device, + const VkMemoryUnmapInfo* pMemoryUnmapInfo) +{ + return UnmapMemory2KHR(device, pMemoryUnmapInfo); +} + +static VKAPI_ATTR void VKAPI_CALL CmdBindIndexBuffer2( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkDeviceSize size, + VkIndexType indexType) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL GetRenderingAreaGranularity( + VkDevice device, + const VkRenderingAreaInfo* pRenderingAreaInfo, + VkExtent2D* pGranularity) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL GetDeviceImageSubresourceLayout( + VkDevice device, + const VkDeviceImageSubresourceInfo* pInfo, + VkSubresourceLayout2* pLayout) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout2( + VkDevice device, + VkImage image, + const VkImageSubresource2* pSubresource, + VkSubresourceLayout2* pLayout) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSet( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t set, + uint32_t descriptorWriteCount, + const VkWriteDescriptorSet* pDescriptorWrites) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplate( + VkCommandBuffer commandBuffer, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + VkPipelineLayout layout, + uint32_t set, + const void* pData) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL CmdSetRenderingAttachmentLocations( + VkCommandBuffer commandBuffer, + const VkRenderingAttachmentLocationInfo* pLocationInfo) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL CmdSetRenderingInputAttachmentIndices( + VkCommandBuffer commandBuffer, + const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets2( + VkCommandBuffer commandBuffer, + const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL CmdPushConstants2( + VkCommandBuffer commandBuffer, + const VkPushConstantsInfo* pPushConstantsInfo) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSet2( + VkCommandBuffer commandBuffer, + const VkPushDescriptorSetInfo* pPushDescriptorSetInfo) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplate2( + VkCommandBuffer commandBuffer, + const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR VkResult VKAPI_CALL CopyMemoryToImage( + VkDevice device, + const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} + +static VKAPI_ATTR VkResult VKAPI_CALL CopyImageToMemory( + VkDevice device, + const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} + +static VKAPI_ATTR VkResult VKAPI_CALL CopyImageToImage( + VkDevice device, + const VkCopyImageToImageInfo* pCopyImageToImageInfo) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} + +static VKAPI_ATTR VkResult VKAPI_CALL TransitionImageLayout( + VkDevice device, + uint32_t transitionCount, + const VkHostImageLayoutTransitionInfo* pTransitions) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} + + static VKAPI_ATTR void VKAPI_CALL DestroySurfaceKHR( VkInstance instance, VkSurfaceKHR surface, @@ -2753,8 +2908,17 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoCapabilitiesKHR( auto caps_decode_h265 = lvl_find_mod_in_chain(pCapabilities->pNext); auto caps_decode_av1 = lvl_find_mod_in_chain(pCapabilities->pNext); auto caps_encode = lvl_find_mod_in_chain(pCapabilities->pNext); + auto caps_encode_quantization_map = + lvl_find_mod_in_chain(pCapabilities->pNext); + auto caps_encode_h264_quantization_map = + lvl_find_mod_in_chain(pCapabilities->pNext); + auto caps_encode_h265_quantization_map = + lvl_find_mod_in_chain(pCapabilities->pNext); + auto caps_encode_av1_quantization_map = + lvl_find_mod_in_chain(pCapabilities->pNext); auto caps_encode_h264 = lvl_find_mod_in_chain(pCapabilities->pNext); auto caps_encode_h265 = lvl_find_mod_in_chain(pCapabilities->pNext); + auto caps_encode_av1 = lvl_find_mod_in_chain(pCapabilities->pNext); switch (pVideoProfile->videoCodecOperation) { case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR: { @@ -2906,7 +3070,9 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoCapabilitiesKHR( switch (pVideoProfile->chromaSubsampling) { case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: - caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR; + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR + | VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR + | VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR; caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR | VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR | VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR; @@ -2934,9 +3100,20 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoCapabilitiesKHR( caps_encode_h264->maxQp = 51; caps_encode_h264->prefersGopRemainingFrames = VK_FALSE; caps_encode_h264->requiresGopRemainingFrames = VK_FALSE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 15) / 16, + (caps->maxCodedExtent.height + 15) / 16}; + } + + if (caps_encode_h264_quantization_map) { + caps_encode_h264_quantization_map->minQpDelta = -26; + caps_encode_h264_quantization_map->maxQpDelta = +25; + } break; case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: - caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR; + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR + | VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR; caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR | VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR; caps_encode->maxRateControlLayers = 1; @@ -2959,6 +3136,16 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoCapabilitiesKHR( caps_encode_h264->maxQp = 30; caps_encode_h264->prefersGopRemainingFrames = VK_TRUE; caps_encode_h264->requiresGopRemainingFrames = VK_FALSE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 15) / 16, + (caps->maxCodedExtent.height + 15) / 16}; + } + + if (caps_encode_h264_quantization_map) { + caps_encode_h264_quantization_map->minQpDelta = 0; + caps_encode_h264_quantization_map->maxQpDelta = 0; + } break; case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: caps_encode->flags = 0; @@ -2983,6 +3170,15 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoCapabilitiesKHR( caps_encode_h264->maxQp = 40; caps_encode_h264->prefersGopRemainingFrames = VK_TRUE; caps_encode_h264->requiresGopRemainingFrames = VK_TRUE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {0, 0}; + } + + if (caps_encode_h264_quantization_map) { + caps_encode_h264_quantization_map->minQpDelta = 0; + caps_encode_h264_quantization_map->maxQpDelta = 0; + } break; default: return VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR; @@ -3008,7 +3204,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoCapabilitiesKHR( switch (pVideoProfile->chromaSubsampling) { case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: - caps_encode->flags = 0; + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR; caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR; caps_encode->maxRateControlLayers = 1; caps_encode->maxBitrate = 800000000; @@ -3039,9 +3235,19 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoCapabilitiesKHR( caps_encode_h265->maxQp = 32; caps_encode_h265->prefersGopRemainingFrames = VK_FALSE; caps_encode_h265->requiresGopRemainingFrames = VK_FALSE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 3) / 4, + (caps->maxCodedExtent.height + 3) / 4}; + } + + if (caps_encode_h265_quantization_map) { + caps_encode_h265_quantization_map->minQpDelta = -16; + caps_encode_h265_quantization_map->maxQpDelta = +15; + } break; case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: - caps_encode->flags = 0; + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR; caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR; caps_encode->maxRateControlLayers = 0; caps_encode->maxBitrate = 480000000; @@ -3067,6 +3273,16 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoCapabilitiesKHR( caps_encode_h265->maxQp = 51; caps_encode_h265->prefersGopRemainingFrames = VK_TRUE; caps_encode_h265->requiresGopRemainingFrames = VK_FALSE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 31) / 32, + (caps->maxCodedExtent.height + 31) / 32}; + } + + if (caps_encode_h265_quantization_map) { + caps_encode_h265_quantization_map->minQpDelta = 0; + caps_encode_h265_quantization_map->maxQpDelta = 0; + } break; case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR; @@ -3097,13 +3313,180 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoCapabilitiesKHR( caps_encode_h265->maxQp = 51; caps_encode_h265->prefersGopRemainingFrames = VK_TRUE; caps_encode_h265->requiresGopRemainingFrames = VK_TRUE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {0, 0}; + } + + if (caps_encode_h265_quantization_map) { + caps_encode_h265_quantization_map->minQpDelta = 0; + caps_encode_h265_quantization_map->maxQpDelta = 0; + } break; default: return VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR; } break; } + case VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR: { + auto profile = lvl_find_in_chain(pVideoProfile->pNext); + if (profile->stdProfile != STD_VIDEO_AV1_PROFILE_MAIN) { + return VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR; + } + caps->flags = VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR; + caps->minBitstreamBufferOffsetAlignment = 1; + caps->minBitstreamBufferSizeAlignment = 1; + caps->pictureAccessGranularity = {8,8}; + caps->minCodedExtent = {192,128}; + caps->maxCodedExtent = {4096,2560}; + caps->maxDpbSlots = 8; + caps->maxActiveReferencePictures = 2; + std::strncpy(caps->stdHeaderVersion.extensionName, VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_EXTENSION_NAME, sizeof(caps->stdHeaderVersion.extensionName)); + caps->stdHeaderVersion.specVersion = VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_SPEC_VERSION; + + switch (pVideoProfile->chromaSubsampling) { + case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR + | VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR; + caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR; + caps_encode->maxRateControlLayers = 1; + caps_encode->maxBitrate = 800000000; + caps_encode->maxQualityLevels = 1; + caps_encode->encodeInputPictureGranularity = {64,64}; + caps_encode->supportedEncodeFeedbackFlags = VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR + | VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR; + caps_encode_av1->flags = VK_VIDEO_ENCODE_AV1_CAPABILITY_PRIMARY_REFERENCE_CDF_ONLY_BIT_KHR; + caps_encode_av1->maxLevel = STD_VIDEO_AV1_LEVEL_6_2; + caps_encode_av1->maxTiles = {1,1}; + caps_encode_av1->minTileSize = {64,64}; + caps_encode_av1->maxTileSize = {4096,2560}; + caps_encode_av1->superblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR; + caps_encode_av1->maxSingleReferenceCount = 1; + caps_encode_av1->singleReferenceNameMask = 0x7B; + caps_encode_av1->maxUnidirectionalCompoundReferenceCount = 0; + caps_encode_av1->maxUnidirectionalCompoundGroup1ReferenceCount = 0; + caps_encode_av1->unidirectionalCompoundReferenceNameMask = 0x00; + caps_encode_av1->maxBidirectionalCompoundReferenceCount = 0; + caps_encode_av1->maxBidirectionalCompoundGroup1ReferenceCount = 0; + caps_encode_av1->maxBidirectionalCompoundGroup2ReferenceCount = 0; + caps_encode_av1->bidirectionalCompoundReferenceNameMask = 0x00; + caps_encode_av1->maxTemporalLayerCount = 1; + caps_encode_av1->maxSpatialLayerCount = 1; + caps_encode_av1->maxOperatingPoints = 1; + caps_encode_av1->minQIndex = 32; + caps_encode_av1->maxQIndex = 128; + caps_encode_av1->prefersGopRemainingFrames = VK_FALSE; + caps_encode_av1->requiresGopRemainingFrames = VK_FALSE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 7) / 8, + (caps->maxCodedExtent.height + 7) / 8}; + } + + if (caps_encode_av1_quantization_map) { + caps_encode_av1_quantization_map->minQIndexDelta = -64; + caps_encode_av1_quantization_map->maxQIndexDelta = +64; + } + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR; + caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR; + caps_encode->maxRateControlLayers = 0; + caps_encode->maxBitrate = 480000000; + caps_encode->maxQualityLevels = 2; + caps_encode->encodeInputPictureGranularity = {32,32}; + caps_encode->supportedEncodeFeedbackFlags = VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR + | VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR; + caps_encode_av1->flags = VK_VIDEO_ENCODE_AV1_CAPABILITY_PRIMARY_REFERENCE_CDF_ONLY_BIT_KHR + | VK_VIDEO_ENCODE_AV1_CAPABILITY_GENERATE_OBU_EXTENSION_HEADER_BIT_KHR + | VK_VIDEO_ENCODE_AV1_CAPABILITY_FRAME_SIZE_OVERRIDE_BIT_KHR; + caps_encode_av1->maxLevel = STD_VIDEO_AV1_LEVEL_6_1; + caps_encode_av1->maxTiles = {2,2}; + caps_encode_av1->minTileSize = {128,128}; + caps_encode_av1->maxTileSize = {4096,2048}; + caps_encode_av1->superblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR + | VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_128_BIT_KHR; + caps_encode_av1->maxSingleReferenceCount = 0; + caps_encode_av1->singleReferenceNameMask = 0x00; + caps_encode_av1->maxUnidirectionalCompoundReferenceCount = 2; + caps_encode_av1->maxUnidirectionalCompoundGroup1ReferenceCount = 2; + caps_encode_av1->unidirectionalCompoundReferenceNameMask = 0x5F; + caps_encode_av1->maxBidirectionalCompoundReferenceCount = 2; + caps_encode_av1->maxBidirectionalCompoundGroup1ReferenceCount = 2; + caps_encode_av1->maxBidirectionalCompoundGroup2ReferenceCount = 2; + caps_encode_av1->bidirectionalCompoundReferenceNameMask = 0x5F; + caps_encode_av1->maxTemporalLayerCount = 4; + caps_encode_av1->maxSpatialLayerCount = 1; + caps_encode_av1->maxOperatingPoints = 4; + caps_encode_av1->minQIndex = 0; + caps_encode_av1->maxQIndex = 255; + caps_encode_av1->prefersGopRemainingFrames = VK_TRUE; + caps_encode_av1->requiresGopRemainingFrames = VK_FALSE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 63) / 64, + (caps->maxCodedExtent.height + 63) / 64}; + } + + if (caps_encode_av1_quantization_map) { + caps_encode_av1_quantization_map->minQIndexDelta = -255; + caps_encode_av1_quantization_map->maxQIndexDelta = +255; + } + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR + | VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR; + caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR + | VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR + | VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR; + caps_encode->maxRateControlLayers = 2; + caps_encode->maxBitrate = 240000000; + caps_encode->maxQualityLevels = 3; + caps_encode->encodeInputPictureGranularity = {16,16}; + caps_encode->supportedEncodeFeedbackFlags = VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR + | VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR + | VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR; + caps_encode_av1->flags = VK_VIDEO_ENCODE_AV1_CAPABILITY_PER_RATE_CONTROL_GROUP_MIN_MAX_Q_INDEX_BIT_KHR + | VK_VIDEO_ENCODE_AV1_CAPABILITY_FRAME_SIZE_OVERRIDE_BIT_KHR + | VK_VIDEO_ENCODE_AV1_CAPABILITY_MOTION_VECTOR_SCALING_BIT_KHR; + caps_encode_av1->maxLevel = STD_VIDEO_AV1_LEVEL_5_1; + caps_encode_av1->maxTiles = {4,4}; + caps_encode_av1->minTileSize = {128,128}; + caps_encode_av1->maxTileSize = {2048,2048}; + caps_encode_av1->superblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_128_BIT_KHR; + caps_encode_av1->maxSingleReferenceCount = 1; + caps_encode_av1->singleReferenceNameMask = 0x5F; + caps_encode_av1->maxUnidirectionalCompoundReferenceCount = 4; + caps_encode_av1->maxUnidirectionalCompoundGroup1ReferenceCount = 4; + caps_encode_av1->unidirectionalCompoundReferenceNameMask = 0x5B; + caps_encode_av1->maxBidirectionalCompoundReferenceCount = 0; + caps_encode_av1->maxBidirectionalCompoundGroup1ReferenceCount = 0; + caps_encode_av1->maxBidirectionalCompoundGroup2ReferenceCount = 0; + caps_encode_av1->bidirectionalCompoundReferenceNameMask = 0x00; + caps_encode_av1->maxTemporalLayerCount = 4; + caps_encode_av1->maxSpatialLayerCount = 2; + caps_encode_av1->maxOperatingPoints = 2; + caps_encode_av1->minQIndex = 16; + caps_encode_av1->maxQIndex = 96; + caps_encode_av1->prefersGopRemainingFrames = VK_TRUE; + caps_encode_av1->requiresGopRemainingFrames = VK_TRUE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 127) / 128, + (caps->maxCodedExtent.height + 127) / 128}; + } + + if (caps_encode_av1_quantization_map) { + caps_encode_av1_quantization_map->minQIndexDelta = -64; + caps_encode_av1_quantization_map->maxQIndexDelta = +63; + } + break; + default: + return VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR; + } + break; + } default: break; } @@ -3122,68 +3505,65 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoFormatPropertiesKHR( return VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR; } - std::vector format_props{}; + struct VideoFormatProperties { + VkVideoFormatPropertiesKHR props; + VkVideoFormatQuantizationMapPropertiesKHR props_quantization_map; + VkVideoFormatH265QuantizationMapPropertiesKHR props_h265_quantization_map; + VkVideoFormatAV1QuantizationMapPropertiesKHR props_av1_quantization_map; + }; + + std::vector format_props{}; - VkVideoFormatPropertiesKHR props = {}; - props.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR; - props.imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT - | VK_IMAGE_CREATE_ALIAS_BIT - | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT - | VK_IMAGE_CREATE_PROTECTED_BIT - | VK_IMAGE_CREATE_DISJOINT_BIT; - props.imageType = VK_IMAGE_TYPE_2D; - props.imageTiling = VK_IMAGE_TILING_OPTIMAL; + VideoFormatProperties fmt = {}; + fmt.props.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR; + fmt.props.imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_ALIAS_BIT | + VK_IMAGE_CREATE_EXTENDED_USAGE_BIT | VK_IMAGE_CREATE_PROTECTED_BIT | VK_IMAGE_CREATE_DISJOINT_BIT; + fmt.props.imageType = VK_IMAGE_TYPE_2D; + fmt.props.imageTiling = VK_IMAGE_TILING_OPTIMAL; + fmt.props_quantization_map.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR; + fmt.props_h265_quantization_map.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR; + fmt.props_av1_quantization_map.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR; + // Populate DPB and input/output formats switch (profile_list->pProfiles[0].videoCodecOperation) { case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR: case VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR: case VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR: switch (profile_list->pProfiles[0].chromaSubsampling) { case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: - props.format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM; - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; - format_props.push_back(props); - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_SAMPLED_BIT - | VK_IMAGE_USAGE_STORAGE_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - format_props.push_back(props); - props.format = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM; - format_props.push_back(props); + fmt.props.format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM; + fmt.props.imageUsageFlags = + VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; + format_props.push_back(fmt); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR | + VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; + format_props.push_back(fmt); + fmt.props.format = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM; + format_props.push_back(fmt); break; case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: - props.imageUsageFlags = VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; - props.format = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM; - format_props.push_back(props); - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_SAMPLED_BIT - | VK_IMAGE_USAGE_STORAGE_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - format_props.push_back(props); - props.format = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16; - format_props.push_back(props); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; + fmt.props.format = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM; + format_props.push_back(fmt); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; + format_props.push_back(fmt); + fmt.props.format = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16; + format_props.push_back(fmt); break; case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: - props.format = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM; - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; - format_props.push_back(props); - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_SAMPLED_BIT - | VK_IMAGE_USAGE_STORAGE_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - format_props.push_back(props); + fmt.props.format = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM; + fmt.props.imageUsageFlags = + VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; + format_props.push_back(fmt); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR | + VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; + format_props.push_back(fmt); break; default: return VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR; @@ -3191,50 +3571,40 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoFormatPropertiesKHR( break; case VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR: case VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR: + case VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR: switch (profile_list->pProfiles[0].chromaSubsampling) { case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: - props.format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM; - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR; - format_props.push_back(props); - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_SAMPLED_BIT - | VK_IMAGE_USAGE_STORAGE_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - format_props.push_back(props); - props.format = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM; - format_props.push_back(props); + fmt.props.format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM; + fmt.props.imageUsageFlags = + VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR; + format_props.push_back(fmt); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; + format_props.push_back(fmt); + fmt.props.format = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM; + format_props.push_back(fmt); break; case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: - props.format = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM; - props.imageUsageFlags = VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR; - format_props.push_back(props); - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_SAMPLED_BIT - | VK_IMAGE_USAGE_STORAGE_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - format_props.push_back(props); - props.format = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16; - format_props.push_back(props); + fmt.props.format = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR; + format_props.push_back(fmt); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; + format_props.push_back(fmt); + fmt.props.format = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16; + format_props.push_back(fmt); break; case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: - props.format = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM; - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR; - format_props.push_back(props); - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_SAMPLED_BIT - | VK_IMAGE_USAGE_STORAGE_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - format_props.push_back(props); + fmt.props.format = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM; + fmt.props.imageUsageFlags = + VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR; + format_props.push_back(fmt); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; + format_props.push_back(fmt); break; default: return VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR; @@ -3245,19 +3615,153 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoFormatPropertiesKHR( break; } - std::vector filtered_props; - for (const auto& fmt_props : format_props) { - if ((pVideoFormatInfo->imageUsage & fmt_props.imageUsageFlags) == pVideoFormatInfo->imageUsage) { - filtered_props.push_back(fmt_props); + // Populate quantization map formats + fmt.props.imageCreateFlags = VK_IMAGE_CREATE_PROTECTED_BIT; + fmt.props.imageTiling = VK_IMAGE_TILING_LINEAR; + switch (profile_list->pProfiles[0].videoCodecOperation) { + case VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR: + switch (profile_list->pProfiles[0].chromaSubsampling) { + case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: + fmt.props.format = VK_FORMAT_R32_SINT; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {16, 16}; + format_props.push_back(fmt); + fmt.props.format = VK_FORMAT_R8_UNORM; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR; + format_props.push_back(fmt); + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: + fmt.props.format = VK_FORMAT_R8_UNORM; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {16, 16}; + format_props.push_back(fmt); + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: + break; + default: + break; + } + break; + case VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR: + switch (profile_list->pProfiles[0].chromaSubsampling) { + case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: + fmt.props.format = VK_FORMAT_R8_UNORM; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {4, 4}; + fmt.props_h265_quantization_map.compatibleCtbSizes = + VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR | VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + fmt.props_quantization_map.quantizationMapTexelSize = {8, 8}; + format_props.push_back(fmt); + fmt.props_quantization_map.quantizationMapTexelSize = {32, 32}; + format_props.push_back(fmt); + fmt.props_quantization_map.quantizationMapTexelSize = {64, 64}; + fmt.props_h265_quantization_map.compatibleCtbSizes = VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: + fmt.props.format = VK_FORMAT_R32_SINT; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {32, 32}; + fmt.props_h265_quantization_map.compatibleCtbSizes = + VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR | VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + fmt.props_quantization_map.quantizationMapTexelSize = {64, 64}; + fmt.props_h265_quantization_map.compatibleCtbSizes = VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: + break; + default: + break; + } + break; + case VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR: + switch (profile_list->pProfiles[0].chromaSubsampling) { + case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: + fmt.props.format = VK_FORMAT_R32_SINT; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {8, 8}; + fmt.props_av1_quantization_map.compatibleSuperblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + fmt.props.format = VK_FORMAT_R8_UNORM; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {64, 64}; + fmt.props_av1_quantization_map.compatibleSuperblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: + fmt.props.format = VK_FORMAT_R32_SINT; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {64, 64}; + fmt.props_av1_quantization_map.compatibleSuperblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + fmt.props_quantization_map.quantizationMapTexelSize = {128, 128}; + fmt.props_av1_quantization_map.compatibleSuperblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_128_BIT_KHR; + format_props.push_back(fmt); + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: + fmt.props.format = VK_FORMAT_R8_UNORM; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {128, 128}; + fmt.props_av1_quantization_map.compatibleSuperblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_128_BIT_KHR; + format_props.push_back(fmt); + break; + default: + break; + } + break; + + default: + break; + } + + std::vector filtered; + for (const auto& format : format_props) { + if ((pVideoFormatInfo->imageUsage & format.props.imageUsageFlags) == pVideoFormatInfo->imageUsage) { + filtered.push_back(format); } } if (pVideoFormatProperties != nullptr) { - for (uint32_t i = 0; i < (std::min)(*pVideoFormatPropertyCount, (uint32_t)filtered_props.size()); ++i) { - pVideoFormatProperties[i] = filtered_props[i]; + for (uint32_t i = 0; i < (std::min)(*pVideoFormatPropertyCount, (uint32_t)filtered.size()); ++i) { + void* saved_pNext = pVideoFormatProperties[i].pNext; + pVideoFormatProperties[i] = filtered[i].props; + pVideoFormatProperties[i].pNext = saved_pNext; + + auto* props_quantization_map = lvl_find_mod_in_chain(saved_pNext); + auto* props_h265_quantization_map = lvl_find_mod_in_chain(saved_pNext); + auto* props_av1_quantization_map = lvl_find_mod_in_chain(saved_pNext); + + if (props_quantization_map != nullptr) { + saved_pNext = props_quantization_map->pNext; + *props_quantization_map = filtered[i].props_quantization_map; + props_quantization_map->pNext = saved_pNext; + } + + if (props_h265_quantization_map != nullptr) { + saved_pNext = props_h265_quantization_map->pNext; + *props_h265_quantization_map = filtered[i].props_h265_quantization_map; + props_h265_quantization_map->pNext = saved_pNext; + } + + if (props_av1_quantization_map != nullptr) { + saved_pNext = props_av1_quantization_map->pNext; + *props_av1_quantization_map = filtered[i].props_av1_quantization_map; + props_av1_quantization_map->pNext = saved_pNext; + } } } - *pVideoFormatPropertyCount = (uint32_t)filtered_props.size(); + *pVideoFormatPropertyCount = (uint32_t)filtered.size(); return VK_SUCCESS; } @@ -3526,6 +4030,12 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHR( fragment_density_map2_props->maxDescriptorSetSubsampledSamplers = 1; } + auto *maintenance3_props = lvl_find_mod_in_chain(pProperties->pNext); + if (maintenance3_props) { + maintenance3_props->maxMemoryAllocationSize = 1073741824; + maintenance3_props->maxPerSetDescriptors = 1024; + } + const uint32_t num_copy_layouts = 5; const VkImageLayout HostCopyLayouts[]{ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, @@ -3641,7 +4151,8 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2KHR( auto video_props = lvl_find_mod_in_chain(pQueueFamilyProperties[2].pNext); if (video_props) { video_props->videoCodecOperations = VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR - | VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR; + | VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR + | VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR; } } if (*pQueueFamilyPropertyCount > 3) { @@ -4304,14 +4815,14 @@ static VKAPI_ATTR void VKAPI_CALL CmdSetFragmentShadingRateKHR( static VKAPI_ATTR void VKAPI_CALL CmdSetRenderingAttachmentLocationsKHR( VkCommandBuffer commandBuffer, - const VkRenderingAttachmentLocationInfoKHR* pLocationInfo) + const VkRenderingAttachmentLocationInfo* pLocationInfo) { //Not a CREATE or DESTROY function } static VKAPI_ATTR void VKAPI_CALL CmdSetRenderingInputAttachmentIndicesKHR( VkCommandBuffer commandBuffer, - const VkRenderingInputAttachmentIndexInfoKHR* pInputAttachmentIndexInfo) + const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo) { //Not a CREATE or DESTROY function } @@ -4433,7 +4944,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutableInternalRepresentatio static VKAPI_ATTR VkResult VKAPI_CALL MapMemory2KHR( VkDevice device, - const VkMemoryMapInfoKHR* pMemoryMapInfo, + const VkMemoryMapInfo* pMemoryMapInfo, void** ppData) { return MapMemory(device, pMemoryMapInfo->memory, pMemoryMapInfo->offset, pMemoryMapInfo->size, pMemoryMapInfo->flags, ppData); @@ -4441,7 +4952,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL MapMemory2KHR( static VKAPI_ATTR VkResult VKAPI_CALL UnmapMemory2KHR( VkDevice device, - const VkMemoryUnmapInfoKHR* pMemoryUnmapInfo) + const VkMemoryUnmapInfo* pMemoryUnmapInfo) { UnmapMemory(device, pMemoryUnmapInfo->memory); return VK_SUCCESS; @@ -4531,24 +5042,6 @@ static VKAPI_ATTR VkResult VKAPI_CALL QueueSubmit2KHR( return VK_SUCCESS; } -static VKAPI_ATTR void VKAPI_CALL CmdWriteBufferMarker2AMD( - VkCommandBuffer commandBuffer, - VkPipelineStageFlags2 stage, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - uint32_t marker) -{ -//Not a CREATE or DESTROY function -} - -static VKAPI_ATTR void VKAPI_CALL GetQueueCheckpointData2NV( - VkQueue queue, - uint32_t* pCheckpointDataCount, - VkCheckpointData2NV* pCheckpointData) -{ -//Not a CREATE or DESTROY function -} - @@ -4647,7 +5140,7 @@ static VKAPI_ATTR void VKAPI_CALL CmdBindIndexBuffer2KHR( static VKAPI_ATTR void VKAPI_CALL GetRenderingAreaGranularityKHR( VkDevice device, - const VkRenderingAreaInfoKHR* pRenderingAreaInfo, + const VkRenderingAreaInfo* pRenderingAreaInfo, VkExtent2D* pGranularity) { //Not a CREATE or DESTROY function @@ -4655,8 +5148,8 @@ static VKAPI_ATTR void VKAPI_CALL GetRenderingAreaGranularityKHR( static VKAPI_ATTR void VKAPI_CALL GetDeviceImageSubresourceLayoutKHR( VkDevice device, - const VkDeviceImageSubresourceInfoKHR* pInfo, - VkSubresourceLayout2KHR* pLayout) + const VkDeviceImageSubresourceInfo* pInfo, + VkSubresourceLayout2* pLayout) { //Not a CREATE or DESTROY function } @@ -4664,12 +5157,63 @@ static VKAPI_ATTR void VKAPI_CALL GetDeviceImageSubresourceLayoutKHR( static VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout2KHR( VkDevice device, VkImage image, - const VkImageSubresource2KHR* pSubresource, - VkSubresourceLayout2KHR* pLayout) + const VkImageSubresource2* pSubresource, + VkSubresourceLayout2* pLayout) +{ +//Not a CREATE or DESTROY function +} + + + +static VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineBinariesKHR( + VkDevice device, + const VkPipelineBinaryCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkPipelineBinaryHandlesInfoKHR* pBinaries) +{ + unique_lock_t lock(global_lock); + for (uint32_t i = 0; i < pBinaries->pipelineBinaryCount; ++i) { + pBinaries->pPipelineBinaries[i] = (VkPipelineBinaryKHR)global_unique_handle++; + } + return VK_SUCCESS; +} + +static VKAPI_ATTR void VKAPI_CALL DestroyPipelineBinaryKHR( + VkDevice device, + VkPipelineBinaryKHR pipelineBinary, + const VkAllocationCallbacks* pAllocator) +{ +//Destroy object +} + +static VKAPI_ATTR VkResult VKAPI_CALL GetPipelineKeyKHR( + VkDevice device, + const VkPipelineCreateInfoKHR* pPipelineCreateInfo, + VkPipelineBinaryKeyKHR* pPipelineKey) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} + +static VKAPI_ATTR VkResult VKAPI_CALL GetPipelineBinaryDataKHR( + VkDevice device, + const VkPipelineBinaryDataInfoKHR* pInfo, + VkPipelineBinaryKeyKHR* pPipelineBinaryKey, + size_t* pPipelineBinaryDataSize, + void* pPipelineBinaryData) { //Not a CREATE or DESTROY function + return VK_SUCCESS; } +static VKAPI_ATTR VkResult VKAPI_CALL ReleaseCapturedPipelineDataKHR( + VkDevice device, + const VkReleaseCapturedPipelineDataInfoKHR* pInfo, + const VkAllocationCallbacks* pAllocator) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeMatrixPropertiesKHR( @@ -4704,6 +5248,8 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeMatrixProperti + + static VKAPI_ATTR void VKAPI_CALL CmdSetLineStippleKHR( VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, @@ -4742,28 +5288,28 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetCalibratedTimestampsKHR( static VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets2KHR( VkCommandBuffer commandBuffer, - const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo) + const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo) { //Not a CREATE or DESTROY function } static VKAPI_ATTR void VKAPI_CALL CmdPushConstants2KHR( VkCommandBuffer commandBuffer, - const VkPushConstantsInfoKHR* pPushConstantsInfo) + const VkPushConstantsInfo* pPushConstantsInfo) { //Not a CREATE or DESTROY function } static VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSet2KHR( VkCommandBuffer commandBuffer, - const VkPushDescriptorSetInfoKHR* pPushDescriptorSetInfo) + const VkPushDescriptorSetInfo* pPushDescriptorSetInfo) { //Not a CREATE or DESTROY function } static VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplate2KHR( VkCommandBuffer commandBuffer, - const VkPushDescriptorSetWithTemplateInfoKHR* pPushDescriptorSetWithTemplateInfo) + const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo) { //Not a CREATE or DESTROY function } @@ -4785,6 +5331,10 @@ static VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorBufferEmbeddedSamplers2EXT( + + + + static VKAPI_ATTR VkResult VKAPI_CALL CreateDebugReportCallbackEXT( VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, @@ -4980,6 +5530,14 @@ static VKAPI_ATTR uint32_t VKAPI_CALL GetImageViewHandleNVX( return VK_SUCCESS; } +static VKAPI_ATTR uint64_t VKAPI_CALL GetImageViewHandle64NVX( + VkDevice device, + const VkImageViewHandleInfoNVX* pInfo) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} + static VKAPI_ATTR VkResult VKAPI_CALL GetImageViewAddressNVX( VkDevice device, VkImageView imageView, @@ -5459,7 +6017,9 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetExecutionGraphPipelineNodeIndexAMDX( static VKAPI_ATTR void VKAPI_CALL CmdInitializeGraphScratchMemoryAMDX( VkCommandBuffer commandBuffer, - VkDeviceAddress scratch) + VkPipeline executionGraph, + VkDeviceAddress scratch, + VkDeviceSize scratchSize) { //Not a CREATE or DESTROY function } @@ -5467,6 +6027,7 @@ static VKAPI_ATTR void VKAPI_CALL CmdInitializeGraphScratchMemoryAMDX( static VKAPI_ATTR void VKAPI_CALL CmdDispatchGraphAMDX( VkCommandBuffer commandBuffer, VkDeviceAddress scratch, + VkDeviceSize scratchSize, const VkDispatchGraphCountInfoAMDX* pCountInfo) { //Not a CREATE or DESTROY function @@ -5475,6 +6036,7 @@ static VKAPI_ATTR void VKAPI_CALL CmdDispatchGraphAMDX( static VKAPI_ATTR void VKAPI_CALL CmdDispatchGraphIndirectAMDX( VkCommandBuffer commandBuffer, VkDeviceAddress scratch, + VkDeviceSize scratchSize, const VkDispatchGraphCountInfoAMDX* pCountInfo) { //Not a CREATE or DESTROY function @@ -5483,6 +6045,7 @@ static VKAPI_ATTR void VKAPI_CALL CmdDispatchGraphIndirectAMDX( static VKAPI_ATTR void VKAPI_CALL CmdDispatchGraphIndirectCountAMDX( VkCommandBuffer commandBuffer, VkDeviceAddress scratch, + VkDeviceSize scratchSize, VkDeviceAddress countInfo) { //Not a CREATE or DESTROY function @@ -5775,6 +6338,16 @@ static VKAPI_ATTR void VKAPI_CALL CmdWriteBufferMarkerAMD( //Not a CREATE or DESTROY function } +static VKAPI_ATTR void VKAPI_CALL CmdWriteBufferMarker2AMD( + VkCommandBuffer commandBuffer, + VkPipelineStageFlags2 stage, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + uint32_t marker) +{ +//Not a CREATE or DESTROY function +} + static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCalibrateableTimeDomainsEXT( @@ -5879,6 +6452,14 @@ static VKAPI_ATTR void VKAPI_CALL GetQueueCheckpointDataNV( //Not a CREATE or DESTROY function } +static VKAPI_ATTR void VKAPI_CALL GetQueueCheckpointData2NV( + VkQueue queue, + uint32_t* pCheckpointDataCount, + VkCheckpointData2NV* pCheckpointData) +{ +//Not a CREATE or DESTROY function +} + static VKAPI_ATTR VkResult VKAPI_CALL InitializePerformanceApiINTEL( @@ -6215,7 +6796,7 @@ static VKAPI_ATTR void VKAPI_CALL CmdSetStencilOpEXT( static VKAPI_ATTR VkResult VKAPI_CALL CopyMemoryToImageEXT( VkDevice device, - const VkCopyMemoryToImageInfoEXT* pCopyMemoryToImageInfo) + const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo) { //Not a CREATE or DESTROY function return VK_SUCCESS; @@ -6223,7 +6804,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL CopyMemoryToImageEXT( static VKAPI_ATTR VkResult VKAPI_CALL CopyImageToMemoryEXT( VkDevice device, - const VkCopyImageToMemoryInfoEXT* pCopyImageToMemoryInfo) + const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo) { //Not a CREATE or DESTROY function return VK_SUCCESS; @@ -6231,7 +6812,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL CopyImageToMemoryEXT( static VKAPI_ATTR VkResult VKAPI_CALL CopyImageToImageEXT( VkDevice device, - const VkCopyImageToImageInfoEXT* pCopyImageToImageInfo) + const VkCopyImageToImageInfo* pCopyImageToImageInfo) { //Not a CREATE or DESTROY function return VK_SUCCESS; @@ -6240,7 +6821,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL CopyImageToImageEXT( static VKAPI_ATTR VkResult VKAPI_CALL TransitionImageLayoutEXT( VkDevice device, uint32_t transitionCount, - const VkHostImageLayoutTransitionInfoEXT* pTransitions) + const VkHostImageLayoutTransitionInfo* pTransitions) { //Not a CREATE or DESTROY function return VK_SUCCESS; @@ -6249,8 +6830,8 @@ static VKAPI_ATTR VkResult VKAPI_CALL TransitionImageLayoutEXT( static VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout2EXT( VkDevice device, VkImage image, - const VkImageSubresource2KHR* pSubresource, - VkSubresourceLayout2KHR* pLayout) + const VkImageSubresource2* pSubresource, + VkSubresourceLayout2* pLayout) { //Not a CREATE or DESTROY function } @@ -6659,6 +7240,7 @@ static VKAPI_ATTR void VKAPI_CALL CmdSetVertexInputEXT( + #ifdef VK_USE_PLATFORM_FUCHSIA static VKAPI_ATTR VkResult VKAPI_CALL GetMemoryZirconHandleFUCHSIA( @@ -7149,6 +7731,7 @@ static VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetPipelineIndirectDeviceAddressNV( + static VKAPI_ATTR void VKAPI_CALL CmdSetDepthClampEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthClampEnable) @@ -7506,6 +8089,14 @@ static VKAPI_ATTR void VKAPI_CALL CmdBindShadersEXT( //Not a CREATE or DESTROY function } +static VKAPI_ATTR void VKAPI_CALL CmdSetDepthClampRangeEXT( + VkCommandBuffer commandBuffer, + VkDepthClampModeEXT depthClampMode, + const VkDepthClampRangeEXT* pDepthClampRange) +{ +//Not a CREATE or DESTROY function +} + static VKAPI_ATTR VkResult VKAPI_CALL GetFramebufferTilePropertiesQCOM( VkDevice device, @@ -7530,6 +8121,32 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetDynamicRenderingTilePropertiesQCOM( +static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeVectorPropertiesNV( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkCooperativeVectorPropertiesNV* pProperties) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} + +static VKAPI_ATTR VkResult VKAPI_CALL ConvertCooperativeVectorMatrixNV( + VkDevice device, + const VkConvertCooperativeVectorMatrixInfoNV* pInfo) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} + +static VKAPI_ATTR void VKAPI_CALL CmdConvertCooperativeVectorMatrixNV( + VkCommandBuffer commandBuffer, + uint32_t infoCount, + const VkConvertCooperativeVectorMatrixInfoNV* pInfos) +{ +//Not a CREATE or DESTROY function +} + + @@ -7613,6 +8230,156 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetScreenBufferPropertiesQNX( +static VKAPI_ATTR void VKAPI_CALL GetClusterAccelerationStructureBuildSizesNV( + VkDevice device, + const VkClusterAccelerationStructureInputInfoNV* pInfo, + VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL CmdBuildClusterAccelerationStructureIndirectNV( + VkCommandBuffer commandBuffer, + const VkClusterAccelerationStructureCommandsInfoNV* pCommandInfos) +{ +//Not a CREATE or DESTROY function +} + + +static VKAPI_ATTR void VKAPI_CALL GetPartitionedAccelerationStructuresBuildSizesNV( + VkDevice device, + const VkPartitionedAccelerationStructureInstancesInputNV* pInfo, + VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL CmdBuildPartitionedAccelerationStructuresNV( + VkCommandBuffer commandBuffer, + const VkBuildPartitionedAccelerationStructureInfoNV* pBuildInfo) +{ +//Not a CREATE or DESTROY function +} + + +static VKAPI_ATTR void VKAPI_CALL GetGeneratedCommandsMemoryRequirementsEXT( + VkDevice device, + const VkGeneratedCommandsMemoryRequirementsInfoEXT* pInfo, + VkMemoryRequirements2* pMemoryRequirements) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL CmdPreprocessGeneratedCommandsEXT( + VkCommandBuffer commandBuffer, + const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo, + VkCommandBuffer stateCommandBuffer) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL CmdExecuteGeneratedCommandsEXT( + VkCommandBuffer commandBuffer, + VkBool32 isPreprocessed, + const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutEXT( + VkDevice device, + const VkIndirectCommandsLayoutCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkIndirectCommandsLayoutEXT* pIndirectCommandsLayout) +{ + unique_lock_t lock(global_lock); + *pIndirectCommandsLayout = (VkIndirectCommandsLayoutEXT)global_unique_handle++; + return VK_SUCCESS; +} + +static VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutEXT( + VkDevice device, + VkIndirectCommandsLayoutEXT indirectCommandsLayout, + const VkAllocationCallbacks* pAllocator) +{ +//Destroy object +} + +static VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectExecutionSetEXT( + VkDevice device, + const VkIndirectExecutionSetCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkIndirectExecutionSetEXT* pIndirectExecutionSet) +{ + unique_lock_t lock(global_lock); + *pIndirectExecutionSet = (VkIndirectExecutionSetEXT)global_unique_handle++; + return VK_SUCCESS; +} + +static VKAPI_ATTR void VKAPI_CALL DestroyIndirectExecutionSetEXT( + VkDevice device, + VkIndirectExecutionSetEXT indirectExecutionSet, + const VkAllocationCallbacks* pAllocator) +{ +//Destroy object +} + +static VKAPI_ATTR void VKAPI_CALL UpdateIndirectExecutionSetPipelineEXT( + VkDevice device, + VkIndirectExecutionSetEXT indirectExecutionSet, + uint32_t executionSetWriteCount, + const VkWriteIndirectExecutionSetPipelineEXT* pExecutionSetWrites) +{ +//Not a CREATE or DESTROY function +} + +static VKAPI_ATTR void VKAPI_CALL UpdateIndirectExecutionSetShaderEXT( + VkDevice device, + VkIndirectExecutionSetEXT indirectExecutionSet, + uint32_t executionSetWriteCount, + const VkWriteIndirectExecutionSetShaderEXT* pExecutionSetWrites) +{ +//Not a CREATE or DESTROY function +} + + + + + +static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkCooperativeMatrixFlexibleDimensionsPropertiesNV* pProperties) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} + + +#ifdef VK_USE_PLATFORM_METAL_EXT + +static VKAPI_ATTR VkResult VKAPI_CALL GetMemoryMetalHandleEXT( + VkDevice device, + const VkMemoryGetMetalHandleInfoEXT* pGetMetalHandleInfo, + void** pHandle) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} + +static VKAPI_ATTR VkResult VKAPI_CALL GetMemoryMetalHandlePropertiesEXT( + VkDevice device, + VkExternalMemoryHandleTypeFlagBits handleType, + const void* pHandle, + VkMemoryMetalHandlePropertiesEXT* pMemoryMetalHandleProperties) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} +#endif /* VK_USE_PLATFORM_METAL_EXT */ + + + static VKAPI_ATTR VkResult VKAPI_CALL CreateAccelerationStructureKHR( VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo, diff --git a/icd/generated/vk_typemap_helper.h b/icd/generated/vk_typemap_helper.h index 22037992c..c4360aae3 100644 --- a/icd/generated/vk_typemap_helper.h +++ b/icd/generated/vk_typemap_helper.h @@ -1965,6 +1965,456 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceVulkan14Features Type; +}; + +// Map type VkPhysicalDeviceVulkan14Properties to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceVulkan14Properties Type; +}; + +// Map type VkDeviceQueueGlobalPriorityCreateInfo to id VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkDeviceQueueGlobalPriorityCreateInfo Type; +}; + +// Map type VkPhysicalDeviceGlobalPriorityQueryFeatures to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceGlobalPriorityQueryFeatures Type; +}; + +// Map type VkQueueFamilyGlobalPriorityProperties to id VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES; +}; + +template <> struct LvlSTypeMap { + typedef VkQueueFamilyGlobalPriorityProperties Type; +}; + +// Map type VkPhysicalDeviceShaderSubgroupRotateFeatures to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceShaderSubgroupRotateFeatures Type; +}; + +// Map type VkPhysicalDeviceShaderFloatControls2Features to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceShaderFloatControls2Features Type; +}; + +// Map type VkPhysicalDeviceShaderExpectAssumeFeatures to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceShaderExpectAssumeFeatures Type; +}; + +// Map type VkPhysicalDeviceLineRasterizationFeatures to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceLineRasterizationFeatures Type; +}; + +// Map type VkPhysicalDeviceLineRasterizationProperties to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceLineRasterizationProperties Type; +}; + +// Map type VkPipelineRasterizationLineStateCreateInfo to id VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkPipelineRasterizationLineStateCreateInfo Type; +}; + +// Map type VkPhysicalDeviceVertexAttributeDivisorProperties to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceVertexAttributeDivisorProperties Type; +}; + +// Map type VkPipelineVertexInputDivisorStateCreateInfo to id VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkPipelineVertexInputDivisorStateCreateInfo Type; +}; + +// Map type VkPhysicalDeviceVertexAttributeDivisorFeatures to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceVertexAttributeDivisorFeatures Type; +}; + +// Map type VkPhysicalDeviceIndexTypeUint8Features to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceIndexTypeUint8Features Type; +}; + +// Map type VkMemoryMapInfo to id VK_STRUCTURE_TYPE_MEMORY_MAP_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_MEMORY_MAP_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkMemoryMapInfo Type; +}; + +// Map type VkMemoryUnmapInfo to id VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkMemoryUnmapInfo Type; +}; + +// Map type VkPhysicalDeviceMaintenance5Features to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceMaintenance5Features Type; +}; + +// Map type VkPhysicalDeviceMaintenance5Properties to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceMaintenance5Properties Type; +}; + +// Map type VkRenderingAreaInfo to id VK_STRUCTURE_TYPE_RENDERING_AREA_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_RENDERING_AREA_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkRenderingAreaInfo Type; +}; + +// Map type VkImageSubresource2 to id VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2 +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2; +}; + +template <> struct LvlSTypeMap { + typedef VkImageSubresource2 Type; +}; + +// Map type VkDeviceImageSubresourceInfo to id VK_STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkDeviceImageSubresourceInfo Type; +}; + +// Map type VkSubresourceLayout2 to id VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2 +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2; +}; + +template <> struct LvlSTypeMap { + typedef VkSubresourceLayout2 Type; +}; + +// Map type VkPipelineCreateFlags2CreateInfo to id VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkPipelineCreateFlags2CreateInfo Type; +}; + +// Map type VkBufferUsageFlags2CreateInfo to id VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkBufferUsageFlags2CreateInfo Type; +}; + +// Map type VkPhysicalDevicePushDescriptorProperties to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDevicePushDescriptorProperties Type; +}; + +// Map type VkPhysicalDeviceDynamicRenderingLocalReadFeatures to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceDynamicRenderingLocalReadFeatures Type; +}; + +// Map type VkRenderingAttachmentLocationInfo to id VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkRenderingAttachmentLocationInfo Type; +}; + +// Map type VkRenderingInputAttachmentIndexInfo to id VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkRenderingInputAttachmentIndexInfo Type; +}; + +// Map type VkPhysicalDeviceMaintenance6Features to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceMaintenance6Features Type; +}; + +// Map type VkPhysicalDeviceMaintenance6Properties to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceMaintenance6Properties Type; +}; + +// Map type VkBindMemoryStatus to id VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS; +}; + +template <> struct LvlSTypeMap { + typedef VkBindMemoryStatus Type; +}; + +// Map type VkBindDescriptorSetsInfo to id VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkBindDescriptorSetsInfo Type; +}; + +// Map type VkPushConstantsInfo to id VK_STRUCTURE_TYPE_PUSH_CONSTANTS_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PUSH_CONSTANTS_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkPushConstantsInfo Type; +}; + +// Map type VkPushDescriptorSetInfo to id VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkPushDescriptorSetInfo Type; +}; + +// Map type VkPushDescriptorSetWithTemplateInfo to id VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkPushDescriptorSetWithTemplateInfo Type; +}; + +// Map type VkPhysicalDevicePipelineProtectedAccessFeatures to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDevicePipelineProtectedAccessFeatures Type; +}; + +// Map type VkPhysicalDevicePipelineRobustnessFeatures to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDevicePipelineRobustnessFeatures Type; +}; + +// Map type VkPhysicalDevicePipelineRobustnessProperties to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDevicePipelineRobustnessProperties Type; +}; + +// Map type VkPipelineRobustnessCreateInfo to id VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkPipelineRobustnessCreateInfo Type; +}; + +// Map type VkPhysicalDeviceHostImageCopyFeatures to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceHostImageCopyFeatures Type; +}; + +// Map type VkPhysicalDeviceHostImageCopyProperties to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceHostImageCopyProperties Type; +}; + +// Map type VkMemoryToImageCopy to id VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY; +}; + +template <> struct LvlSTypeMap { + typedef VkMemoryToImageCopy Type; +}; + +// Map type VkImageToMemoryCopy to id VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY; +}; + +template <> struct LvlSTypeMap { + typedef VkImageToMemoryCopy Type; +}; + +// Map type VkCopyMemoryToImageInfo to id VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkCopyMemoryToImageInfo Type; +}; + +// Map type VkCopyImageToMemoryInfo to id VK_STRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkCopyImageToMemoryInfo Type; +}; + +// Map type VkCopyImageToImageInfo to id VK_STRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkCopyImageToImageInfo Type; +}; + +// Map type VkHostImageLayoutTransitionInfo to id VK_STRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO; +}; + +template <> struct LvlSTypeMap { + typedef VkHostImageLayoutTransitionInfo Type; +}; + +// Map type VkSubresourceHostMemcpySize to id VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE; +}; + +template <> struct LvlSTypeMap { + typedef VkSubresourceHostMemcpySize Type; +}; + +// Map type VkHostImageCopyDevicePerformanceQuery to id VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY; +}; + +template <> struct LvlSTypeMap { + typedef VkHostImageCopyDevicePerformanceQuery Type; +}; + // Map type VkSwapchainCreateInfoKHR to id VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; @@ -2605,42 +3055,6 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkRenderingFragmentShadingRateAttachmentInfoKHR Type; -}; - -// Map type VkRenderingFragmentDensityMapAttachmentInfoEXT to id VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkRenderingFragmentDensityMapAttachmentInfoEXT Type; -}; - -// Map type VkAttachmentSampleCountInfoAMD to id VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD; -}; - -template <> struct LvlSTypeMap { - typedef VkAttachmentSampleCountInfoAMD Type; -}; - -// Map type VkMultiviewPerViewAttributesInfoNVX to id VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX; -}; - -template <> struct LvlSTypeMap { - typedef VkMultiviewPerViewAttributesInfoNVX Type; -}; - #ifdef VK_USE_PLATFORM_WIN32_KHR // Map type VkImportMemoryWin32HandleInfoKHR to id VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR template <> struct LvlTypeMap { @@ -2785,15 +3199,6 @@ template <> struct LvlSTypeMap { typedef VkSemaphoreGetFdInfoKHR Type; }; -// Map type VkPhysicalDevicePushDescriptorPropertiesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDevicePushDescriptorPropertiesKHR Type; -}; - // Map type VkPresentRegionsKHR to id VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR; @@ -3083,33 +3488,6 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkDeviceQueueGlobalPriorityCreateInfoKHR Type; -}; - -// Map type VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR Type; -}; - -// Map type VkQueueFamilyGlobalPriorityPropertiesKHR to id VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkQueueFamilyGlobalPriorityPropertiesKHR Type; -}; - // Map type VkFragmentShadingRateAttachmentInfoKHR to id VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR; @@ -3155,31 +3533,13 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR Type; -}; - -// Map type VkRenderingAttachmentLocationInfoKHR to id VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkRenderingAttachmentLocationInfoKHR Type; -}; - -// Map type VkRenderingInputAttachmentIndexInfoKHR to id VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR; +// Map type VkRenderingFragmentShadingRateAttachmentInfoKHR to id VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR; }; -template <> struct LvlSTypeMap { - typedef VkRenderingInputAttachmentIndexInfoKHR Type; +template <> struct LvlSTypeMap { + typedef VkRenderingFragmentShadingRateAttachmentInfoKHR Type; }; // Map type VkPhysicalDeviceShaderQuadControlFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR @@ -3263,24 +3623,6 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkMemoryMapInfoKHR Type; -}; - -// Map type VkMemoryUnmapInfoKHR to id VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkMemoryUnmapInfoKHR Type; -}; - // Map type VkPipelineLibraryCreateInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR; @@ -3398,31 +3740,13 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_FEEDBACK_INFO_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkVideoEncodeSessionParametersFeedbackInfoKHR Type; -}; - -// Map type VkQueueFamilyCheckpointProperties2NV to id VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV; -}; - -template <> struct LvlSTypeMap { - typedef VkQueueFamilyCheckpointProperties2NV Type; -}; - -// Map type VkCheckpointData2NV to id VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV; -}; - -template <> struct LvlSTypeMap { - typedef VkCheckpointData2NV Type; +// Map type VkVideoEncodeSessionParametersFeedbackInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_FEEDBACK_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_FEEDBACK_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkVideoEncodeSessionParametersFeedbackInfoKHR Type; }; // Map type VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR @@ -3470,15 +3794,6 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR Type; -}; - // Map type VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR; @@ -3488,85 +3803,103 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR; +// Map type VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR Type; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceMaintenance5FeaturesKHR Type; +// Map type VkPhysicalDevicePipelineBinaryFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR; }; -// Map type VkPhysicalDeviceMaintenance5PropertiesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR; +template <> struct LvlSTypeMap { + typedef VkPhysicalDevicePipelineBinaryFeaturesKHR Type; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceMaintenance5PropertiesKHR Type; +// Map type VkPhysicalDevicePipelineBinaryPropertiesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR; }; -// Map type VkRenderingAreaInfoKHR to id VK_STRUCTURE_TYPE_RENDERING_AREA_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_RENDERING_AREA_INFO_KHR; +template <> struct LvlSTypeMap { + typedef VkPhysicalDevicePipelineBinaryPropertiesKHR Type; }; -template <> struct LvlSTypeMap { - typedef VkRenderingAreaInfoKHR Type; +// Map type VkDevicePipelineBinaryInternalCacheControlKHR to id VK_STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR; }; -// Map type VkImageSubresource2KHR to id VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_KHR; +template <> struct LvlSTypeMap { + typedef VkDevicePipelineBinaryInternalCacheControlKHR Type; }; -template <> struct LvlSTypeMap { - typedef VkImageSubresource2KHR Type; +// Map type VkPipelineBinaryKeyKHR to id VK_STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR; }; -// Map type VkDeviceImageSubresourceInfoKHR to id VK_STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO_KHR; +template <> struct LvlSTypeMap { + typedef VkPipelineBinaryKeyKHR Type; }; -template <> struct LvlSTypeMap { - typedef VkDeviceImageSubresourceInfoKHR Type; +// Map type VkPipelineCreateInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR; }; -// Map type VkSubresourceLayout2KHR to id VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_KHR; +template <> struct LvlSTypeMap { + typedef VkPipelineCreateInfoKHR Type; }; -template <> struct LvlSTypeMap { - typedef VkSubresourceLayout2KHR Type; +// Map type VkPipelineBinaryCreateInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_BINARY_CREATE_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_BINARY_CREATE_INFO_KHR; }; -// Map type VkPipelineCreateFlags2CreateInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR; +template <> struct LvlSTypeMap { + typedef VkPipelineBinaryCreateInfoKHR Type; }; -template <> struct LvlSTypeMap { - typedef VkPipelineCreateFlags2CreateInfoKHR Type; +// Map type VkPipelineBinaryInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR; }; -// Map type VkBufferUsageFlags2CreateInfoKHR to id VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR; +template <> struct LvlSTypeMap { + typedef VkPipelineBinaryInfoKHR Type; }; -template <> struct LvlSTypeMap { - typedef VkBufferUsageFlags2CreateInfoKHR Type; +// Map type VkReleaseCapturedPipelineDataInfoKHR to id VK_STRUCTURE_TYPE_RELEASE_CAPTURED_PIPELINE_DATA_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_RELEASE_CAPTURED_PIPELINE_DATA_INFO_KHR; }; -// Map type VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR; +template <> struct LvlSTypeMap { + typedef VkReleaseCapturedPipelineDataInfoKHR Type; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR Type; +// Map type VkPipelineBinaryDataInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_BINARY_DATA_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_BINARY_DATA_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPipelineBinaryDataInfoKHR Type; +}; + +// Map type VkPipelineBinaryHandlesInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_BINARY_HANDLES_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_BINARY_HANDLES_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPipelineBinaryHandlesInfoKHR Type; }; // Map type VkCooperativeMatrixPropertiesKHR to id VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR @@ -3596,6 +3929,24 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR Type; +}; + +// Map type VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR Type; +}; + // Map type VkVideoDecodeAV1ProfileInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR; @@ -3641,94 +3992,121 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR; +// Map type VkPhysicalDeviceVideoEncodeAV1FeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceVideoMaintenance1FeaturesKHR Type; +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceVideoEncodeAV1FeaturesKHR Type; }; -// Map type VkVideoInlineQueryInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR; +// Map type VkVideoEncodeAV1CapabilitiesKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR; }; -template <> struct LvlSTypeMap { - typedef VkVideoInlineQueryInfoKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeAV1CapabilitiesKHR Type; +}; + +// Map type VkVideoEncodeAV1QualityLevelPropertiesKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUALITY_LEVEL_PROPERTIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUALITY_LEVEL_PROPERTIES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkVideoEncodeAV1QualityLevelPropertiesKHR Type; +}; + +// Map type VkVideoEncodeAV1SessionCreateInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_CREATE_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_CREATE_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkVideoEncodeAV1SessionCreateInfoKHR Type; +}; + +// Map type VkVideoEncodeAV1SessionParametersCreateInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkVideoEncodeAV1SessionParametersCreateInfoKHR Type; }; -// Map type VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR; +// Map type VkVideoEncodeAV1PictureInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PICTURE_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PICTURE_INFO_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeAV1PictureInfoKHR Type; }; -// Map type VkPipelineVertexInputDivisorStateCreateInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR; +// Map type VkVideoEncodeAV1DpbSlotInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_DPB_SLOT_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_DPB_SLOT_INFO_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPipelineVertexInputDivisorStateCreateInfoKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeAV1DpbSlotInfoKHR Type; }; -// Map type VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR; +// Map type VkVideoEncodeAV1ProfileInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeAV1ProfileInfoKHR Type; }; -// Map type VkPhysicalDeviceShaderFloatControls2FeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES_KHR; +// Map type VkVideoEncodeAV1GopRemainingFrameInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_GOP_REMAINING_FRAME_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_GOP_REMAINING_FRAME_INFO_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceShaderFloatControls2FeaturesKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeAV1GopRemainingFrameInfoKHR Type; }; -// Map type VkPhysicalDeviceIndexTypeUint8FeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_KHR; +// Map type VkVideoEncodeAV1RateControlInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_INFO_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceIndexTypeUint8FeaturesKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeAV1RateControlInfoKHR Type; }; -// Map type VkPhysicalDeviceLineRasterizationFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_KHR; +// Map type VkVideoEncodeAV1RateControlLayerInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_LAYER_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_LAYER_INFO_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceLineRasterizationFeaturesKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeAV1RateControlLayerInfoKHR Type; }; -// Map type VkPhysicalDeviceLineRasterizationPropertiesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR; +// Map type VkPhysicalDeviceVideoMaintenance1FeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceLineRasterizationPropertiesKHR Type; +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceVideoMaintenance1FeaturesKHR Type; }; -// Map type VkPipelineRasterizationLineStateCreateInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_KHR; +// Map type VkVideoInlineQueryInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPipelineRasterizationLineStateCreateInfoKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoInlineQueryInfoKHR Type; }; // Map type VkCalibratedTimestampInfoKHR to id VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR @@ -3740,94 +4118,112 @@ template <> struct LvlSTypeMap typedef VkCalibratedTimestampInfoKHR Type; }; -// Map type VkPhysicalDeviceShaderExpectAssumeFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES_KHR; +// Map type VkSetDescriptorBufferOffsetsInfoEXT to id VK_STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkSetDescriptorBufferOffsetsInfoEXT Type; +}; + +// Map type VkBindDescriptorBufferEmbeddedSamplersInfoEXT to id VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceShaderExpectAssumeFeaturesKHR Type; +template <> struct LvlSTypeMap { + typedef VkBindDescriptorBufferEmbeddedSamplersInfoEXT Type; }; -// Map type VkPhysicalDeviceMaintenance6FeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES_KHR; +// Map type VkVideoEncodeQuantizationMapCapabilitiesKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceMaintenance6FeaturesKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeQuantizationMapCapabilitiesKHR Type; }; -// Map type VkPhysicalDeviceMaintenance6PropertiesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES_KHR; +// Map type VkVideoFormatQuantizationMapPropertiesKHR to id VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceMaintenance6PropertiesKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoFormatQuantizationMapPropertiesKHR Type; }; -// Map type VkBindMemoryStatusKHR to id VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS_KHR; +// Map type VkVideoEncodeQuantizationMapInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_INFO_KHR; }; -template <> struct LvlSTypeMap { - typedef VkBindMemoryStatusKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeQuantizationMapInfoKHR Type; }; -// Map type VkBindDescriptorSetsInfoKHR to id VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO_KHR; +// Map type VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_SESSION_PARAMETERS_CREATE_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_SESSION_PARAMETERS_CREATE_INFO_KHR; }; -template <> struct LvlSTypeMap { - typedef VkBindDescriptorSetsInfoKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR Type; }; -// Map type VkPushConstantsInfoKHR to id VK_STRUCTURE_TYPE_PUSH_CONSTANTS_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PUSH_CONSTANTS_INFO_KHR; +// Map type VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPushConstantsInfoKHR Type; +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR Type; }; -// Map type VkPushDescriptorSetInfoKHR to id VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO_KHR; +// Map type VkVideoEncodeH264QuantizationMapCapabilitiesKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPushDescriptorSetInfoKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeH264QuantizationMapCapabilitiesKHR Type; }; -// Map type VkPushDescriptorSetWithTemplateInfoKHR to id VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO_KHR; +// Map type VkVideoEncodeH265QuantizationMapCapabilitiesKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR; }; -template <> struct LvlSTypeMap { - typedef VkPushDescriptorSetWithTemplateInfoKHR Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeH265QuantizationMapCapabilitiesKHR Type; }; -// Map type VkSetDescriptorBufferOffsetsInfoEXT to id VK_STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT; +// Map type VkVideoFormatH265QuantizationMapPropertiesKHR to id VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR; }; -template <> struct LvlSTypeMap { - typedef VkSetDescriptorBufferOffsetsInfoEXT Type; +template <> struct LvlSTypeMap { + typedef VkVideoFormatH265QuantizationMapPropertiesKHR Type; }; -// Map type VkBindDescriptorBufferEmbeddedSamplersInfoEXT to id VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT; +// Map type VkVideoEncodeAV1QuantizationMapCapabilitiesKHR to id VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUANTIZATION_MAP_CAPABILITIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUANTIZATION_MAP_CAPABILITIES_KHR; }; -template <> struct LvlSTypeMap { - typedef VkBindDescriptorBufferEmbeddedSamplersInfoEXT Type; +template <> struct LvlSTypeMap { + typedef VkVideoEncodeAV1QuantizationMapCapabilitiesKHR Type; +}; + +// Map type VkVideoFormatAV1QuantizationMapPropertiesKHR to id VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkVideoFormatAV1QuantizationMapPropertiesKHR Type; }; // Map type VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR @@ -3884,6 +4280,69 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_8_FEATURES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceMaintenance8FeaturesKHR Type; +}; + +// Map type VkMemoryBarrierAccessFlags3KHR to id VK_STRUCTURE_TYPE_MEMORY_BARRIER_ACCESS_FLAGS_3_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_ACCESS_FLAGS_3_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkMemoryBarrierAccessFlags3KHR Type; +}; + +// Map type VkPhysicalDeviceVideoMaintenance2FeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_2_FEATURES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_2_FEATURES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceVideoMaintenance2FeaturesKHR Type; +}; + +// Map type VkVideoDecodeH264InlineSessionParametersInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_INLINE_SESSION_PARAMETERS_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_INLINE_SESSION_PARAMETERS_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkVideoDecodeH264InlineSessionParametersInfoKHR Type; +}; + +// Map type VkVideoDecodeH265InlineSessionParametersInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_INLINE_SESSION_PARAMETERS_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_INLINE_SESSION_PARAMETERS_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkVideoDecodeH265InlineSessionParametersInfoKHR Type; +}; + +// Map type VkVideoDecodeAV1InlineSessionParametersInfoKHR to id VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_INLINE_SESSION_PARAMETERS_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_INLINE_SESSION_PARAMETERS_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkVideoDecodeAV1InlineSessionParametersInfoKHR Type; +}; + +// Map type VkPhysicalDeviceDepthClampZeroOneFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceDepthClampZeroOneFeaturesKHR Type; +}; + // Map type VkDebugReportCallbackCreateInfoEXT to id VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT; @@ -3992,6 +4451,15 @@ template <> struct LvlSTypeMap { typedef VkCuModuleCreateInfoNVX Type; }; +// Map type VkCuModuleTexturingModeCreateInfoNVX to id VK_STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX; +}; + +template <> struct LvlSTypeMap { + typedef VkCuModuleTexturingModeCreateInfoNVX Type; +}; + // Map type VkCuFunctionCreateInfoNVX to id VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX; @@ -4146,33 +4614,6 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDevicePipelineRobustnessFeaturesEXT Type; -}; - -// Map type VkPhysicalDevicePipelineRobustnessPropertiesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDevicePipelineRobustnessPropertiesEXT Type; -}; - -// Map type VkPipelineRobustnessCreateInfoEXT to id VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkPipelineRobustnessCreateInfoEXT Type; -}; - // Map type VkConditionalRenderingBeginInfoEXT to id VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT; @@ -4272,6 +4713,15 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX; +}; + +template <> struct LvlSTypeMap { + typedef VkMultiviewPerViewAttributesInfoNVX Type; +}; + // Map type VkPipelineViewportSwizzleStateCreateInfoNV to id VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV; @@ -4552,6 +5002,15 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD; +}; + +template <> struct LvlSTypeMap { + typedef VkAttachmentSampleCountInfoAMD Type; +}; + // Map type VkSampleLocationsInfoEXT to id VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT; @@ -4977,15 +5436,6 @@ template <> struct LvlSTypeMap { }; #endif // VK_USE_PLATFORM_GGP -// Map type VkPhysicalDeviceComputeShaderDerivativesFeaturesNV to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceComputeShaderDerivativesFeaturesNV Type; -}; - // Map type VkPhysicalDeviceMeshShaderFeaturesNV to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV; @@ -5049,6 +5499,24 @@ template <> struct LvlSTypeMap { typedef VkCheckpointDataNV Type; }; +// Map type VkQueueFamilyCheckpointProperties2NV to id VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkQueueFamilyCheckpointProperties2NV Type; +}; + +// Map type VkCheckpointData2NV to id VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkCheckpointData2NV Type; +}; + // Map type VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL; @@ -5188,6 +5656,15 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkRenderingFragmentDensityMapAttachmentInfoEXT Type; +}; + // Map type VkPhysicalDeviceShaderCoreProperties2AMD to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD; @@ -5395,136 +5872,46 @@ template <> struct LvlTypeMap { }; template <> struct LvlSTypeMap { - typedef VkSurfaceCapabilitiesFullScreenExclusiveEXT Type; -}; - -#endif // VK_USE_PLATFORM_WIN32_KHR -#ifdef VK_USE_PLATFORM_WIN32_KHR -// Map type VkSurfaceFullScreenExclusiveWin32InfoEXT to id VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkSurfaceFullScreenExclusiveWin32InfoEXT Type; -}; - -#endif // VK_USE_PLATFORM_WIN32_KHR -// Map type VkHeadlessSurfaceCreateInfoEXT to id VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkHeadlessSurfaceCreateInfoEXT Type; -}; - -// Map type VkPhysicalDeviceShaderAtomicFloatFeaturesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceShaderAtomicFloatFeaturesEXT Type; -}; - -// Map type VkPhysicalDeviceExtendedDynamicStateFeaturesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceExtendedDynamicStateFeaturesEXT Type; -}; - -// Map type VkPhysicalDeviceHostImageCopyFeaturesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceHostImageCopyFeaturesEXT Type; -}; - -// Map type VkPhysicalDeviceHostImageCopyPropertiesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceHostImageCopyPropertiesEXT Type; -}; - -// Map type VkMemoryToImageCopyEXT to id VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkMemoryToImageCopyEXT Type; -}; - -// Map type VkImageToMemoryCopyEXT to id VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkImageToMemoryCopyEXT Type; -}; - -// Map type VkCopyMemoryToImageInfoEXT to id VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkCopyMemoryToImageInfoEXT Type; -}; - -// Map type VkCopyImageToMemoryInfoEXT to id VK_STRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkCopyImageToMemoryInfoEXT Type; + typedef VkSurfaceCapabilitiesFullScreenExclusiveEXT Type; }; -// Map type VkCopyImageToImageInfoEXT to id VK_STRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO_EXT; +#endif // VK_USE_PLATFORM_WIN32_KHR +#ifdef VK_USE_PLATFORM_WIN32_KHR +// Map type VkSurfaceFullScreenExclusiveWin32InfoEXT to id VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT; }; -template <> struct LvlSTypeMap { - typedef VkCopyImageToImageInfoEXT Type; +template <> struct LvlSTypeMap { + typedef VkSurfaceFullScreenExclusiveWin32InfoEXT Type; }; -// Map type VkHostImageLayoutTransitionInfoEXT to id VK_STRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO_EXT; +#endif // VK_USE_PLATFORM_WIN32_KHR +// Map type VkHeadlessSurfaceCreateInfoEXT to id VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT; }; -template <> struct LvlSTypeMap { - typedef VkHostImageLayoutTransitionInfoEXT Type; +template <> struct LvlSTypeMap { + typedef VkHeadlessSurfaceCreateInfoEXT Type; }; -// Map type VkSubresourceHostMemcpySizeEXT to id VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE_EXT; +// Map type VkPhysicalDeviceShaderAtomicFloatFeaturesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; }; -template <> struct LvlSTypeMap { - typedef VkSubresourceHostMemcpySizeEXT Type; +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceShaderAtomicFloatFeaturesEXT Type; }; -// Map type VkHostImageCopyDevicePerformanceQueryEXT to id VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXT; +// Map type VkPhysicalDeviceExtendedDynamicStateFeaturesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; }; -template <> struct LvlSTypeMap { - typedef VkHostImageCopyDevicePerformanceQueryEXT Type; +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceExtendedDynamicStateFeaturesEXT Type; }; // Map type VkPhysicalDeviceMapMemoryPlacedFeaturesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT @@ -6534,6 +6921,15 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT Type; +}; + #ifdef VK_USE_PLATFORM_FUCHSIA // Map type VkImportMemoryZirconHandleInfoFUCHSIA to id VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA template <> struct LvlTypeMap { @@ -7184,15 +7580,6 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceDepthClampZeroOneFeaturesEXT Type; -}; - // Map type VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT; @@ -7337,6 +7724,33 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_LINEAR_SWEPT_SPHERES_FEATURES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceRayTracingLinearSweptSpheresFeaturesNV Type; +}; + +// Map type VkAccelerationStructureGeometryLinearSweptSpheresDataNV to id VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_LINEAR_SWEPT_SPHERES_DATA_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_LINEAR_SWEPT_SPHERES_DATA_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkAccelerationStructureGeometryLinearSweptSpheresDataNV Type; +}; + +// Map type VkAccelerationStructureGeometrySpheresDataNV to id VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_SPHERES_DATA_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_SPHERES_DATA_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkAccelerationStructureGeometrySpheresDataNV Type; +}; + // Map type VkPhysicalDeviceLinearColorAttachmentFeaturesNV to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV; @@ -7589,15 +8003,6 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDevicePipelineProtectedAccessFeaturesEXT Type; -}; - #ifdef VK_USE_PLATFORM_ANDROID_KHR // Map type VkPhysicalDeviceExternalFormatResolveFeaturesANDROID to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID template <> struct LvlTypeMap { @@ -7748,6 +8153,42 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_VECTOR_PROPERTIES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceCooperativeVectorPropertiesNV Type; +}; + +// Map type VkPhysicalDeviceCooperativeVectorFeaturesNV to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_VECTOR_FEATURES_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_VECTOR_FEATURES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceCooperativeVectorFeaturesNV Type; +}; + +// Map type VkCooperativeVectorPropertiesNV to id VK_STRUCTURE_TYPE_COOPERATIVE_VECTOR_PROPERTIES_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_COOPERATIVE_VECTOR_PROPERTIES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkCooperativeVectorPropertiesNV Type; +}; + +// Map type VkConvertCooperativeVectorMatrixInfoNV to id VK_STRUCTURE_TYPE_CONVERT_COOPERATIVE_VECTOR_MATRIX_INFO_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_CONVERT_COOPERATIVE_VECTOR_MATRIX_INFO_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkConvertCooperativeVectorMatrixInfoNV Type; +}; + // Map type VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV; @@ -8100,6 +8541,24 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_DISPLAY_SURFACE_STEREO_CREATE_INFO_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkDisplaySurfaceStereoCreateInfoNV Type; +}; + +// Map type VkDisplayModeStereoPropertiesNV to id VK_STRUCTURE_TYPE_DISPLAY_MODE_STEREO_PROPERTIES_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_DISPLAY_MODE_STEREO_PROPERTIES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkDisplayModeStereoPropertiesNV Type; +}; + // Map type VkPhysicalDeviceRawAccessChainsFeaturesNV to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV; @@ -8145,6 +8604,267 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_ACCELERATION_STRUCTURE_FEATURES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceClusterAccelerationStructureFeaturesNV Type; +}; + +// Map type VkPhysicalDeviceClusterAccelerationStructurePropertiesNV to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_ACCELERATION_STRUCTURE_PROPERTIES_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_ACCELERATION_STRUCTURE_PROPERTIES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceClusterAccelerationStructurePropertiesNV Type; +}; + +// Map type VkClusterAccelerationStructureClustersBottomLevelInputNV to id VK_STRUCTURE_TYPE_CLUSTER_ACCELERATION_STRUCTURE_CLUSTERS_BOTTOM_LEVEL_INPUT_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_CLUSTER_ACCELERATION_STRUCTURE_CLUSTERS_BOTTOM_LEVEL_INPUT_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkClusterAccelerationStructureClustersBottomLevelInputNV Type; +}; + +// Map type VkClusterAccelerationStructureTriangleClusterInputNV to id VK_STRUCTURE_TYPE_CLUSTER_ACCELERATION_STRUCTURE_TRIANGLE_CLUSTER_INPUT_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_CLUSTER_ACCELERATION_STRUCTURE_TRIANGLE_CLUSTER_INPUT_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkClusterAccelerationStructureTriangleClusterInputNV Type; +}; + +// Map type VkClusterAccelerationStructureMoveObjectsInputNV to id VK_STRUCTURE_TYPE_CLUSTER_ACCELERATION_STRUCTURE_MOVE_OBJECTS_INPUT_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_CLUSTER_ACCELERATION_STRUCTURE_MOVE_OBJECTS_INPUT_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkClusterAccelerationStructureMoveObjectsInputNV Type; +}; + +// Map type VkClusterAccelerationStructureInputInfoNV to id VK_STRUCTURE_TYPE_CLUSTER_ACCELERATION_STRUCTURE_INPUT_INFO_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_CLUSTER_ACCELERATION_STRUCTURE_INPUT_INFO_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkClusterAccelerationStructureInputInfoNV Type; +}; + +// Map type VkClusterAccelerationStructureCommandsInfoNV to id VK_STRUCTURE_TYPE_CLUSTER_ACCELERATION_STRUCTURE_COMMANDS_INFO_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_CLUSTER_ACCELERATION_STRUCTURE_COMMANDS_INFO_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkClusterAccelerationStructureCommandsInfoNV Type; +}; + +// Map type VkAccelerationStructureBuildSizesInfoKHR to id VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkAccelerationStructureBuildSizesInfoKHR Type; +}; + +// Map type VkRayTracingPipelineClusterAccelerationStructureCreateInfoNV to id VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CLUSTER_ACCELERATION_STRUCTURE_CREATE_INFO_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CLUSTER_ACCELERATION_STRUCTURE_CREATE_INFO_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkRayTracingPipelineClusterAccelerationStructureCreateInfoNV Type; +}; + +// Map type VkPhysicalDevicePartitionedAccelerationStructureFeaturesNV to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PARTITIONED_ACCELERATION_STRUCTURE_FEATURES_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PARTITIONED_ACCELERATION_STRUCTURE_FEATURES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDevicePartitionedAccelerationStructureFeaturesNV Type; +}; + +// Map type VkPhysicalDevicePartitionedAccelerationStructurePropertiesNV to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PARTITIONED_ACCELERATION_STRUCTURE_PROPERTIES_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PARTITIONED_ACCELERATION_STRUCTURE_PROPERTIES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDevicePartitionedAccelerationStructurePropertiesNV Type; +}; + +// Map type VkPartitionedAccelerationStructureFlagsNV to id VK_STRUCTURE_TYPE_PARTITIONED_ACCELERATION_STRUCTURE_FLAGS_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PARTITIONED_ACCELERATION_STRUCTURE_FLAGS_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPartitionedAccelerationStructureFlagsNV Type; +}; + +// Map type VkWriteDescriptorSetPartitionedAccelerationStructureNV to id VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_PARTITIONED_ACCELERATION_STRUCTURE_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_PARTITIONED_ACCELERATION_STRUCTURE_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkWriteDescriptorSetPartitionedAccelerationStructureNV Type; +}; + +// Map type VkPartitionedAccelerationStructureInstancesInputNV to id VK_STRUCTURE_TYPE_PARTITIONED_ACCELERATION_STRUCTURE_INSTANCES_INPUT_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PARTITIONED_ACCELERATION_STRUCTURE_INSTANCES_INPUT_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPartitionedAccelerationStructureInstancesInputNV Type; +}; + +// Map type VkBuildPartitionedAccelerationStructureInfoNV to id VK_STRUCTURE_TYPE_BUILD_PARTITIONED_ACCELERATION_STRUCTURE_INFO_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_BUILD_PARTITIONED_ACCELERATION_STRUCTURE_INFO_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkBuildPartitionedAccelerationStructureInfoNV Type; +}; + +// Map type VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT Type; +}; + +// Map type VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT Type; +}; + +// Map type VkGeneratedCommandsMemoryRequirementsInfoEXT to id VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkGeneratedCommandsMemoryRequirementsInfoEXT Type; +}; + +// Map type VkIndirectExecutionSetPipelineInfoEXT to id VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_PIPELINE_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_PIPELINE_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkIndirectExecutionSetPipelineInfoEXT Type; +}; + +// Map type VkIndirectExecutionSetShaderLayoutInfoEXT to id VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_LAYOUT_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_LAYOUT_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkIndirectExecutionSetShaderLayoutInfoEXT Type; +}; + +// Map type VkIndirectExecutionSetShaderInfoEXT to id VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkIndirectExecutionSetShaderInfoEXT Type; +}; + +// Map type VkIndirectExecutionSetCreateInfoEXT to id VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_CREATE_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_CREATE_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkIndirectExecutionSetCreateInfoEXT Type; +}; + +// Map type VkGeneratedCommandsInfoEXT to id VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkGeneratedCommandsInfoEXT Type; +}; + +// Map type VkWriteIndirectExecutionSetPipelineEXT to id VK_STRUCTURE_TYPE_WRITE_INDIRECT_EXECUTION_SET_PIPELINE_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_WRITE_INDIRECT_EXECUTION_SET_PIPELINE_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkWriteIndirectExecutionSetPipelineEXT Type; +}; + +// Map type VkIndirectCommandsLayoutTokenEXT to id VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkIndirectCommandsLayoutTokenEXT Type; +}; + +// Map type VkIndirectCommandsLayoutCreateInfoEXT to id VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkIndirectCommandsLayoutCreateInfoEXT Type; +}; + +// Map type VkGeneratedCommandsPipelineInfoEXT to id VK_STRUCTURE_TYPE_GENERATED_COMMANDS_PIPELINE_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_GENERATED_COMMANDS_PIPELINE_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkGeneratedCommandsPipelineInfoEXT Type; +}; + +// Map type VkGeneratedCommandsShaderInfoEXT to id VK_STRUCTURE_TYPE_GENERATED_COMMANDS_SHADER_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_GENERATED_COMMANDS_SHADER_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkGeneratedCommandsShaderInfoEXT Type; +}; + +// Map type VkWriteIndirectExecutionSetShaderEXT to id VK_STRUCTURE_TYPE_WRITE_INDIRECT_EXECUTION_SET_SHADER_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_WRITE_INDIRECT_EXECUTION_SET_SHADER_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkWriteIndirectExecutionSetShaderEXT Type; +}; + // Map type VkPhysicalDeviceImageAlignmentControlFeaturesMESA to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA; @@ -8172,6 +8892,120 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceDepthClampControlFeaturesEXT Type; +}; + +// Map type VkPipelineViewportDepthClampControlCreateInfoEXT to id VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLAMP_CONTROL_CREATE_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLAMP_CONTROL_CREATE_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkPipelineViewportDepthClampControlCreateInfoEXT Type; +}; + +// Map type VkPhysicalDeviceHdrVividFeaturesHUAWEI to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceHdrVividFeaturesHUAWEI Type; +}; + +// Map type VkHdrVividDynamicMetadataHUAWEI to id VK_STRUCTURE_TYPE_HDR_VIVID_DYNAMIC_METADATA_HUAWEI +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_HDR_VIVID_DYNAMIC_METADATA_HUAWEI; +}; + +template <> struct LvlSTypeMap { + typedef VkHdrVividDynamicMetadataHUAWEI Type; +}; + +// Map type VkCooperativeMatrixFlexibleDimensionsPropertiesNV to id VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_FLEXIBLE_DIMENSIONS_PROPERTIES_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_FLEXIBLE_DIMENSIONS_PROPERTIES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkCooperativeMatrixFlexibleDimensionsPropertiesNV Type; +}; + +// Map type VkPhysicalDeviceCooperativeMatrix2FeaturesNV to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceCooperativeMatrix2FeaturesNV Type; +}; + +// Map type VkPhysicalDeviceCooperativeMatrix2PropertiesNV to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_PROPERTIES_NV +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_PROPERTIES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceCooperativeMatrix2PropertiesNV Type; +}; + +// Map type VkPhysicalDevicePipelineOpacityMicromapFeaturesARM to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_OPACITY_MICROMAP_FEATURES_ARM +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_OPACITY_MICROMAP_FEATURES_ARM; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDevicePipelineOpacityMicromapFeaturesARM Type; +}; + +#ifdef VK_USE_PLATFORM_METAL_EXT +// Map type VkImportMemoryMetalHandleInfoEXT to id VK_STRUCTURE_TYPE_IMPORT_MEMORY_METAL_HANDLE_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_METAL_HANDLE_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkImportMemoryMetalHandleInfoEXT Type; +}; + +#endif // VK_USE_PLATFORM_METAL_EXT +#ifdef VK_USE_PLATFORM_METAL_EXT +// Map type VkMemoryMetalHandlePropertiesEXT to id VK_STRUCTURE_TYPE_MEMORY_METAL_HANDLE_PROPERTIES_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_MEMORY_METAL_HANDLE_PROPERTIES_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkMemoryMetalHandlePropertiesEXT Type; +}; + +#endif // VK_USE_PLATFORM_METAL_EXT +#ifdef VK_USE_PLATFORM_METAL_EXT +// Map type VkMemoryGetMetalHandleInfoEXT to id VK_STRUCTURE_TYPE_MEMORY_GET_METAL_HANDLE_INFO_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_MEMORY_GET_METAL_HANDLE_INFO_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkMemoryGetMetalHandleInfoEXT Type; +}; + +#endif // VK_USE_PLATFORM_METAL_EXT +// Map type VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT Type; +}; + // Map type VkAccelerationStructureGeometryTrianglesDataKHR to id VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR; @@ -8298,15 +9132,6 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkAccelerationStructureBuildSizesInfoKHR Type; -}; - // Map type VkRayTracingShaderGroupCreateInfoKHR to id VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR; diff --git a/scripts/generate_source.py b/scripts/generate_source.py index 6c63f0c9d..8b1e3acf1 100755 --- a/scripts/generate_source.py +++ b/scripts/generate_source.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 -# Copyright (c) 2019-2023 The Khronos Group Inc. -# Copyright (c) 2019-2023 Valve Corporation -# Copyright (c) 2019-2023 LunarG, Inc. -# Copyright (c) 2019-2023 Google Inc. -# Copyright (c) 2023-2023 RasterGrid Kft. +# Copyright (c) 2019-2025 The Khronos Group Inc. +# Copyright (c) 2019-2025 Valve Corporation +# Copyright (c) 2019-2025 LunarG, Inc. +# Copyright (c) 2019-2025 Google Inc. +# Copyright (c) 2023-2025 RasterGrid Kft. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -76,6 +76,13 @@ def main(argv): for path in files_to_gen.keys(): os.makedirs(os.path.join(temp_dir, path)) + registry = os.path.abspath(os.path.join(args.registry, 'vk.xml')) + if not os.path.isfile(registry): + registry = os.path.abspath(os.path.join(args.registry, 'Vulkan-Headers/registry/vk.xml')) + if not os.path.isfile(registry): + print(f'cannot find vk.xml in {args.registry}') + return -1 + # run each code generator for path, filenames in files_to_gen.items(): for filename in filenames: @@ -86,7 +93,7 @@ def main(argv): cmd = [common_codegen.repo_relative(os.path.join('scripts','kvt_genvk.py')), '-api', args.api, - '-registry', os.path.abspath(os.path.join(args.registry, 'vk.xml')), + '-registry', registry, '-quiet', '-directory', output_path, filename] print(' '.join(cmd)) try: diff --git a/scripts/known_good.json b/scripts/known_good.json index 177ddda84..e59c83caa 100644 --- a/scripts/known_good.json +++ b/scripts/known_good.json @@ -7,7 +7,7 @@ "sub_dir": "Vulkan-Headers", "build_dir": "Vulkan-Headers/build", "install_dir": "Vulkan-Headers/build/install", - "commit": "v1.3.293" + "commit": "v1.4.307" }, { "name": "MoltenVK", @@ -15,7 +15,7 @@ "sub_dir": "MoltenVK", "build_dir": "MoltenVK", "install_dir": "MoltenVK", - "commit": "v1.2.9", + "commit": "v1.2.11", "custom_build": [ "./fetchDependencies --macos", "xcodebuild -project MoltenVKPackaging.xcodeproj GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS MVK_CONFIG_LOG_LEVEL=1' -scheme \"MoltenVK Package (macOS only)\" build" @@ -35,7 +35,7 @@ "cmake_options": [ "-DVOLK_INSTALL=ON" ], - "commit": "vulkan-sdk-1.3.290", + "commit": "vulkan-sdk-1.4.304", "deps": [ { "var_name": "VULKAN_HEADERS_INSTALL_DIR", @@ -74,7 +74,7 @@ "cmake_options": [ "-DLOADER_USE_UNSAFE_FILE_SEARCH=ON" ], - "commit": "v1.3.293", + "commit": "v1.4.307", "build_platforms": [ "windows", "linux", diff --git a/scripts/kvt_genvk.py b/scripts/kvt_genvk.py index 8f6b6ee90..8b9de7b7d 100644 --- a/scripts/kvt_genvk.py +++ b/scripts/kvt_genvk.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 # -# Copyright (c) 2013-2024 The Khronos Group Inc. -# Copyright (c) 2023-2024 RasterGrid Kft. +# Copyright (c) 2013-2025 The Khronos Group Inc. +# Copyright (c) 2023-2025 RasterGrid Kft. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,9 +16,7 @@ # limitations under the License. import argparse -import cProfile import pdb -import string import sys import time import os @@ -104,7 +102,7 @@ def makeGenOpts(args): # Copyright text prefixing all headers (list of strings). prefixStrings = [ '/*', - '** Copyright (c) 2015-2024 The Khronos Group Inc.', + '** Copyright (c) 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.', @@ -236,7 +234,8 @@ def makeGenOpts(args): apientry='VKAPI_CALL ', apientryp='VKAPI_PTR *', alignFuncParam=48, - expandEnumerants=False) + expandEnumerants=False, + registryFile=args.registry) ] diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py index 55b371240..49176b50b 100644 --- a/scripts/mock_icd_generator.py +++ b/scripts/mock_icd_generator.py @@ -1,10 +1,10 @@ #!/usr/bin/python3 -i # -# Copyright (c) 2015-2023 The Khronos Group Inc. -# Copyright (c) 2015-2023 Valve Corporation -# Copyright (c) 2015-2023 LunarG, Inc. -# Copyright (c) 2015-2023 Google Inc. -# Copyright (c) 2023-2023 RasterGrid Kft. +# Copyright (c) 2015-2025 The Khronos Group Inc. +# Copyright (c) 2015-2025 Valve Corporation +# Copyright (c) 2015-2025 LunarG, Inc. +# Copyright (c) 2015-2025 Google Inc. +# Copyright (c) 2023-2025 RasterGrid Kft. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -413,7 +413,8 @@ auto video_props = lvl_find_mod_in_chain(pQueueFamilyProperties[2].pNext); if (video_props) { video_props->videoCodecOperations = VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR - | VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR; + | VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR + | VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR; } } if (*pQueueFamilyPropertyCount > 3) { @@ -676,6 +677,12 @@ fragment_density_map2_props->maxDescriptorSetSubsampledSamplers = 1; } + auto *maintenance3_props = lvl_find_mod_in_chain(pProperties->pNext); + if (maintenance3_props) { + maintenance3_props->maxMemoryAllocationSize = 1073741824; + maintenance3_props->maxPerSetDescriptors = 1024; + } + const uint32_t num_copy_layouts = 5; const VkImageLayout HostCopyLayouts[]{ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, @@ -1100,8 +1107,17 @@ auto caps_decode_h265 = lvl_find_mod_in_chain(pCapabilities->pNext); auto caps_decode_av1 = lvl_find_mod_in_chain(pCapabilities->pNext); auto caps_encode = lvl_find_mod_in_chain(pCapabilities->pNext); + auto caps_encode_quantization_map = + lvl_find_mod_in_chain(pCapabilities->pNext); + auto caps_encode_h264_quantization_map = + lvl_find_mod_in_chain(pCapabilities->pNext); + auto caps_encode_h265_quantization_map = + lvl_find_mod_in_chain(pCapabilities->pNext); + auto caps_encode_av1_quantization_map = + lvl_find_mod_in_chain(pCapabilities->pNext); auto caps_encode_h264 = lvl_find_mod_in_chain(pCapabilities->pNext); auto caps_encode_h265 = lvl_find_mod_in_chain(pCapabilities->pNext); + auto caps_encode_av1 = lvl_find_mod_in_chain(pCapabilities->pNext); switch (pVideoProfile->videoCodecOperation) { case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR: { @@ -1253,7 +1269,9 @@ switch (pVideoProfile->chromaSubsampling) { case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: - caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR; + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR + | VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR + | VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR; caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR | VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR | VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR; @@ -1281,9 +1299,20 @@ caps_encode_h264->maxQp = 51; caps_encode_h264->prefersGopRemainingFrames = VK_FALSE; caps_encode_h264->requiresGopRemainingFrames = VK_FALSE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 15) / 16, + (caps->maxCodedExtent.height + 15) / 16}; + } + + if (caps_encode_h264_quantization_map) { + caps_encode_h264_quantization_map->minQpDelta = -26; + caps_encode_h264_quantization_map->maxQpDelta = +25; + } break; case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: - caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR; + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR + | VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR; caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR | VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR; caps_encode->maxRateControlLayers = 1; @@ -1306,6 +1335,16 @@ caps_encode_h264->maxQp = 30; caps_encode_h264->prefersGopRemainingFrames = VK_TRUE; caps_encode_h264->requiresGopRemainingFrames = VK_FALSE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 15) / 16, + (caps->maxCodedExtent.height + 15) / 16}; + } + + if (caps_encode_h264_quantization_map) { + caps_encode_h264_quantization_map->minQpDelta = 0; + caps_encode_h264_quantization_map->maxQpDelta = 0; + } break; case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: caps_encode->flags = 0; @@ -1330,6 +1369,15 @@ caps_encode_h264->maxQp = 40; caps_encode_h264->prefersGopRemainingFrames = VK_TRUE; caps_encode_h264->requiresGopRemainingFrames = VK_TRUE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {0, 0}; + } + + if (caps_encode_h264_quantization_map) { + caps_encode_h264_quantization_map->minQpDelta = 0; + caps_encode_h264_quantization_map->maxQpDelta = 0; + } break; default: return VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR; @@ -1355,7 +1403,7 @@ switch (pVideoProfile->chromaSubsampling) { case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: - caps_encode->flags = 0; + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR; caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR; caps_encode->maxRateControlLayers = 1; caps_encode->maxBitrate = 800000000; @@ -1386,9 +1434,19 @@ caps_encode_h265->maxQp = 32; caps_encode_h265->prefersGopRemainingFrames = VK_FALSE; caps_encode_h265->requiresGopRemainingFrames = VK_FALSE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 3) / 4, + (caps->maxCodedExtent.height + 3) / 4}; + } + + if (caps_encode_h265_quantization_map) { + caps_encode_h265_quantization_map->minQpDelta = -16; + caps_encode_h265_quantization_map->maxQpDelta = +15; + } break; case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: - caps_encode->flags = 0; + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR; caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR; caps_encode->maxRateControlLayers = 0; caps_encode->maxBitrate = 480000000; @@ -1414,6 +1472,16 @@ caps_encode_h265->maxQp = 51; caps_encode_h265->prefersGopRemainingFrames = VK_TRUE; caps_encode_h265->requiresGopRemainingFrames = VK_FALSE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 31) / 32, + (caps->maxCodedExtent.height + 31) / 32}; + } + + if (caps_encode_h265_quantization_map) { + caps_encode_h265_quantization_map->minQpDelta = 0; + caps_encode_h265_quantization_map->maxQpDelta = 0; + } break; case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR; @@ -1444,13 +1512,180 @@ caps_encode_h265->maxQp = 51; caps_encode_h265->prefersGopRemainingFrames = VK_TRUE; caps_encode_h265->requiresGopRemainingFrames = VK_TRUE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {0, 0}; + } + + if (caps_encode_h265_quantization_map) { + caps_encode_h265_quantization_map->minQpDelta = 0; + caps_encode_h265_quantization_map->maxQpDelta = 0; + } break; default: return VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR; } break; } + case VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR: { + auto profile = lvl_find_in_chain(pVideoProfile->pNext); + if (profile->stdProfile != STD_VIDEO_AV1_PROFILE_MAIN) { + return VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR; + } + + caps->flags = VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR; + caps->minBitstreamBufferOffsetAlignment = 1; + caps->minBitstreamBufferSizeAlignment = 1; + caps->pictureAccessGranularity = {8,8}; + caps->minCodedExtent = {192,128}; + caps->maxCodedExtent = {4096,2560}; + caps->maxDpbSlots = 8; + caps->maxActiveReferencePictures = 2; + std::strncpy(caps->stdHeaderVersion.extensionName, VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_EXTENSION_NAME, sizeof(caps->stdHeaderVersion.extensionName)); + caps->stdHeaderVersion.specVersion = VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_SPEC_VERSION; + + switch (pVideoProfile->chromaSubsampling) { + case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR + | VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR; + caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR; + caps_encode->maxRateControlLayers = 1; + caps_encode->maxBitrate = 800000000; + caps_encode->maxQualityLevels = 1; + caps_encode->encodeInputPictureGranularity = {64,64}; + caps_encode->supportedEncodeFeedbackFlags = VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR + | VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR; + caps_encode_av1->flags = VK_VIDEO_ENCODE_AV1_CAPABILITY_PRIMARY_REFERENCE_CDF_ONLY_BIT_KHR; + caps_encode_av1->maxLevel = STD_VIDEO_AV1_LEVEL_6_2; + caps_encode_av1->maxTiles = {1,1}; + caps_encode_av1->minTileSize = {64,64}; + caps_encode_av1->maxTileSize = {4096,2560}; + caps_encode_av1->superblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR; + caps_encode_av1->maxSingleReferenceCount = 1; + caps_encode_av1->singleReferenceNameMask = 0x7B; + caps_encode_av1->maxUnidirectionalCompoundReferenceCount = 0; + caps_encode_av1->maxUnidirectionalCompoundGroup1ReferenceCount = 0; + caps_encode_av1->unidirectionalCompoundReferenceNameMask = 0x00; + caps_encode_av1->maxBidirectionalCompoundReferenceCount = 0; + caps_encode_av1->maxBidirectionalCompoundGroup1ReferenceCount = 0; + caps_encode_av1->maxBidirectionalCompoundGroup2ReferenceCount = 0; + caps_encode_av1->bidirectionalCompoundReferenceNameMask = 0x00; + caps_encode_av1->maxTemporalLayerCount = 1; + caps_encode_av1->maxSpatialLayerCount = 1; + caps_encode_av1->maxOperatingPoints = 1; + caps_encode_av1->minQIndex = 32; + caps_encode_av1->maxQIndex = 128; + caps_encode_av1->prefersGopRemainingFrames = VK_FALSE; + caps_encode_av1->requiresGopRemainingFrames = VK_FALSE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 7) / 8, + (caps->maxCodedExtent.height + 7) / 8}; + } + + if (caps_encode_av1_quantization_map) { + caps_encode_av1_quantization_map->minQIndexDelta = -64; + caps_encode_av1_quantization_map->maxQIndexDelta = +64; + } + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR; + caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR; + caps_encode->maxRateControlLayers = 0; + caps_encode->maxBitrate = 480000000; + caps_encode->maxQualityLevels = 2; + caps_encode->encodeInputPictureGranularity = {32,32}; + caps_encode->supportedEncodeFeedbackFlags = VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR + | VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR; + caps_encode_av1->flags = VK_VIDEO_ENCODE_AV1_CAPABILITY_PRIMARY_REFERENCE_CDF_ONLY_BIT_KHR + | VK_VIDEO_ENCODE_AV1_CAPABILITY_GENERATE_OBU_EXTENSION_HEADER_BIT_KHR + | VK_VIDEO_ENCODE_AV1_CAPABILITY_FRAME_SIZE_OVERRIDE_BIT_KHR; + caps_encode_av1->maxLevel = STD_VIDEO_AV1_LEVEL_6_1; + caps_encode_av1->maxTiles = {2,2}; + caps_encode_av1->minTileSize = {128,128}; + caps_encode_av1->maxTileSize = {4096,2048}; + caps_encode_av1->superblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR + | VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_128_BIT_KHR; + caps_encode_av1->maxSingleReferenceCount = 0; + caps_encode_av1->singleReferenceNameMask = 0x00; + caps_encode_av1->maxUnidirectionalCompoundReferenceCount = 2; + caps_encode_av1->maxUnidirectionalCompoundGroup1ReferenceCount = 2; + caps_encode_av1->unidirectionalCompoundReferenceNameMask = 0x5F; + caps_encode_av1->maxBidirectionalCompoundReferenceCount = 2; + caps_encode_av1->maxBidirectionalCompoundGroup1ReferenceCount = 2; + caps_encode_av1->maxBidirectionalCompoundGroup2ReferenceCount = 2; + caps_encode_av1->bidirectionalCompoundReferenceNameMask = 0x5F; + caps_encode_av1->maxTemporalLayerCount = 4; + caps_encode_av1->maxSpatialLayerCount = 1; + caps_encode_av1->maxOperatingPoints = 4; + caps_encode_av1->minQIndex = 0; + caps_encode_av1->maxQIndex = 255; + caps_encode_av1->prefersGopRemainingFrames = VK_TRUE; + caps_encode_av1->requiresGopRemainingFrames = VK_FALSE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 63) / 64, + (caps->maxCodedExtent.height + 63) / 64}; + } + + if (caps_encode_av1_quantization_map) { + caps_encode_av1_quantization_map->minQIndexDelta = -255; + caps_encode_av1_quantization_map->maxQIndexDelta = +255; + } + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: + caps_encode->flags = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR + | VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR; + caps_encode->rateControlModes = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR + | VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR + | VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR; + caps_encode->maxRateControlLayers = 2; + caps_encode->maxBitrate = 240000000; + caps_encode->maxQualityLevels = 3; + caps_encode->encodeInputPictureGranularity = {16,16}; + caps_encode->supportedEncodeFeedbackFlags = VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR + | VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR + | VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR; + caps_encode_av1->flags = VK_VIDEO_ENCODE_AV1_CAPABILITY_PER_RATE_CONTROL_GROUP_MIN_MAX_Q_INDEX_BIT_KHR + | VK_VIDEO_ENCODE_AV1_CAPABILITY_FRAME_SIZE_OVERRIDE_BIT_KHR + | VK_VIDEO_ENCODE_AV1_CAPABILITY_MOTION_VECTOR_SCALING_BIT_KHR; + caps_encode_av1->maxLevel = STD_VIDEO_AV1_LEVEL_5_1; + caps_encode_av1->maxTiles = {4,4}; + caps_encode_av1->minTileSize = {128,128}; + caps_encode_av1->maxTileSize = {2048,2048}; + caps_encode_av1->superblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_128_BIT_KHR; + caps_encode_av1->maxSingleReferenceCount = 1; + caps_encode_av1->singleReferenceNameMask = 0x5F; + caps_encode_av1->maxUnidirectionalCompoundReferenceCount = 4; + caps_encode_av1->maxUnidirectionalCompoundGroup1ReferenceCount = 4; + caps_encode_av1->unidirectionalCompoundReferenceNameMask = 0x5B; + caps_encode_av1->maxBidirectionalCompoundReferenceCount = 0; + caps_encode_av1->maxBidirectionalCompoundGroup1ReferenceCount = 0; + caps_encode_av1->maxBidirectionalCompoundGroup2ReferenceCount = 0; + caps_encode_av1->bidirectionalCompoundReferenceNameMask = 0x00; + caps_encode_av1->maxTemporalLayerCount = 4; + caps_encode_av1->maxSpatialLayerCount = 2; + caps_encode_av1->maxOperatingPoints = 2; + caps_encode_av1->minQIndex = 16; + caps_encode_av1->maxQIndex = 96; + caps_encode_av1->prefersGopRemainingFrames = VK_TRUE; + caps_encode_av1->requiresGopRemainingFrames = VK_TRUE; + + if (caps_encode_quantization_map) { + caps_encode_quantization_map->maxQuantizationMapExtent = {(caps->maxCodedExtent.width + 127) / 128, + (caps->maxCodedExtent.height + 127) / 128}; + } + if (caps_encode_av1_quantization_map) { + caps_encode_av1_quantization_map->minQIndexDelta = -64; + caps_encode_av1_quantization_map->maxQIndexDelta = +63; + } + break; + default: + return VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR; + } + break; + } default: break; } @@ -1463,68 +1698,65 @@ return VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR; } - std::vector format_props{}; + struct VideoFormatProperties { + VkVideoFormatPropertiesKHR props; + VkVideoFormatQuantizationMapPropertiesKHR props_quantization_map; + VkVideoFormatH265QuantizationMapPropertiesKHR props_h265_quantization_map; + VkVideoFormatAV1QuantizationMapPropertiesKHR props_av1_quantization_map; + }; - VkVideoFormatPropertiesKHR props = {}; - props.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR; - props.imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT - | VK_IMAGE_CREATE_ALIAS_BIT - | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT - | VK_IMAGE_CREATE_PROTECTED_BIT - | VK_IMAGE_CREATE_DISJOINT_BIT; - props.imageType = VK_IMAGE_TYPE_2D; - props.imageTiling = VK_IMAGE_TILING_OPTIMAL; + std::vector format_props{}; + VideoFormatProperties fmt = {}; + fmt.props.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR; + fmt.props.imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_ALIAS_BIT | + VK_IMAGE_CREATE_EXTENDED_USAGE_BIT | VK_IMAGE_CREATE_PROTECTED_BIT | VK_IMAGE_CREATE_DISJOINT_BIT; + fmt.props.imageType = VK_IMAGE_TYPE_2D; + fmt.props.imageTiling = VK_IMAGE_TILING_OPTIMAL; + fmt.props_quantization_map.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR; + fmt.props_h265_quantization_map.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR; + fmt.props_av1_quantization_map.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR; + + // Populate DPB and input/output formats switch (profile_list->pProfiles[0].videoCodecOperation) { case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR: case VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR: case VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR: switch (profile_list->pProfiles[0].chromaSubsampling) { case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: - props.format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM; - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; - format_props.push_back(props); - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_SAMPLED_BIT - | VK_IMAGE_USAGE_STORAGE_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - format_props.push_back(props); - props.format = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM; - format_props.push_back(props); + fmt.props.format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM; + fmt.props.imageUsageFlags = + VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; + format_props.push_back(fmt); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR | + VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; + format_props.push_back(fmt); + fmt.props.format = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM; + format_props.push_back(fmt); break; case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: - props.imageUsageFlags = VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; - props.format = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM; - format_props.push_back(props); - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_SAMPLED_BIT - | VK_IMAGE_USAGE_STORAGE_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - format_props.push_back(props); - props.format = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16; - format_props.push_back(props); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; + fmt.props.format = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM; + format_props.push_back(fmt); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; + format_props.push_back(fmt); + fmt.props.format = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16; + format_props.push_back(fmt); break; case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: - props.format = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM; - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; - format_props.push_back(props); - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_SAMPLED_BIT - | VK_IMAGE_USAGE_STORAGE_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - format_props.push_back(props); + fmt.props.format = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM; + fmt.props.imageUsageFlags = + VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; + format_props.push_back(fmt); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR | + VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; + format_props.push_back(fmt); break; default: return VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR; @@ -1532,50 +1764,40 @@ break; case VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR: case VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR: + case VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR: switch (profile_list->pProfiles[0].chromaSubsampling) { case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: - props.format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM; - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR; - format_props.push_back(props); - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_SAMPLED_BIT - | VK_IMAGE_USAGE_STORAGE_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - format_props.push_back(props); - props.format = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM; - format_props.push_back(props); + fmt.props.format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM; + fmt.props.imageUsageFlags = + VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR; + format_props.push_back(fmt); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; + format_props.push_back(fmt); + fmt.props.format = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM; + format_props.push_back(fmt); break; case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: - props.format = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM; - props.imageUsageFlags = VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR; - format_props.push_back(props); - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_SAMPLED_BIT - | VK_IMAGE_USAGE_STORAGE_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - format_props.push_back(props); - props.format = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16; - format_props.push_back(props); + fmt.props.format = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR; + format_props.push_back(fmt); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; + format_props.push_back(fmt); + fmt.props.format = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16; + format_props.push_back(fmt); break; case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: - props.format = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM; - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR; - format_props.push_back(props); - props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT - | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_SAMPLED_BIT - | VK_IMAGE_USAGE_STORAGE_BIT - | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - format_props.push_back(props); + fmt.props.format = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM; + fmt.props.imageUsageFlags = + VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR; + format_props.push_back(fmt); + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; + format_props.push_back(fmt); break; default: return VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR; @@ -1586,19 +1808,153 @@ break; } - std::vector filtered_props; - for (const auto& fmt_props : format_props) { - if ((pVideoFormatInfo->imageUsage & fmt_props.imageUsageFlags) == pVideoFormatInfo->imageUsage) { - filtered_props.push_back(fmt_props); + // Populate quantization map formats + fmt.props.imageCreateFlags = VK_IMAGE_CREATE_PROTECTED_BIT; + fmt.props.imageTiling = VK_IMAGE_TILING_LINEAR; + switch (profile_list->pProfiles[0].videoCodecOperation) { + case VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR: + switch (profile_list->pProfiles[0].chromaSubsampling) { + case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: + fmt.props.format = VK_FORMAT_R32_SINT; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {16, 16}; + format_props.push_back(fmt); + fmt.props.format = VK_FORMAT_R8_UNORM; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR; + format_props.push_back(fmt); + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: + fmt.props.format = VK_FORMAT_R8_UNORM; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {16, 16}; + format_props.push_back(fmt); + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: + break; + default: + break; + } + break; + case VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR: + switch (profile_list->pProfiles[0].chromaSubsampling) { + case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: + fmt.props.format = VK_FORMAT_R8_UNORM; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {4, 4}; + fmt.props_h265_quantization_map.compatibleCtbSizes = + VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR | VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + fmt.props_quantization_map.quantizationMapTexelSize = {8, 8}; + format_props.push_back(fmt); + fmt.props_quantization_map.quantizationMapTexelSize = {32, 32}; + format_props.push_back(fmt); + fmt.props_quantization_map.quantizationMapTexelSize = {64, 64}; + fmt.props_h265_quantization_map.compatibleCtbSizes = VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: + fmt.props.format = VK_FORMAT_R32_SINT; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {32, 32}; + fmt.props_h265_quantization_map.compatibleCtbSizes = + VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR | VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + fmt.props_quantization_map.quantizationMapTexelSize = {64, 64}; + fmt.props_h265_quantization_map.compatibleCtbSizes = VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: + break; + default: + break; + } + break; + case VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR: + switch (profile_list->pProfiles[0].chromaSubsampling) { + case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: + fmt.props.format = VK_FORMAT_R32_SINT; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {8, 8}; + fmt.props_av1_quantization_map.compatibleSuperblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + fmt.props.format = VK_FORMAT_R8_UNORM; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {64, 64}; + fmt.props_av1_quantization_map.compatibleSuperblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: + fmt.props.format = VK_FORMAT_R32_SINT; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {64, 64}; + fmt.props_av1_quantization_map.compatibleSuperblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR; + format_props.push_back(fmt); + fmt.props_quantization_map.quantizationMapTexelSize = {128, 128}; + fmt.props_av1_quantization_map.compatibleSuperblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_128_BIT_KHR; + format_props.push_back(fmt); + break; + case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: + fmt.props.format = VK_FORMAT_R8_UNORM; + fmt.props.imageUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR; + fmt.props_quantization_map.quantizationMapTexelSize = {128, 128}; + fmt.props_av1_quantization_map.compatibleSuperblockSizes = VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_128_BIT_KHR; + format_props.push_back(fmt); + break; + default: + break; + } + break; + + default: + break; + } + + std::vector filtered; + for (const auto& format : format_props) { + if ((pVideoFormatInfo->imageUsage & format.props.imageUsageFlags) == pVideoFormatInfo->imageUsage) { + filtered.push_back(format); } } if (pVideoFormatProperties != nullptr) { - for (uint32_t i = 0; i < (std::min)(*pVideoFormatPropertyCount, (uint32_t)filtered_props.size()); ++i) { - pVideoFormatProperties[i] = filtered_props[i]; + for (uint32_t i = 0; i < (std::min)(*pVideoFormatPropertyCount, (uint32_t)filtered.size()); ++i) { + void* saved_pNext = pVideoFormatProperties[i].pNext; + pVideoFormatProperties[i] = filtered[i].props; + pVideoFormatProperties[i].pNext = saved_pNext; + + auto* props_quantization_map = lvl_find_mod_in_chain(saved_pNext); + auto* props_h265_quantization_map = lvl_find_mod_in_chain(saved_pNext); + auto* props_av1_quantization_map = lvl_find_mod_in_chain(saved_pNext); + + if (props_quantization_map != nullptr) { + saved_pNext = props_quantization_map->pNext; + *props_quantization_map = filtered[i].props_quantization_map; + props_quantization_map->pNext = saved_pNext; + } + + if (props_h265_quantization_map != nullptr) { + saved_pNext = props_h265_quantization_map->pNext; + *props_h265_quantization_map = filtered[i].props_h265_quantization_map; + props_h265_quantization_map->pNext = saved_pNext; + } + + if (props_av1_quantization_map != nullptr) { + saved_pNext = props_av1_quantization_map->pNext; + *props_av1_quantization_map = filtered[i].props_av1_quantization_map; + props_av1_quantization_map->pNext = saved_pNext; + } } } - *pVideoFormatPropertyCount = (uint32_t)filtered_props.size(); + *pVideoFormatPropertyCount = (uint32_t)filtered.size(); return VK_SUCCESS; ''', 'vkGetDescriptorSetLayoutSupport':''' @@ -1669,6 +2025,13 @@ 'vkGetMemoryWin32HandlePropertiesKHR': ''' pMemoryWin32HandleProperties->memoryTypeBits = 0xFFFF; return VK_SUCCESS; +''', +'vkCreatePipelineBinariesKHR': ''' + unique_lock_t lock(global_lock); + for (uint32_t i = 0; i < pBinaries->pipelineBinaryCount; ++i) { + pBinaries->pPipelineBinaries[i] = (VkPipelineBinaryKHR)global_unique_handle++; + } + return VK_SUCCESS; ''' } diff --git a/scripts/update_deps.py b/scripts/update_deps.py index d010f9b21..47810a00c 100755 --- a/scripts/update_deps.py +++ b/scripts/update_deps.py @@ -415,8 +415,15 @@ def Checkout(self): if VERBOSE: print('Checking out {n} in {d}'.format(n=self.name, d=self.repo_dir)) - if self._args.do_clean_repo: + if os.path.exists(os.path.join(self.repo_dir, '.git')): + url_changed = command_output(['git', 'config', '--get', 'remote.origin.url'], self.repo_dir).strip() != self.url + else: + url_changed = False + + if self._args.do_clean_repo or url_changed: if os.path.isdir(self.repo_dir): + if VERBOSE: + print('Clearing directory {d}'.format(d=self.repo_dir)) shutil.rmtree(self.repo_dir, onerror = on_rm_error) if not os.path.exists(os.path.join(self.repo_dir, '.git')): self.Clone() @@ -615,7 +622,7 @@ def CreateHelper(args, repos, filename): if repo.api is not None and repo.api != args.api: continue if install_names and repo.name in install_names and repo.on_build_platform: - helper_file.write('set({var} "{dir}" CACHE STRING "" FORCE)\n' + helper_file.write('set({var} "{dir}" CACHE STRING "")\n' .format( var=install_names[repo.name], dir=escape(repo.install_dir))) diff --git a/scripts/vulkaninfo_generator.py b/scripts/vulkaninfo_generator.py index 46125f984..221d15c5e 100644 --- a/scripts/vulkaninfo_generator.py +++ b/scripts/vulkaninfo_generator.py @@ -3,7 +3,7 @@ # Copyright (c) 2019-2022 Valve Corporation # Copyright (c) 2019-2022 LunarG, Inc. # Copyright (c) 2019-2022 Google Inc. -# Copyright (c) 2023-2023 RasterGrid Kft. +# Copyright (c) 2023-2024 RasterGrid Kft. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,19 +20,22 @@ # Author: Charles Giessen import re +import os import sys +import copy import operator from collections import OrderedDict import generator as gen from common_codegen import GetFeatureProtect from generator import GeneratorOptions, OutputGenerator +import xml.etree.ElementTree as etree LICENSE_HEADER = ''' /* * Copyright (c) 2019-2022 The Khronos Group Inc. * Copyright (c) 2019-2022 Valve Corporation * Copyright (c) 2019-2022 LunarG, Inc. - * Copyright (c) 2023-2023 RasterGrid Kft. + * Copyright (c) 2023-2024 RasterGrid Kft. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +82,8 @@ # used in the .cpp code STRUCTURES_TO_GEN = ['VkExtent3D', 'VkExtent2D', 'VkPhysicalDeviceLimits', 'VkPhysicalDeviceFeatures', 'VkPhysicalDeviceSparseProperties', 'VkSurfaceCapabilitiesKHR', 'VkSurfaceFormatKHR', 'VkLayerProperties', 'VkPhysicalDeviceToolProperties', 'VkFormatProperties', - 'VkSurfacePresentScalingCapabilitiesEXT', 'VkSurfacePresentModeCompatibilityEXT', 'VkPhysicalDeviceHostImageCopyPropertiesEXT'] + 'VkSurfacePresentScalingCapabilitiesEXT', 'VkSurfacePresentModeCompatibilityEXT', 'VkPhysicalDeviceHostImageCopyProperties', + 'VkVideoProfileInfoKHR', 'VkVideoCapabilitiesKHR', 'VkVideoFormatPropertiesKHR'] ENUMS_TO_GEN = ['VkResult', 'VkFormat', 'VkPresentModeKHR', 'VkPhysicalDeviceType', 'VkImageTiling'] FLAGS_TO_GEN = ['VkSurfaceTransformFlagsKHR', 'VkCompositeAlphaFlagsKHR', 'VkSurfaceCounterFlagsEXT', 'VkQueueFlags', @@ -91,7 +95,7 @@ STRUCT_COMPARISONS_TO_GEN = ['VkSurfaceFormatKHR', 'VkSurfaceFormat2KHR', 'VkSurfaceCapabilitiesKHR', 'VkSurfaceCapabilities2KHR', 'VkSurfaceCapabilities2EXT'] # don't generate these structures -STRUCT_BLACKLIST = ['VkVideoProfileListInfoKHR', 'VkVideoProfileInfoKHR', 'VkDrmFormatModifierPropertiesListEXT', 'VkDrmFormatModifierPropertiesEXT', 'VkDrmFormatModifierPropertiesList2EXT'] +STRUCT_BLACKLIST = ['VkVideoProfileListInfoKHR', 'VkDrmFormatModifierPropertiesListEXT', 'VkDrmFormatModifierPropertiesEXT', 'VkDrmFormatModifierPropertiesList2EXT'] # These structures are only used in version 1.1, otherwise they are included in the promoted structs STRUCT_1_1_LIST = ['VkPhysicalDeviceProtectedMemoryFeatures', 'VkPhysicalDeviceShaderDrawParametersFeatures', 'VkPhysicalDeviceSubgroupProperties', 'VkPhysicalDeviceProtectedMemoryProperties'] @@ -102,7 +106,7 @@ PREDEFINED_TYPES = ['char', 'VkBool32', 'uint32_t', 'uint8_t', 'int32_t', 'float', 'uint64_t', 'size_t', 'VkDeviceSize', 'int64_t'] -NAMES_TO_IGNORE = ['sType', 'pNext', 'stdProfileIdc'] +NAMES_TO_IGNORE = ['sType', 'pNext'] EXTENSION_TYPE_INSTANCE = 'instance' EXTENSION_TYPE_DEVICE = 'device' @@ -146,6 +150,24 @@ 'type': EXTENSION_TYPE_DEVICE, 'holder_type': 'VkQueueFamilyProperties2', 'print_iterator': True, + 'can_show_promoted_structs': False}), + ('video_profile_info', + {'extends': 'VkVideoProfileInfoKHR', + 'type': EXTENSION_TYPE_DEVICE, + 'holder_type': 'VkVideoProfileInfoKHR', + 'print_iterator': True, + 'can_show_promoted_structs': False}), + ('video_capabilities', + {'extends': 'VkVideoCapabilitiesKHR', + 'type': EXTENSION_TYPE_DEVICE, + 'holder_type': 'VkVideoCapabilitiesKHR', + 'print_iterator': True, + 'can_show_promoted_structs': False}), + ('video_format_properties', + {'extends': 'VkVideoFormatPropertiesKHR', + 'type': EXTENSION_TYPE_DEVICE, + 'holder_type': 'VkVideoFormatPropertiesKHR', + 'print_iterator': True, 'can_show_promoted_structs': False}) )) class VulkanInfoGeneratorOptions(GeneratorOptions): @@ -177,6 +199,7 @@ def __init__(self, indentFuncPointer=False, alignFuncParam=0, expandEnumerants=True, + registryFile='vk.xml' ): GeneratorOptions.__init__(self, conventions = conventions, @@ -205,6 +228,7 @@ def __init__(self, self.indentFuncProto = indentFuncProto self.indentFuncPointer = indentFuncPointer self.alignFuncParam = alignFuncParam + self.registryFile = registryFile # VulkanInfoGenerator - subclass of OutputGenerator. # Generates a vulkan info output helper function @@ -309,12 +333,14 @@ def endFile(self): out += '#include "outputprinter.h"\n' out += CUSTOM_FORMATTERS + out += self.genVideoEnums() + for enum in (e for e in self.enums if e.name in types_to_gen): out += PrintEnumToString(enum, self) out += PrintEnum(enum, self) for flag in self.flags: - if flag.name in types_to_gen: + if flag.name in types_to_gen or flag.enum in types_to_gen: for bitmask in (b for b in self.bitmasks if b.name == flag.enum): out += PrintBitMask(bitmask, flag.name, self) @@ -341,11 +367,454 @@ def endFile(self): out += f'static_cast({f.first_format}), static_cast({f.last_format})}},\n' out += '};\n' + out += self.genVideoProfileUtils() gen.write(out, file=self.outFile) gen.OutputGenerator.endFile(self) + def genVideoEnums(self): + # We need to add dumping utilities for enums declared in the video std headers and directly + # present in the Vulkan API structures. In order to do that we really have no choice but + # to parse the video.xml and generate the utilities based on the enum types defined there + videoRegistryFile = self.genOpts.registryFile.replace('vk.xml', 'video.xml') + if os.path.isfile(videoRegistryFile): + videoxml = etree.parse(videoRegistryFile) + else: + assert False, "Could not find video.xml to generate utilities for video enum types" + out = '' + for enum in videoxml.findall("./enums[@name]"): + enumname = enum.get('name') + out += f'std::string {enumname}String({enumname} value) {{\n' + out += ' switch (value) {\n' + for option in enum.findall("./enum[@name]"): + name = option.get('name') + # Ignore aliases + if option.get('value') is not None: + out += f' case {name}: return "{name}";\n' + out += f' default: return std::string("UNKNOWN_{enumname}_value") + std::to_string(value);\n' + out += ' }\n}\n' + out += f'void Dump{enumname}(Printer &p, std::string name, {enumname} value) {{\n' + out += f' p.PrintKeyString(name, {enumname}String(value));\n}}\n' + return out + + def genVideoProfileUtils(self): + out = '' + + # Parse video codec information from the XML + videoCodecs = OrderedDict() + xmlVideoCodecs = self.registry.reg.find("./videocodecs") + for xmlVideoCodec in xmlVideoCodecs.findall("./videocodec"): + name = xmlVideoCodec.get('name') + extend = xmlVideoCodec.get('extend') + value = xmlVideoCodec.get('value') + if value is None: + # Video codec category + videoCodecs[name] = VulkanVideoCodec(name) + else: + # Specific video codec + videoCodecs[name] = VulkanVideoCodec(name, videoCodecs[extend], value) + videoCodec = videoCodecs[name] + + for xmlVideoProfiles in xmlVideoCodec.findall("./videoprofiles"): + videoProfileStructName = xmlVideoProfiles.get('struct') + videoCodec.profileStructs[videoProfileStructName] = VulkanVideoProfileStruct(videoProfileStructName) + videoProfileStruct = videoCodec.profileStructs[videoProfileStructName] + + for xmlVideoProfileMember in xmlVideoProfiles.findall("./videoprofilemember"): + memberName = xmlVideoProfileMember.get('name') + videoProfileStruct.members[memberName] = VulkanVideoProfileStructMember(memberName) + videoProfileStructMember = videoProfileStruct.members[memberName] + + for xmlVideoProfile in xmlVideoProfileMember.findall("./videoprofile"): + videoProfileStructMember.values[xmlVideoProfile.get('value')] = xmlVideoProfile.get('name') + + for xmlVideoCapabilities in xmlVideoCodec.findall("./videocapabilities"): + capabilityStructName = xmlVideoCapabilities.get('struct') + videoCodec.capabilities[capabilityStructName] = capabilityStructName + + for xmlVideoFormat in xmlVideoCodec.findall("./videoformat"): + videoFormatName = xmlVideoFormat.get('name') + videoFormatExtend = xmlVideoFormat.get('extend') + if videoFormatName is not None: + # This is a new video format category + videoFormatUsage = xmlVideoFormat.get('usage') + videoCodec.formats[videoFormatName] = VulkanVideoFormat(videoFormatName, videoFormatUsage) + videoFormat = videoCodec.formats[videoFormatName] + elif videoFormatExtend is not None: + # This is an extension to an already defined video format category + if videoFormatExtend in videoCodec.formats: + videoFormat = videoCodec.formats[videoFormatExtend] + else: + assert False, f"Video format category '{videoFormatExtend}' not found but it is attempted to be extended" + else: + assert False, "'name' or 'extend' is attribute is required for 'videoformat' element" + + for xmlVideoFormatProperties in xmlVideoFormat.findall("./videoformatproperties"): + propertiesStructName = xmlVideoFormatProperties.get('struct') + videoFormat.properties[propertiesStructName] = propertiesStructName + + for xmlVideoFormatRequiredCap in xmlVideoFormat.findall("./videorequirecapabilities"): + requiredCapStruct = xmlVideoFormatRequiredCap.get('struct') + requiredCapMember = xmlVideoFormatRequiredCap.get('member') + requiredCapValue = xmlVideoFormatRequiredCap.get('value') + videoFormat.requiredCaps.append(VulkanVideoRequiredCapabilities(requiredCapStruct, requiredCapMember, requiredCapValue)) + + # Collect flag types in a set because we will need to look this up + flagTypes = set() + for flagType in self.flags: + flagTypes.add(flagType.name) + + # Utility to get structure definition from structure name + def GetStructDef(name): + for s in self.all_structures: + if s.name == name: + return s + assert False, f"Definition for structure '{name}' is missing" + + # Utility to get the extension / version precondition of a list of type names + def GetTypesPrecondition(typelist, indent): + indent = ' ' * indent + out = '' + extEnables = {} + for typename in typelist: + for k, elem in self.extTypes.items(): + if k == typename or (typename in self.aliases.keys() and k in self.aliases[typename]): + for e in elem: + extEnables[e.extNameStr] = e.type + + version = None + for typename in typelist: + for v in self.vulkan_versions: + if typename in v.names: + if version is not None and (v.major > version.major or (v.major == version.major and v.minor > version.minor)): + version = v + + has_version = version is not None + has_extNameStr = len(extEnables) > 0 or typename in self.aliases.keys() + if has_version or has_extNameStr: + out += f'{indent}if (' + has_printed_condition = False + if has_extNameStr: + for key, value in extEnables.items(): + if has_printed_condition: + out += f'\n{indent} || ' + else: + has_printed_condition = True + if has_version: + out += '(' + if value == EXTENSION_TYPE_DEVICE: + out += f'gpu.CheckPhysicalDeviceExtensionIncluded({key})' + else: + assert False, 'Should never get here' + if has_version: + if has_printed_condition: + out += f'\n{indent} || (gpu.api_version >= {version.constant})' + else: + out += f'gpu.api_version >= {version.constant}' + out += ') {\n' + else: + out = f'{indent}{{\n' + return out + + # Utility to construct a capability prerequisite condition evaluation expression + def GetRequiredCapsCondition(structName, memberName, memberRef, value): + condition = '' + requiredCapStructDef = GetStructDef(structName) + for member in requiredCapStructDef.members: + if member.name == memberName: + if member.typeID in flagTypes: + # Check that the flags contain all the required values + def genExpressionFromValue(value): + return value if value == "" else f"({memberRef} & {value}) != 0" + + for char in condition: + if char in ['(', ')', '+', ',']: + condition += genExpressionFromValue(value) + value = "" + if char == '+': + # '+' means AND + condition += ' && ' + elif char == ',': + # ',' means OR + condition += ' || ' + else: + condition += char + else: + value += char + condition += genExpressionFromValue(value) + else: + condition = f'{memberRef} == {value}' + if condition == '': + return 'true' + else: + return f'({condition})' + + # Generate video format properties comparator + out += ''' +bool is_video_format_same(const VkVideoFormatPropertiesKHR &format_a, const VkVideoFormatPropertiesKHR &format_b) { + auto a = reinterpret_cast(&format_a); + auto b = reinterpret_cast(&format_b); + bool same = true; + while (same && a != nullptr && b != nullptr) { + if (a->sType != b->sType) { + // Structure type mismatch (extension structures are expected to be chained in the same order) + same = false; + } else { + switch (a->sType) {''' + + if 'VkVideoFormatPropertiesKHR' in self.registry.validextensionstructs: + for extstruct in ['VkVideoFormatPropertiesKHR'] + self.registry.validextensionstructs['VkVideoFormatPropertiesKHR']: + extstructDef = GetStructDef(extstruct) + out += f''' + case {extstructDef.sTypeName}: + same = same && memcmp(reinterpret_cast(a) + sizeof(VkBaseInStructure), + reinterpret_cast(b) + sizeof(VkBaseInStructure), + sizeof({extstruct}) - sizeof(VkBaseInStructure)) == 0; + break;''' + + out += ''' + default: + // Unexpected structure type + same = false; + break; + } + } + a = a->pNext; + b = b->pNext; + } + return same; +} +''' + + # Generate video profile info capture utilities + out += ''' +std::vector> enumerate_supported_video_profiles(AppGpu &gpu) { + std::vector> result{}; + + struct ChromaSubsamplingInfo { + VkVideoChromaSubsamplingFlagsKHR value; + const char* name; + }; + const std::vector chroma_subsampling_list = { + {VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR, "4:2:0"}, + {VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR, "4:2:2"}, + {VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR, "4:4:4"}, + {VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR, "monochrome"} + }; + + struct BitDepthInfo { + VkVideoComponentBitDepthFlagsKHR value; + const char* name; + }; + const std::vector bit_depth_list = { + {VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR, "8"}, + {VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR, "10"}, + {VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR, "12"} + }; + + auto find_caps_struct = [](const VkVideoCapabilitiesKHR &capabilities, VkStructureType stype) -> const VkBaseInStructure* { + auto p = reinterpret_cast(&capabilities); + while (p != nullptr) { + if (p->sType == stype) { + return p; + } + p = p->pNext; + } + return nullptr; + }; + + auto base_format = [] + (const ChromaSubsamplingInfo &chroma_subsampling, const BitDepthInfo &luma_bit_depth, const BitDepthInfo &chroma_bit_depth) { + std::string result{}; + result += " ("; + result += chroma_subsampling.name; + result += " "; + result += luma_bit_depth.name; + if (luma_bit_depth.value != chroma_bit_depth.value) { + result += ":"; + result += chroma_bit_depth.name; + } + result += "-bit)"; + return result; + }; + + auto add_profile = [&]( + const std::string &name, + const VkVideoProfileInfoKHR &profile_info, + AppVideoProfile::CreateProfileInfoChainCb create_profile_info_chain, + AppVideoProfile::CreateCapabilitiesChainCb create_capabilities_chain, + const AppVideoProfile::CreateFormatPropertiesChainCbList &create_format_properties_chain_list, + AppVideoProfile::InitProfileCb init_profile) { + auto profile = std::make_unique(gpu, gpu.phys_device, + name, profile_info, + create_profile_info_chain, + create_capabilities_chain, + create_format_properties_chain_list, + init_profile); + if (profile->supported) { + result.push_back(std::move(profile)); + } + }; +''' + + # Generate individual video profiles from the video codec metadata + for videoCodec in videoCodecs.values(): + # Ignore video codec categories + if videoCodec.value is None: + continue + + out += '\n' + out += GetTypesPrecondition(videoCodec.profileStructs, 4) + out += f'{" " * 8}const std::string codec_name = "{videoCodec.name}";\n' + + out += ''' + for (auto chroma_subsampling : chroma_subsampling_list) { + for (auto luma_bit_depth : bit_depth_list) { + for (auto chroma_bit_depth : bit_depth_list) { + if (chroma_subsampling.value == VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR && luma_bit_depth.value != chroma_bit_depth.value) { + // Ignore the chroma bit depth dimension for monochrome + continue; + } + + std::string profile_base_name = codec_name + base_format(chroma_subsampling, luma_bit_depth, chroma_bit_depth); +''' + + # Setup video profile info + out += f'{" " * 20}VkVideoProfileInfoKHR profile_info{{\n' + out += f'{" " * 20} VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR,\n' + out += f'{" " * 20} nullptr,\n' + out += f'{" " * 20} {videoCodec.value},\n' + out += f'{" " * 20} chroma_subsampling.value,\n' + out += f'{" " * 20} luma_bit_depth.value,\n' + out += f'{" " * 20} chroma_bit_depth.value\n' + out += f'{" " * 20}}};\n\n' + + # Setup video profile info chain creation callback + out += f'{" " * 20}auto create_profile_info_chain = [&](const void **ppnext) -> std::unique_ptr {{\n' + out += f'{" " * 20} auto profile_info_chain = std::make_unique();\n' + for profileStruct in videoCodec.profileStructs: + structDef = GetStructDef(profileStruct) + out += AddGuardHeader(structDef) + out += f'{" " * 24}if (profile_info_chain != nullptr) {{\n' + out += f'{" " * 28}profile_info_chain->{profileStruct[2:]}.sType = {structDef.sTypeName};\n' + out += f'{" " * 28}profile_info_chain->{profileStruct[2:]}.pNext = nullptr;\n' + out += f'{" " * 28}*ppnext = &profile_info_chain->{profileStruct[2:]};\n' + out += f'{" " * 28}ppnext = &profile_info_chain->{profileStruct[2:]}.pNext;\n' + out += f'{" " * 24}}}\n' + if structDef.guard: + out += f'#else\n{" " * 20}profile_info_chain = nullptr;\n' + out += AddGuardFooter(structDef) + out += f'{" " * 20} return profile_info_chain;\n' + out += f'{" " * 20}}};\n\n' + + # Setup video capabilities chain creation callback + out += f'{" " * 20}auto create_capabilities_chain = [&](void **ppnext) -> std::unique_ptr {{\n' + out += f'{" " * 20} auto capabilities_chain = std::make_unique();\n' + for capabilities in videoCodec.capabilities: + structDef = GetStructDef(capabilities) + out += AddGuardHeader(structDef) + out += f'{" " * 24}if (capabilities_chain != nullptr) {{\n' + out += GetTypesPrecondition([capabilities], 28) + out += f'{" " * 32}capabilities_chain->{capabilities[2:]}.sType = {structDef.sTypeName};\n' + out += f'{" " * 32}capabilities_chain->{capabilities[2:]}.pNext = nullptr;\n' + out += f'{" " * 32}*ppnext = &capabilities_chain->{capabilities[2:]};\n' + out += f'{" " * 32}ppnext = &capabilities_chain->{capabilities[2:]}.pNext;\n' + out += f'{" " * 28}}}\n' + out += f'{" " * 24}}}\n' + out += AddGuardFooter(structDef) + out += f'{" " * 20} return capabilities_chain;\n' + out += f'{" " * 20}}};\n\n' + + # Setup video format properties chain creation callbacks + out += f'{" " * 20}const AppVideoProfile::CreateFormatPropertiesChainCbList create_format_properties_chain_list = {{\n' + for format in videoCodec.formats.values(): + out += f'{" " * 24}AppVideoProfile::CreateFormatPropertiesChainCb {{\n' + out += f'{" " * 28}"{format.name}",\n' + out += f'{" " * 28}{format.usage.replace("+", " | ")},\n' + + # Callback to check required capabilities + out += f'{" " * 28}[&](const VkVideoCapabilitiesKHR &capabilities) -> bool {{\n' + out += f'{" " * 28} bool supported = true;\n' + for requiredCap in format.requiredCaps: + structDef = GetStructDef(requiredCap.struct) + out += AddGuardHeader(structDef) + out += GetTypesPrecondition([requiredCap.struct], 32) + out += f'{" " * 32} auto caps = reinterpret_cast(find_caps_struct(capabilities, {structDef.sTypeName}));\n' + out += f'{" " * 32} if (caps != nullptr) {{\n' + out += f'{" " * 32} supported = supported && {GetRequiredCapsCondition(requiredCap.struct, requiredCap.member, f"caps->{requiredCap.member}", requiredCap.value)};\n' + out += f'{" " * 32} }} else {{\n' + out += f'{" " * 32} supported = false;\n' + out += f'{" " * 32} }}\n' + out += f'{" " * 32}}} else {{\n' + out += f'{" " * 32} supported = false;\n' + out += f'{" " * 32}}}\n' + if structDef.guard: + out += f'#else\n{" " * 32}supported = false;\n' + out += AddGuardFooter(structDef) + out += f'{" " * 28} return supported;\n' + out += f'{" " * 28}}},\n' + + # Callback to create video format properties chain + out += f'{" " * 28}[&](void **ppnext) -> std::unique_ptr {{\n' + out += f'{" " * 28} auto format_properties_chain = std::make_unique();\n' + for formatProps in format.properties: + structDef = GetStructDef(formatProps) + out += AddGuardHeader(structDef) + out += f'{" " * 32}if (format_properties_chain != nullptr) {{\n' + out += GetTypesPrecondition([formatProps], 36) + out += f'{" " * 40}format_properties_chain->{formatProps[2:]}.sType = {structDef.sTypeName};\n' + out += f'{" " * 40}format_properties_chain->{formatProps[2:]}.pNext = nullptr;\n' + out += f'{" " * 40}*ppnext = &format_properties_chain->{formatProps[2:]};\n' + out += f'{" " * 40}ppnext = &format_properties_chain->{formatProps[2:]}.pNext;\n' + out += f'{" " * 36}}}\n' + out += f'{" " * 32}}}\n' + out += AddGuardFooter(structDef) + out += f'{" " * 28} return format_properties_chain;\n' + out += f'{" " * 28}}},\n' + + out += f'{" " * 24}}},\n' + out += f'{" " * 20}}};\n\n' + + # Permute profiles for each profile struct member value + profiles = {'': []} + for profileStruct in videoCodec.profileStructs.values(): + for profileStructMember in profileStruct.members.values(): + newProfiles = {} + for profileStructMemberValue, profileStructMemberName in profileStructMember.values.items(): + for profileName, profile in profiles.items(): + newProfileName = f'{profileName} {profileStructMemberName}' + newProfiles[newProfileName] = profile + [{ + "struct": profileStruct.struct, + "member": profileStructMember.name, + "value": profileStructMemberValue + }] + profiles = newProfiles + + for profileName, profile in profiles.items(): + out += f'{" " * 20}add_profile(profile_base_name + "{profileName}", profile_info,\n' + out += f'{" " * 20} create_profile_info_chain, create_capabilities_chain,\n' + out += f'{" " * 20} create_format_properties_chain_list,\n' + out += f'{" " * 20} [](AppVideoProfile& profile) {{\n' + for profileStruct in videoCodec.profileStructs: + structDef = GetStructDef(profileStruct) + out += AddGuardHeader(structDef) + for elem in profile: + if elem['struct'] == profileStruct: + out += f'{" " * 24}profile.profile_info_chain->{elem["struct"][2:]}.{elem["member"]} = {elem["value"]};\n' + out += AddGuardFooter(structDef) + out += f'{" " * 20}}});\n' + + out += f'{" " * 16}}}\n' + out += f'{" " * 12}}}\n' + out += f'{" " * 8}}}\n' + out += f'{" " * 4}}}\n' + + out += ' return result;\n' + out += '}\n\n' + + return out + def genCmd(self, cmd, name, alias): gen.OutputGenerator.genCmd(self, cmd, name, alias) @@ -419,6 +888,8 @@ def findFormatRanges(self): if comment is not None and comment.find('Promoted from') >= 0: # may need tweaking in the future - some ext names aren't just the upper case version original_ext = comment.split(' ')[2].upper() + '_EXTENSION_NAME' + # insert an underscore before numbers in the name define + original_ext = re.sub(r'([A-Z])(\d+)', r'\1_\2', original_ext) min_val = 2**32 max_val = 0 for enum in require.findall('enum'): @@ -536,9 +1007,11 @@ def PrintGetFlagStrings(name, bitmask): # Otherwise, use "None" for when there are not bits set in the bitmask if bitmask.options[0].value != 0: out += ' if (value == 0) { strings.push_back("None"); return strings; }\n' + else: + out += f' if (value == 0) {{ strings.push_back("{bitmask.options[0].name[3:]}"); return strings; }}\n' for v in bitmask.options: # only check single-bit flags - if (v.value & (v.value - 1)) == 0: + if v.value != 0 and (v.value & (v.value - 1)) == 0: out += f' if ({v.name} & value) strings.push_back("{v.name[3:]}");\n' out += ' return strings;\n}\n' return out @@ -647,13 +1120,13 @@ def PrintStructure(struct): out += f' p.PrintKeyValue("{v.name}", obj.{v.name});\n' if v.arrayLength == '8': out += ' }\n' - elif struct.name == 'VkQueueFamilyGlobalPriorityPropertiesKHR' and v.name == 'priorities': + elif struct.name == 'VkQueueFamilyGlobalPriorityProperties' and v.name == 'priorities': out += f' ArrayWrapper arr(p,"{v.name}", obj.priorityCount);\n' out += ' for (uint32_t i = 0; i < obj.priorityCount; i++) {\n' out += ' if (p.Type() == OutputType::json)\n' - out += ' p.PrintString(std::string("VK_") + VkQueueGlobalPriorityKHRString(obj.priorities[i]));\n' + out += ' p.PrintString(std::string("VK_") + VkQueueGlobalPriorityString(obj.priorities[i]));\n' out += ' else\n' - out += ' p.PrintString(VkQueueGlobalPriorityKHRString(obj.priorities[i]));\n' + out += ' p.PrintString(VkQueueGlobalPriorityString(obj.priorities[i]));\n' out += ' }\n' elif v.arrayLength.isdigit(): out += f' {{\n ArrayWrapper arr(p,"{v.name}", ' + v.arrayLength + ');\n' @@ -855,9 +1328,9 @@ def PrintChainStruct(listName, structures, all_structures, chain_details, extTyp out += 'AppGpu &gpu, ' if chain_details.get('can_show_promoted_structs'): out += 'bool show_promoted_structs, ' - out += 'void * place) {\n' + out += 'const void * place) {\n' out += ' while (place) {\n' - out += ' struct VkBaseOutStructure *structure = (struct VkBaseOutStructure *)place;\n' + out += ' const VkBaseOutStructure *structure = (const VkBaseOutStructure *)place;\n' out += ' p.SetSubHeader();\n' for s in sorted_structures: @@ -887,7 +1360,7 @@ def PrintChainStruct(listName, structures, all_structures, chain_details, extTyp has_version = version is not None has_extNameStr = len(extEnables) > 0 or s.name in aliases.keys() out += ') {\n' - out += f' {s.name}* props = ({s.name}*)structure;\n' + out += f' const {s.name}* props = (const {s.name}*)structure;\n' out += f' Dump{s.name}(p, ' if s.name in aliases.keys() and version is not None: out += f'{version_desc} >= {version.constant} ?"{s.name}":"{oldVersionName}"' @@ -901,19 +1374,10 @@ def PrintChainStruct(listName, structures, all_structures, chain_details, extTyp out += ' }\n' out += '}\n' - should_print_twocall_func = False - for s in structs_to_print: - if not s.hasLengthmember: - continue - if s.name in STRUCT_BLACKLIST: - continue - should_print_twocall_func = True - - if not should_print_twocall_func: - return out - out += '\n' - out += f'void prepare_{listName}_twocall_chain_vectors(std::unique_ptr<{listName}_chain>& chain) {{\n' + out += f'bool prepare_{listName}_twocall_chain_vectors(std::unique_ptr<{listName}_chain>& chain) {{\n' + out += ' (void)chain;\n' + is_twocall = False for s in structs_to_print: if not s.hasLengthmember: continue @@ -925,6 +1389,8 @@ def PrintChainStruct(listName, structures, all_structures, chain_details, extTyp out += f' chain->{s.name}_{member.name}.resize(chain->{s.name[2:]}.{member.arrayLength});\n' out += f' chain->{s.name[2:]}.{member.name} = chain->{s.name}_{member.name}.data();\n' out += AddGuardFooter(s) + is_twocall = True + out += f' return {"true" if is_twocall else "false"};\n' out += '}\n' return out @@ -1191,6 +1657,10 @@ def __init__(self, rootNode): self.constant = self.name.replace('_VERSION_', '_API_VERSION_') self.names = set() + match = re.search(r"^[A-Z]+_VERSION_([1-9][0-9]*)_([0-9]+)$", self.name) + self.major = int(match.group(1)) + self.minor = int(match.group(2)) + for req in rootNode.findall('require'): for ty in req.findall('type'): self.names.add(ty.get('name')) @@ -1206,3 +1676,39 @@ def __init__(self, min_inst_version, ext_name, first, last): self.extension_name = ext_name self.first_format = first self.last_format = last + +class VulkanVideoRequiredCapabilities(): + def __init__(self, struct, member, value): + self.struct = struct + self.member = member + self.value = value + +class VulkanVideoFormat(): + def __init__(self, name, usage): + self.name = name + self.usage = usage + self.properties = OrderedDict() + self.requiredCaps = list() + super().__init__() + +class VulkanVideoProfileStructMember(): + def __init__(self, name): + self.name = name + self.values = OrderedDict() + +class VulkanVideoProfileStruct(): + def __init__(self, struct): + self.struct = struct + self.members = OrderedDict() + +class VulkanVideoCodec(): + def __init__(self, name, extend = None, value = None): + self.name = name + self.value = value + self.profileStructs = OrderedDict() + self.capabilities = OrderedDict() + self.formats = OrderedDict() + if extend is not None: + self.profileStructs = copy.deepcopy(extend.profileStructs) + self.capabilities = copy.deepcopy(extend.capabilities) + self.formats = copy.deepcopy(extend.formats) diff --git a/vulkaninfo/BUILD.gn b/vulkaninfo/BUILD.gn new file mode 100644 index 000000000..5bc2d03bf --- /dev/null +++ b/vulkaninfo/BUILD.gn @@ -0,0 +1,79 @@ +# Copyright (C) 2025 The Fuchsia Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/vulkan_tools.gni") +if (is_fuchsia) { + import("//build/components.gni") + import("//src/lib/vulkan/vulkan.gni") +} + +config("vulkaninfo_warnings") { + cflags = [ + "-Wno-conversion", + "-Wno-implicit-fallthrough", + "-Wno-missing-field-initializers", + "-Wno-extra-semi", + "-Wno-ambiguous-reversed-operator", + ] +} + +executable("vulkaninfo") { + sources = [ "vulkaninfo.cpp" ] + + include_dirs = [ + ".", + "generated", + ] + + deps = [ "$vulkan_headers_dir:vulkan_headers" ] + if (is_fuchsia) { + deps += [ "//third_party/Vulkan-Loader:libvulkan" ] + } + + configs += [ + ":vulkaninfo_warnings", + "${volk_dir}:volk_config", + ] + if (is_fuchsia) { + configs -= [ "//build/config:no_exceptions" ] + } + + defines = [ + "VK_ENABLE_BETA_EXTENSIONS", + "VK_NO_PROTOTYPES", + ] +} + +if (is_fuchsia) { + fuchsia_test_component("vulkaninfo-component") { + manifest = "fuchsia/meta/vulkaninfo.cml" + component_name = "vulkaninfo" + + deps = [ + ":vulkaninfo", + "//src/lib/vulkan/swapchain:image_pipe_swapchain_fb_layer", + "//src/lib/vulkan/validation_layers", + ] + test_type = "vulkan" + } + + fuchsia_test_package("vulkaninfo-package") { + package_name = "vulkaninfo" + test_components = [ ":vulkaninfo-component" ] + + test_specs = { + environments = vulkan_envs + } + } +} diff --git a/vulkaninfo/fuchsia/meta/vulkaninfo.cml b/vulkaninfo/fuchsia/meta/vulkaninfo.cml new file mode 100644 index 000000000..c79081722 --- /dev/null +++ b/vulkaninfo/fuchsia/meta/vulkaninfo.cml @@ -0,0 +1,23 @@ +// Copyright (C) 2025 The Fuchsia Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +{ + include: [ + "sys/testing/elf_test_runner.shard.cml", + "syslog/client.shard.cml", + "vulkan/client.shard.cml", + ], + program: { + binary: "bin/vulkaninfo", + }, +} diff --git a/vulkaninfo/generated/vulkaninfo.hpp b/vulkaninfo/generated/vulkaninfo.hpp index 9639dcad4..ec43a1724 100644 --- a/vulkaninfo/generated/vulkaninfo.hpp +++ b/vulkaninfo/generated/vulkaninfo.hpp @@ -3,7 +3,7 @@ * Copyright (c) 2019-2022 The Khronos Group Inc. * Copyright (c) 2019-2022 Valve Corporation * Copyright (c) 2019-2022 LunarG, Inc. - * Copyright (c) 2023-2023 RasterGrid Kft. + * Copyright (c) 2023-2024 RasterGrid Kft. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,6 +45,517 @@ std::string to_hex_str(Printer &p, const T i) { return to_hex_str(i); } +std::string StdVideoH264ChromaFormatIdcString(StdVideoH264ChromaFormatIdc value) { + switch (value) { + case STD_VIDEO_H264_CHROMA_FORMAT_IDC_MONOCHROME: return "STD_VIDEO_H264_CHROMA_FORMAT_IDC_MONOCHROME"; + case STD_VIDEO_H264_CHROMA_FORMAT_IDC_420: return "STD_VIDEO_H264_CHROMA_FORMAT_IDC_420"; + case STD_VIDEO_H264_CHROMA_FORMAT_IDC_422: return "STD_VIDEO_H264_CHROMA_FORMAT_IDC_422"; + case STD_VIDEO_H264_CHROMA_FORMAT_IDC_444: return "STD_VIDEO_H264_CHROMA_FORMAT_IDC_444"; + case STD_VIDEO_H264_CHROMA_FORMAT_IDC_INVALID: return "STD_VIDEO_H264_CHROMA_FORMAT_IDC_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264ChromaFormatIdc_value") + std::to_string(value); + } +} +void DumpStdVideoH264ChromaFormatIdc(Printer &p, std::string name, StdVideoH264ChromaFormatIdc value) { + p.PrintKeyString(name, StdVideoH264ChromaFormatIdcString(value)); +} +std::string StdVideoH264ProfileIdcString(StdVideoH264ProfileIdc value) { + switch (value) { + case STD_VIDEO_H264_PROFILE_IDC_BASELINE: return "STD_VIDEO_H264_PROFILE_IDC_BASELINE"; + case STD_VIDEO_H264_PROFILE_IDC_MAIN: return "STD_VIDEO_H264_PROFILE_IDC_MAIN"; + case STD_VIDEO_H264_PROFILE_IDC_HIGH: return "STD_VIDEO_H264_PROFILE_IDC_HIGH"; + case STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE: return "STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE"; + case STD_VIDEO_H264_PROFILE_IDC_INVALID: return "STD_VIDEO_H264_PROFILE_IDC_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264ProfileIdc_value") + std::to_string(value); + } +} +void DumpStdVideoH264ProfileIdc(Printer &p, std::string name, StdVideoH264ProfileIdc value) { + p.PrintKeyString(name, StdVideoH264ProfileIdcString(value)); +} +std::string StdVideoH264LevelIdcString(StdVideoH264LevelIdc value) { + switch (value) { + case STD_VIDEO_H264_LEVEL_IDC_1_0: return "STD_VIDEO_H264_LEVEL_IDC_1_0"; + case STD_VIDEO_H264_LEVEL_IDC_1_1: return "STD_VIDEO_H264_LEVEL_IDC_1_1"; + case STD_VIDEO_H264_LEVEL_IDC_1_2: return "STD_VIDEO_H264_LEVEL_IDC_1_2"; + case STD_VIDEO_H264_LEVEL_IDC_1_3: return "STD_VIDEO_H264_LEVEL_IDC_1_3"; + case STD_VIDEO_H264_LEVEL_IDC_2_0: return "STD_VIDEO_H264_LEVEL_IDC_2_0"; + case STD_VIDEO_H264_LEVEL_IDC_2_1: return "STD_VIDEO_H264_LEVEL_IDC_2_1"; + case STD_VIDEO_H264_LEVEL_IDC_2_2: return "STD_VIDEO_H264_LEVEL_IDC_2_2"; + case STD_VIDEO_H264_LEVEL_IDC_3_0: return "STD_VIDEO_H264_LEVEL_IDC_3_0"; + case STD_VIDEO_H264_LEVEL_IDC_3_1: return "STD_VIDEO_H264_LEVEL_IDC_3_1"; + case STD_VIDEO_H264_LEVEL_IDC_3_2: return "STD_VIDEO_H264_LEVEL_IDC_3_2"; + case STD_VIDEO_H264_LEVEL_IDC_4_0: return "STD_VIDEO_H264_LEVEL_IDC_4_0"; + case STD_VIDEO_H264_LEVEL_IDC_4_1: return "STD_VIDEO_H264_LEVEL_IDC_4_1"; + case STD_VIDEO_H264_LEVEL_IDC_4_2: return "STD_VIDEO_H264_LEVEL_IDC_4_2"; + case STD_VIDEO_H264_LEVEL_IDC_5_0: return "STD_VIDEO_H264_LEVEL_IDC_5_0"; + case STD_VIDEO_H264_LEVEL_IDC_5_1: return "STD_VIDEO_H264_LEVEL_IDC_5_1"; + case STD_VIDEO_H264_LEVEL_IDC_5_2: return "STD_VIDEO_H264_LEVEL_IDC_5_2"; + case STD_VIDEO_H264_LEVEL_IDC_6_0: return "STD_VIDEO_H264_LEVEL_IDC_6_0"; + case STD_VIDEO_H264_LEVEL_IDC_6_1: return "STD_VIDEO_H264_LEVEL_IDC_6_1"; + case STD_VIDEO_H264_LEVEL_IDC_6_2: return "STD_VIDEO_H264_LEVEL_IDC_6_2"; + case STD_VIDEO_H264_LEVEL_IDC_INVALID: return "STD_VIDEO_H264_LEVEL_IDC_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264LevelIdc_value") + std::to_string(value); + } +} +void DumpStdVideoH264LevelIdc(Printer &p, std::string name, StdVideoH264LevelIdc value) { + p.PrintKeyString(name, StdVideoH264LevelIdcString(value)); +} +std::string StdVideoH264PocTypeString(StdVideoH264PocType value) { + switch (value) { + case STD_VIDEO_H264_POC_TYPE_0: return "STD_VIDEO_H264_POC_TYPE_0"; + case STD_VIDEO_H264_POC_TYPE_1: return "STD_VIDEO_H264_POC_TYPE_1"; + case STD_VIDEO_H264_POC_TYPE_2: return "STD_VIDEO_H264_POC_TYPE_2"; + case STD_VIDEO_H264_POC_TYPE_INVALID: return "STD_VIDEO_H264_POC_TYPE_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264PocType_value") + std::to_string(value); + } +} +void DumpStdVideoH264PocType(Printer &p, std::string name, StdVideoH264PocType value) { + p.PrintKeyString(name, StdVideoH264PocTypeString(value)); +} +std::string StdVideoH264AspectRatioIdcString(StdVideoH264AspectRatioIdc value) { + switch (value) { + case STD_VIDEO_H264_ASPECT_RATIO_IDC_UNSPECIFIED: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_UNSPECIFIED"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_SQUARE: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_SQUARE"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_12_11: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_12_11"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_10_11: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_10_11"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_16_11: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_16_11"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_40_33: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_40_33"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_24_11: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_24_11"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_20_11: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_20_11"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_32_11: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_32_11"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_80_33: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_80_33"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_18_11: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_18_11"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_15_11: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_15_11"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_64_33: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_64_33"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_160_99: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_160_99"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_4_3: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_4_3"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_3_2: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_3_2"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_2_1: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_2_1"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_EXTENDED_SAR: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_EXTENDED_SAR"; + case STD_VIDEO_H264_ASPECT_RATIO_IDC_INVALID: return "STD_VIDEO_H264_ASPECT_RATIO_IDC_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264AspectRatioIdc_value") + std::to_string(value); + } +} +void DumpStdVideoH264AspectRatioIdc(Printer &p, std::string name, StdVideoH264AspectRatioIdc value) { + p.PrintKeyString(name, StdVideoH264AspectRatioIdcString(value)); +} +std::string StdVideoH264WeightedBipredIdcString(StdVideoH264WeightedBipredIdc value) { + switch (value) { + case STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_DEFAULT: return "STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_DEFAULT"; + case STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_EXPLICIT: return "STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_EXPLICIT"; + case STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_IMPLICIT: return "STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_IMPLICIT"; + case STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_INVALID: return "STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264WeightedBipredIdc_value") + std::to_string(value); + } +} +void DumpStdVideoH264WeightedBipredIdc(Printer &p, std::string name, StdVideoH264WeightedBipredIdc value) { + p.PrintKeyString(name, StdVideoH264WeightedBipredIdcString(value)); +} +std::string StdVideoH264ModificationOfPicNumsIdcString(StdVideoH264ModificationOfPicNumsIdc value) { + switch (value) { + case STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_SUBTRACT: return "STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_SUBTRACT"; + case STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_ADD: return "STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_ADD"; + case STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_LONG_TERM: return "STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_LONG_TERM"; + case STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_END: return "STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_END"; + case STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_INVALID: return "STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264ModificationOfPicNumsIdc_value") + std::to_string(value); + } +} +void DumpStdVideoH264ModificationOfPicNumsIdc(Printer &p, std::string name, StdVideoH264ModificationOfPicNumsIdc value) { + p.PrintKeyString(name, StdVideoH264ModificationOfPicNumsIdcString(value)); +} +std::string StdVideoH264MemMgmtControlOpString(StdVideoH264MemMgmtControlOp value) { + switch (value) { + case STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_END: return "STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_END"; + case STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_SHORT_TERM: return "STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_SHORT_TERM"; + case STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_LONG_TERM: return "STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_LONG_TERM"; + case STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_LONG_TERM: return "STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_LONG_TERM"; + case STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_SET_MAX_LONG_TERM_INDEX: return "STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_SET_MAX_LONG_TERM_INDEX"; + case STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_ALL: return "STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_ALL"; + case STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_CURRENT_AS_LONG_TERM: return "STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_CURRENT_AS_LONG_TERM"; + case STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_INVALID: return "STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264MemMgmtControlOp_value") + std::to_string(value); + } +} +void DumpStdVideoH264MemMgmtControlOp(Printer &p, std::string name, StdVideoH264MemMgmtControlOp value) { + p.PrintKeyString(name, StdVideoH264MemMgmtControlOpString(value)); +} +std::string StdVideoH264CabacInitIdcString(StdVideoH264CabacInitIdc value) { + switch (value) { + case STD_VIDEO_H264_CABAC_INIT_IDC_0: return "STD_VIDEO_H264_CABAC_INIT_IDC_0"; + case STD_VIDEO_H264_CABAC_INIT_IDC_1: return "STD_VIDEO_H264_CABAC_INIT_IDC_1"; + case STD_VIDEO_H264_CABAC_INIT_IDC_2: return "STD_VIDEO_H264_CABAC_INIT_IDC_2"; + case STD_VIDEO_H264_CABAC_INIT_IDC_INVALID: return "STD_VIDEO_H264_CABAC_INIT_IDC_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264CabacInitIdc_value") + std::to_string(value); + } +} +void DumpStdVideoH264CabacInitIdc(Printer &p, std::string name, StdVideoH264CabacInitIdc value) { + p.PrintKeyString(name, StdVideoH264CabacInitIdcString(value)); +} +std::string StdVideoH264DisableDeblockingFilterIdcString(StdVideoH264DisableDeblockingFilterIdc value) { + switch (value) { + case STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_DISABLED: return "STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_DISABLED"; + case STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_ENABLED: return "STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_ENABLED"; + case STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_PARTIAL: return "STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_PARTIAL"; + case STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_INVALID: return "STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264DisableDeblockingFilterIdc_value") + std::to_string(value); + } +} +void DumpStdVideoH264DisableDeblockingFilterIdc(Printer &p, std::string name, StdVideoH264DisableDeblockingFilterIdc value) { + p.PrintKeyString(name, StdVideoH264DisableDeblockingFilterIdcString(value)); +} +std::string StdVideoH264SliceTypeString(StdVideoH264SliceType value) { + switch (value) { + case STD_VIDEO_H264_SLICE_TYPE_P: return "STD_VIDEO_H264_SLICE_TYPE_P"; + case STD_VIDEO_H264_SLICE_TYPE_B: return "STD_VIDEO_H264_SLICE_TYPE_B"; + case STD_VIDEO_H264_SLICE_TYPE_I: return "STD_VIDEO_H264_SLICE_TYPE_I"; + case STD_VIDEO_H264_SLICE_TYPE_INVALID: return "STD_VIDEO_H264_SLICE_TYPE_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264SliceType_value") + std::to_string(value); + } +} +void DumpStdVideoH264SliceType(Printer &p, std::string name, StdVideoH264SliceType value) { + p.PrintKeyString(name, StdVideoH264SliceTypeString(value)); +} +std::string StdVideoH264PictureTypeString(StdVideoH264PictureType value) { + switch (value) { + case STD_VIDEO_H264_PICTURE_TYPE_P: return "STD_VIDEO_H264_PICTURE_TYPE_P"; + case STD_VIDEO_H264_PICTURE_TYPE_B: return "STD_VIDEO_H264_PICTURE_TYPE_B"; + case STD_VIDEO_H264_PICTURE_TYPE_I: return "STD_VIDEO_H264_PICTURE_TYPE_I"; + case STD_VIDEO_H264_PICTURE_TYPE_IDR: return "STD_VIDEO_H264_PICTURE_TYPE_IDR"; + case STD_VIDEO_H264_PICTURE_TYPE_INVALID: return "STD_VIDEO_H264_PICTURE_TYPE_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264PictureType_value") + std::to_string(value); + } +} +void DumpStdVideoH264PictureType(Printer &p, std::string name, StdVideoH264PictureType value) { + p.PrintKeyString(name, StdVideoH264PictureTypeString(value)); +} +std::string StdVideoH264NonVclNaluTypeString(StdVideoH264NonVclNaluType value) { + switch (value) { + case STD_VIDEO_H264_NON_VCL_NALU_TYPE_SPS: return "STD_VIDEO_H264_NON_VCL_NALU_TYPE_SPS"; + case STD_VIDEO_H264_NON_VCL_NALU_TYPE_PPS: return "STD_VIDEO_H264_NON_VCL_NALU_TYPE_PPS"; + case STD_VIDEO_H264_NON_VCL_NALU_TYPE_AUD: return "STD_VIDEO_H264_NON_VCL_NALU_TYPE_AUD"; + case STD_VIDEO_H264_NON_VCL_NALU_TYPE_PREFIX: return "STD_VIDEO_H264_NON_VCL_NALU_TYPE_PREFIX"; + case STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_SEQUENCE: return "STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_SEQUENCE"; + case STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_STREAM: return "STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_STREAM"; + case STD_VIDEO_H264_NON_VCL_NALU_TYPE_PRECODED: return "STD_VIDEO_H264_NON_VCL_NALU_TYPE_PRECODED"; + case STD_VIDEO_H264_NON_VCL_NALU_TYPE_INVALID: return "STD_VIDEO_H264_NON_VCL_NALU_TYPE_INVALID"; + default: return std::string("UNKNOWN_StdVideoH264NonVclNaluType_value") + std::to_string(value); + } +} +void DumpStdVideoH264NonVclNaluType(Printer &p, std::string name, StdVideoH264NonVclNaluType value) { + p.PrintKeyString(name, StdVideoH264NonVclNaluTypeString(value)); +} +std::string StdVideoDecodeH264FieldOrderCountString(StdVideoDecodeH264FieldOrderCount value) { + switch (value) { + case STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_TOP: return "STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_TOP"; + case STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_BOTTOM: return "STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_BOTTOM"; + case STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_INVALID: return "STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_INVALID"; + default: return std::string("UNKNOWN_StdVideoDecodeH264FieldOrderCount_value") + std::to_string(value); + } +} +void DumpStdVideoDecodeH264FieldOrderCount(Printer &p, std::string name, StdVideoDecodeH264FieldOrderCount value) { + p.PrintKeyString(name, StdVideoDecodeH264FieldOrderCountString(value)); +} +std::string StdVideoH265ChromaFormatIdcString(StdVideoH265ChromaFormatIdc value) { + switch (value) { + case STD_VIDEO_H265_CHROMA_FORMAT_IDC_MONOCHROME: return "STD_VIDEO_H265_CHROMA_FORMAT_IDC_MONOCHROME"; + case STD_VIDEO_H265_CHROMA_FORMAT_IDC_420: return "STD_VIDEO_H265_CHROMA_FORMAT_IDC_420"; + case STD_VIDEO_H265_CHROMA_FORMAT_IDC_422: return "STD_VIDEO_H265_CHROMA_FORMAT_IDC_422"; + case STD_VIDEO_H265_CHROMA_FORMAT_IDC_444: return "STD_VIDEO_H265_CHROMA_FORMAT_IDC_444"; + case STD_VIDEO_H265_CHROMA_FORMAT_IDC_INVALID: return "STD_VIDEO_H265_CHROMA_FORMAT_IDC_INVALID"; + default: return std::string("UNKNOWN_StdVideoH265ChromaFormatIdc_value") + std::to_string(value); + } +} +void DumpStdVideoH265ChromaFormatIdc(Printer &p, std::string name, StdVideoH265ChromaFormatIdc value) { + p.PrintKeyString(name, StdVideoH265ChromaFormatIdcString(value)); +} +std::string StdVideoH265ProfileIdcString(StdVideoH265ProfileIdc value) { + switch (value) { + case STD_VIDEO_H265_PROFILE_IDC_MAIN: return "STD_VIDEO_H265_PROFILE_IDC_MAIN"; + case STD_VIDEO_H265_PROFILE_IDC_MAIN_10: return "STD_VIDEO_H265_PROFILE_IDC_MAIN_10"; + case STD_VIDEO_H265_PROFILE_IDC_MAIN_STILL_PICTURE: return "STD_VIDEO_H265_PROFILE_IDC_MAIN_STILL_PICTURE"; + case STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS: return "STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS"; + case STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS: return "STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS"; + case STD_VIDEO_H265_PROFILE_IDC_INVALID: return "STD_VIDEO_H265_PROFILE_IDC_INVALID"; + default: return std::string("UNKNOWN_StdVideoH265ProfileIdc_value") + std::to_string(value); + } +} +void DumpStdVideoH265ProfileIdc(Printer &p, std::string name, StdVideoH265ProfileIdc value) { + p.PrintKeyString(name, StdVideoH265ProfileIdcString(value)); +} +std::string StdVideoH265LevelIdcString(StdVideoH265LevelIdc value) { + switch (value) { + case STD_VIDEO_H265_LEVEL_IDC_1_0: return "STD_VIDEO_H265_LEVEL_IDC_1_0"; + case STD_VIDEO_H265_LEVEL_IDC_2_0: return "STD_VIDEO_H265_LEVEL_IDC_2_0"; + case STD_VIDEO_H265_LEVEL_IDC_2_1: return "STD_VIDEO_H265_LEVEL_IDC_2_1"; + case STD_VIDEO_H265_LEVEL_IDC_3_0: return "STD_VIDEO_H265_LEVEL_IDC_3_0"; + case STD_VIDEO_H265_LEVEL_IDC_3_1: return "STD_VIDEO_H265_LEVEL_IDC_3_1"; + case STD_VIDEO_H265_LEVEL_IDC_4_0: return "STD_VIDEO_H265_LEVEL_IDC_4_0"; + case STD_VIDEO_H265_LEVEL_IDC_4_1: return "STD_VIDEO_H265_LEVEL_IDC_4_1"; + case STD_VIDEO_H265_LEVEL_IDC_5_0: return "STD_VIDEO_H265_LEVEL_IDC_5_0"; + case STD_VIDEO_H265_LEVEL_IDC_5_1: return "STD_VIDEO_H265_LEVEL_IDC_5_1"; + case STD_VIDEO_H265_LEVEL_IDC_5_2: return "STD_VIDEO_H265_LEVEL_IDC_5_2"; + case STD_VIDEO_H265_LEVEL_IDC_6_0: return "STD_VIDEO_H265_LEVEL_IDC_6_0"; + case STD_VIDEO_H265_LEVEL_IDC_6_1: return "STD_VIDEO_H265_LEVEL_IDC_6_1"; + case STD_VIDEO_H265_LEVEL_IDC_6_2: return "STD_VIDEO_H265_LEVEL_IDC_6_2"; + case STD_VIDEO_H265_LEVEL_IDC_INVALID: return "STD_VIDEO_H265_LEVEL_IDC_INVALID"; + default: return std::string("UNKNOWN_StdVideoH265LevelIdc_value") + std::to_string(value); + } +} +void DumpStdVideoH265LevelIdc(Printer &p, std::string name, StdVideoH265LevelIdc value) { + p.PrintKeyString(name, StdVideoH265LevelIdcString(value)); +} +std::string StdVideoH265SliceTypeString(StdVideoH265SliceType value) { + switch (value) { + case STD_VIDEO_H265_SLICE_TYPE_B: return "STD_VIDEO_H265_SLICE_TYPE_B"; + case STD_VIDEO_H265_SLICE_TYPE_P: return "STD_VIDEO_H265_SLICE_TYPE_P"; + case STD_VIDEO_H265_SLICE_TYPE_I: return "STD_VIDEO_H265_SLICE_TYPE_I"; + case STD_VIDEO_H265_SLICE_TYPE_INVALID: return "STD_VIDEO_H265_SLICE_TYPE_INVALID"; + default: return std::string("UNKNOWN_StdVideoH265SliceType_value") + std::to_string(value); + } +} +void DumpStdVideoH265SliceType(Printer &p, std::string name, StdVideoH265SliceType value) { + p.PrintKeyString(name, StdVideoH265SliceTypeString(value)); +} +std::string StdVideoH265PictureTypeString(StdVideoH265PictureType value) { + switch (value) { + case STD_VIDEO_H265_PICTURE_TYPE_P: return "STD_VIDEO_H265_PICTURE_TYPE_P"; + case STD_VIDEO_H265_PICTURE_TYPE_B: return "STD_VIDEO_H265_PICTURE_TYPE_B"; + case STD_VIDEO_H265_PICTURE_TYPE_I: return "STD_VIDEO_H265_PICTURE_TYPE_I"; + case STD_VIDEO_H265_PICTURE_TYPE_IDR: return "STD_VIDEO_H265_PICTURE_TYPE_IDR"; + case STD_VIDEO_H265_PICTURE_TYPE_INVALID: return "STD_VIDEO_H265_PICTURE_TYPE_INVALID"; + default: return std::string("UNKNOWN_StdVideoH265PictureType_value") + std::to_string(value); + } +} +void DumpStdVideoH265PictureType(Printer &p, std::string name, StdVideoH265PictureType value) { + p.PrintKeyString(name, StdVideoH265PictureTypeString(value)); +} +std::string StdVideoH265AspectRatioIdcString(StdVideoH265AspectRatioIdc value) { + switch (value) { + case STD_VIDEO_H265_ASPECT_RATIO_IDC_UNSPECIFIED: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_UNSPECIFIED"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_SQUARE: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_SQUARE"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_12_11: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_12_11"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_10_11: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_10_11"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_16_11: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_16_11"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_40_33: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_40_33"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_24_11: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_24_11"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_20_11: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_20_11"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_32_11: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_32_11"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_80_33: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_80_33"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_18_11: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_18_11"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_15_11: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_15_11"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_64_33: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_64_33"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_160_99: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_160_99"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_4_3: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_4_3"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_3_2: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_3_2"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_2_1: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_2_1"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_EXTENDED_SAR: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_EXTENDED_SAR"; + case STD_VIDEO_H265_ASPECT_RATIO_IDC_INVALID: return "STD_VIDEO_H265_ASPECT_RATIO_IDC_INVALID"; + default: return std::string("UNKNOWN_StdVideoH265AspectRatioIdc_value") + std::to_string(value); + } +} +void DumpStdVideoH265AspectRatioIdc(Printer &p, std::string name, StdVideoH265AspectRatioIdc value) { + p.PrintKeyString(name, StdVideoH265AspectRatioIdcString(value)); +} +std::string StdVideoAV1ProfileString(StdVideoAV1Profile value) { + switch (value) { + case STD_VIDEO_AV1_PROFILE_MAIN: return "STD_VIDEO_AV1_PROFILE_MAIN"; + case STD_VIDEO_AV1_PROFILE_HIGH: return "STD_VIDEO_AV1_PROFILE_HIGH"; + case STD_VIDEO_AV1_PROFILE_PROFESSIONAL: return "STD_VIDEO_AV1_PROFILE_PROFESSIONAL"; + case STD_VIDEO_AV1_PROFILE_INVALID: return "STD_VIDEO_AV1_PROFILE_INVALID"; + default: return std::string("UNKNOWN_StdVideoAV1Profile_value") + std::to_string(value); + } +} +void DumpStdVideoAV1Profile(Printer &p, std::string name, StdVideoAV1Profile value) { + p.PrintKeyString(name, StdVideoAV1ProfileString(value)); +} +std::string StdVideoAV1LevelString(StdVideoAV1Level value) { + switch (value) { + case STD_VIDEO_AV1_LEVEL_2_0: return "STD_VIDEO_AV1_LEVEL_2_0"; + case STD_VIDEO_AV1_LEVEL_2_1: return "STD_VIDEO_AV1_LEVEL_2_1"; + case STD_VIDEO_AV1_LEVEL_2_2: return "STD_VIDEO_AV1_LEVEL_2_2"; + case STD_VIDEO_AV1_LEVEL_2_3: return "STD_VIDEO_AV1_LEVEL_2_3"; + case STD_VIDEO_AV1_LEVEL_3_0: return "STD_VIDEO_AV1_LEVEL_3_0"; + case STD_VIDEO_AV1_LEVEL_3_1: return "STD_VIDEO_AV1_LEVEL_3_1"; + case STD_VIDEO_AV1_LEVEL_3_2: return "STD_VIDEO_AV1_LEVEL_3_2"; + case STD_VIDEO_AV1_LEVEL_3_3: return "STD_VIDEO_AV1_LEVEL_3_3"; + case STD_VIDEO_AV1_LEVEL_4_0: return "STD_VIDEO_AV1_LEVEL_4_0"; + case STD_VIDEO_AV1_LEVEL_4_1: return "STD_VIDEO_AV1_LEVEL_4_1"; + case STD_VIDEO_AV1_LEVEL_4_2: return "STD_VIDEO_AV1_LEVEL_4_2"; + case STD_VIDEO_AV1_LEVEL_4_3: return "STD_VIDEO_AV1_LEVEL_4_3"; + case STD_VIDEO_AV1_LEVEL_5_0: return "STD_VIDEO_AV1_LEVEL_5_0"; + case STD_VIDEO_AV1_LEVEL_5_1: return "STD_VIDEO_AV1_LEVEL_5_1"; + case STD_VIDEO_AV1_LEVEL_5_2: return "STD_VIDEO_AV1_LEVEL_5_2"; + case STD_VIDEO_AV1_LEVEL_5_3: return "STD_VIDEO_AV1_LEVEL_5_3"; + case STD_VIDEO_AV1_LEVEL_6_0: return "STD_VIDEO_AV1_LEVEL_6_0"; + case STD_VIDEO_AV1_LEVEL_6_1: return "STD_VIDEO_AV1_LEVEL_6_1"; + case STD_VIDEO_AV1_LEVEL_6_2: return "STD_VIDEO_AV1_LEVEL_6_2"; + case STD_VIDEO_AV1_LEVEL_6_3: return "STD_VIDEO_AV1_LEVEL_6_3"; + case STD_VIDEO_AV1_LEVEL_7_0: return "STD_VIDEO_AV1_LEVEL_7_0"; + case STD_VIDEO_AV1_LEVEL_7_1: return "STD_VIDEO_AV1_LEVEL_7_1"; + case STD_VIDEO_AV1_LEVEL_7_2: return "STD_VIDEO_AV1_LEVEL_7_2"; + case STD_VIDEO_AV1_LEVEL_7_3: return "STD_VIDEO_AV1_LEVEL_7_3"; + case STD_VIDEO_AV1_LEVEL_INVALID: return "STD_VIDEO_AV1_LEVEL_INVALID"; + default: return std::string("UNKNOWN_StdVideoAV1Level_value") + std::to_string(value); + } +} +void DumpStdVideoAV1Level(Printer &p, std::string name, StdVideoAV1Level value) { + p.PrintKeyString(name, StdVideoAV1LevelString(value)); +} +std::string StdVideoAV1FrameTypeString(StdVideoAV1FrameType value) { + switch (value) { + case STD_VIDEO_AV1_FRAME_TYPE_KEY: return "STD_VIDEO_AV1_FRAME_TYPE_KEY"; + case STD_VIDEO_AV1_FRAME_TYPE_INTER: return "STD_VIDEO_AV1_FRAME_TYPE_INTER"; + case STD_VIDEO_AV1_FRAME_TYPE_INTRA_ONLY: return "STD_VIDEO_AV1_FRAME_TYPE_INTRA_ONLY"; + case STD_VIDEO_AV1_FRAME_TYPE_SWITCH: return "STD_VIDEO_AV1_FRAME_TYPE_SWITCH"; + case STD_VIDEO_AV1_FRAME_TYPE_INVALID: return "STD_VIDEO_AV1_FRAME_TYPE_INVALID"; + default: return std::string("UNKNOWN_StdVideoAV1FrameType_value") + std::to_string(value); + } +} +void DumpStdVideoAV1FrameType(Printer &p, std::string name, StdVideoAV1FrameType value) { + p.PrintKeyString(name, StdVideoAV1FrameTypeString(value)); +} +std::string StdVideoAV1ReferenceNameString(StdVideoAV1ReferenceName value) { + switch (value) { + case STD_VIDEO_AV1_REFERENCE_NAME_INTRA_FRAME: return "STD_VIDEO_AV1_REFERENCE_NAME_INTRA_FRAME"; + case STD_VIDEO_AV1_REFERENCE_NAME_LAST_FRAME: return "STD_VIDEO_AV1_REFERENCE_NAME_LAST_FRAME"; + case STD_VIDEO_AV1_REFERENCE_NAME_LAST2_FRAME: return "STD_VIDEO_AV1_REFERENCE_NAME_LAST2_FRAME"; + case STD_VIDEO_AV1_REFERENCE_NAME_LAST3_FRAME: return "STD_VIDEO_AV1_REFERENCE_NAME_LAST3_FRAME"; + case STD_VIDEO_AV1_REFERENCE_NAME_GOLDEN_FRAME: return "STD_VIDEO_AV1_REFERENCE_NAME_GOLDEN_FRAME"; + case STD_VIDEO_AV1_REFERENCE_NAME_BWDREF_FRAME: return "STD_VIDEO_AV1_REFERENCE_NAME_BWDREF_FRAME"; + case STD_VIDEO_AV1_REFERENCE_NAME_ALTREF2_FRAME: return "STD_VIDEO_AV1_REFERENCE_NAME_ALTREF2_FRAME"; + case STD_VIDEO_AV1_REFERENCE_NAME_ALTREF_FRAME: return "STD_VIDEO_AV1_REFERENCE_NAME_ALTREF_FRAME"; + case STD_VIDEO_AV1_REFERENCE_NAME_INVALID: return "STD_VIDEO_AV1_REFERENCE_NAME_INVALID"; + default: return std::string("UNKNOWN_StdVideoAV1ReferenceName_value") + std::to_string(value); + } +} +void DumpStdVideoAV1ReferenceName(Printer &p, std::string name, StdVideoAV1ReferenceName value) { + p.PrintKeyString(name, StdVideoAV1ReferenceNameString(value)); +} +std::string StdVideoAV1InterpolationFilterString(StdVideoAV1InterpolationFilter value) { + switch (value) { + case STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP: return "STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP"; + case STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH: return "STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH"; + case STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP_SHARP: return "STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP_SHARP"; + case STD_VIDEO_AV1_INTERPOLATION_FILTER_BILINEAR: return "STD_VIDEO_AV1_INTERPOLATION_FILTER_BILINEAR"; + case STD_VIDEO_AV1_INTERPOLATION_FILTER_SWITCHABLE: return "STD_VIDEO_AV1_INTERPOLATION_FILTER_SWITCHABLE"; + case STD_VIDEO_AV1_INTERPOLATION_FILTER_INVALID: return "STD_VIDEO_AV1_INTERPOLATION_FILTER_INVALID"; + default: return std::string("UNKNOWN_StdVideoAV1InterpolationFilter_value") + std::to_string(value); + } +} +void DumpStdVideoAV1InterpolationFilter(Printer &p, std::string name, StdVideoAV1InterpolationFilter value) { + p.PrintKeyString(name, StdVideoAV1InterpolationFilterString(value)); +} +std::string StdVideoAV1TxModeString(StdVideoAV1TxMode value) { + switch (value) { + case STD_VIDEO_AV1_TX_MODE_ONLY_4X4: return "STD_VIDEO_AV1_TX_MODE_ONLY_4X4"; + case STD_VIDEO_AV1_TX_MODE_LARGEST: return "STD_VIDEO_AV1_TX_MODE_LARGEST"; + case STD_VIDEO_AV1_TX_MODE_SELECT: return "STD_VIDEO_AV1_TX_MODE_SELECT"; + case STD_VIDEO_AV1_TX_MODE_INVALID: return "STD_VIDEO_AV1_TX_MODE_INVALID"; + default: return std::string("UNKNOWN_StdVideoAV1TxMode_value") + std::to_string(value); + } +} +void DumpStdVideoAV1TxMode(Printer &p, std::string name, StdVideoAV1TxMode value) { + p.PrintKeyString(name, StdVideoAV1TxModeString(value)); +} +std::string StdVideoAV1FrameRestorationTypeString(StdVideoAV1FrameRestorationType value) { + switch (value) { + case STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_NONE: return "STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_NONE"; + case STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_WIENER: return "STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_WIENER"; + case STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SGRPROJ: return "STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SGRPROJ"; + case STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SWITCHABLE: return "STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SWITCHABLE"; + case STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_INVALID: return "STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_INVALID"; + default: return std::string("UNKNOWN_StdVideoAV1FrameRestorationType_value") + std::to_string(value); + } +} +void DumpStdVideoAV1FrameRestorationType(Printer &p, std::string name, StdVideoAV1FrameRestorationType value) { + p.PrintKeyString(name, StdVideoAV1FrameRestorationTypeString(value)); +} +std::string StdVideoAV1ColorPrimariesString(StdVideoAV1ColorPrimaries value) { + switch (value) { + case STD_VIDEO_AV1_COLOR_PRIMARIES_BT_709: return "STD_VIDEO_AV1_COLOR_PRIMARIES_BT_709"; + case STD_VIDEO_AV1_COLOR_PRIMARIES_UNSPECIFIED: return "STD_VIDEO_AV1_COLOR_PRIMARIES_UNSPECIFIED"; + case STD_VIDEO_AV1_COLOR_PRIMARIES_BT_470_M: return "STD_VIDEO_AV1_COLOR_PRIMARIES_BT_470_M"; + case STD_VIDEO_AV1_COLOR_PRIMARIES_BT_470_B_G: return "STD_VIDEO_AV1_COLOR_PRIMARIES_BT_470_B_G"; + case STD_VIDEO_AV1_COLOR_PRIMARIES_BT_601: return "STD_VIDEO_AV1_COLOR_PRIMARIES_BT_601"; + case STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_240: return "STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_240"; + case STD_VIDEO_AV1_COLOR_PRIMARIES_GENERIC_FILM: return "STD_VIDEO_AV1_COLOR_PRIMARIES_GENERIC_FILM"; + case STD_VIDEO_AV1_COLOR_PRIMARIES_BT_2020: return "STD_VIDEO_AV1_COLOR_PRIMARIES_BT_2020"; + case STD_VIDEO_AV1_COLOR_PRIMARIES_XYZ: return "STD_VIDEO_AV1_COLOR_PRIMARIES_XYZ"; + case STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_431: return "STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_431"; + case STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_432: return "STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_432"; + case STD_VIDEO_AV1_COLOR_PRIMARIES_EBU_3213: return "STD_VIDEO_AV1_COLOR_PRIMARIES_EBU_3213"; + case STD_VIDEO_AV1_COLOR_PRIMARIES_INVALID: return "STD_VIDEO_AV1_COLOR_PRIMARIES_INVALID"; + default: return std::string("UNKNOWN_StdVideoAV1ColorPrimaries_value") + std::to_string(value); + } +} +void DumpStdVideoAV1ColorPrimaries(Printer &p, std::string name, StdVideoAV1ColorPrimaries value) { + p.PrintKeyString(name, StdVideoAV1ColorPrimariesString(value)); +} +std::string StdVideoAV1TransferCharacteristicsString(StdVideoAV1TransferCharacteristics value) { + switch (value) { + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_RESERVED_0: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_RESERVED_0"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_709: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_709"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_UNSPECIFIED: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_UNSPECIFIED"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_RESERVED_3: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_RESERVED_3"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_470_M: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_470_M"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_470_B_G: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_470_B_G"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_601: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_601"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_240: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_240"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LINEAR: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LINEAR"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LOG_100: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LOG_100"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LOG_100_SQRT10: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LOG_100_SQRT10"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_IEC_61966: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_IEC_61966"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_1361: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_1361"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SRGB: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SRGB"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_2020_10_BIT: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_2020_10_BIT"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_2020_12_BIT: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_2020_12_BIT"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_2084: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_2084"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_428: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_428"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_HLG: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_HLG"; + case STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_INVALID: return "STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_INVALID"; + default: return std::string("UNKNOWN_StdVideoAV1TransferCharacteristics_value") + std::to_string(value); + } +} +void DumpStdVideoAV1TransferCharacteristics(Printer &p, std::string name, StdVideoAV1TransferCharacteristics value) { + p.PrintKeyString(name, StdVideoAV1TransferCharacteristicsString(value)); +} +std::string StdVideoAV1MatrixCoefficientsString(StdVideoAV1MatrixCoefficients value) { + switch (value) { + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_IDENTITY: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_IDENTITY"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_709: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_709"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_UNSPECIFIED: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_UNSPECIFIED"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_RESERVED_3: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_RESERVED_3"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_FCC: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_FCC"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_470_B_G: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_470_B_G"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_601: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_601"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_240: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_240"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_YCGCO: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_YCGCO"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_2020_NCL: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_2020_NCL"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_2020_CL: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_2020_CL"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_2085: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_2085"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_CHROMAT_NCL: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_CHROMAT_NCL"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_CHROMAT_CL: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_CHROMAT_CL"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_ICTCP: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_ICTCP"; + case STD_VIDEO_AV1_MATRIX_COEFFICIENTS_INVALID: return "STD_VIDEO_AV1_MATRIX_COEFFICIENTS_INVALID"; + default: return std::string("UNKNOWN_StdVideoAV1MatrixCoefficients_value") + std::to_string(value); + } +} +void DumpStdVideoAV1MatrixCoefficients(Printer &p, std::string name, StdVideoAV1MatrixCoefficients value) { + p.PrintKeyString(name, StdVideoAV1MatrixCoefficientsString(value)); +} +std::string StdVideoAV1ChromaSamplePositionString(StdVideoAV1ChromaSamplePosition value) { + switch (value) { + case STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_UNKNOWN: return "STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_UNKNOWN"; + case STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_VERTICAL: return "STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_VERTICAL"; + case STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_COLOCATED: return "STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_COLOCATED"; + case STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_RESERVED: return "STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_RESERVED"; + case STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_INVALID: return "STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_INVALID"; + default: return std::string("UNKNOWN_StdVideoAV1ChromaSamplePosition_value") + std::to_string(value); + } +} +void DumpStdVideoAV1ChromaSamplePosition(Printer &p, std::string name, StdVideoAV1ChromaSamplePosition value) { + p.PrintKeyString(name, StdVideoAV1ChromaSamplePositionString(value)); +} std::string VkColorSpaceKHRString(VkColorSpaceKHR value) { switch (value) { case (VK_COLOR_SPACE_SRGB_NONLINEAR_KHR): return "COLOR_SPACE_SRGB_NONLINEAR_KHR"; @@ -72,6 +583,24 @@ void DumpVkColorSpaceKHR(Printer &p, std::string name, VkColorSpaceKHR value) { else p.PrintKeyString(name, VkColorSpaceKHRString(value)); } +std::string VkComponentSwizzleString(VkComponentSwizzle value) { + switch (value) { + case (VK_COMPONENT_SWIZZLE_IDENTITY): return "COMPONENT_SWIZZLE_IDENTITY"; + case (VK_COMPONENT_SWIZZLE_ZERO): return "COMPONENT_SWIZZLE_ZERO"; + case (VK_COMPONENT_SWIZZLE_ONE): return "COMPONENT_SWIZZLE_ONE"; + case (VK_COMPONENT_SWIZZLE_R): return "COMPONENT_SWIZZLE_R"; + case (VK_COMPONENT_SWIZZLE_G): return "COMPONENT_SWIZZLE_G"; + case (VK_COMPONENT_SWIZZLE_B): return "COMPONENT_SWIZZLE_B"; + case (VK_COMPONENT_SWIZZLE_A): return "COMPONENT_SWIZZLE_A"; + default: return std::string("UNKNOWN_VkComponentSwizzle_value") + std::to_string(value); + } +} +void DumpVkComponentSwizzle(Printer &p, std::string name, VkComponentSwizzle value) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + VkComponentSwizzleString(value)); + else + p.PrintKeyString(name, VkComponentSwizzleString(value)); +} std::string VkDriverIdString(VkDriverId value) { switch (value) { case (VK_DRIVER_ID_AMD_PROPRIETARY): return "DRIVER_ID_AMD_PROPRIETARY"; @@ -100,7 +629,7 @@ std::string VkDriverIdString(VkDriverId value) { case (VK_DRIVER_ID_MESA_NVK): return "DRIVER_ID_MESA_NVK"; case (VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA): return "DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA"; case (VK_DRIVER_ID_MESA_HONEYKRISP): return "DRIVER_ID_MESA_HONEYKRISP"; - case (VK_DRIVER_ID_RESERVED_27): return "DRIVER_ID_RESERVED_27"; + case (VK_DRIVER_ID_VULKAN_SC_EMULATION_ON_VULKAN): return "DRIVER_ID_VULKAN_SC_EMULATION_ON_VULKAN"; default: return std::string("UNKNOWN_VkDriverId_value") + std::to_string(value); } } @@ -351,6 +880,8 @@ std::string VkFormatString(VkFormat value) { case (VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK): return "FORMAT_ASTC_10x10_SFLOAT_BLOCK"; case (VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK): return "FORMAT_ASTC_12x10_SFLOAT_BLOCK"; case (VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK): return "FORMAT_ASTC_12x12_SFLOAT_BLOCK"; + case (VK_FORMAT_A1B5G5R5_UNORM_PACK16): return "FORMAT_A1B5G5R5_UNORM_PACK16"; + case (VK_FORMAT_A8_UNORM): return "FORMAT_A8_UNORM"; case (VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG): return "FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG"; case (VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG): return "FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG"; case (VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG): return "FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG"; @@ -360,8 +891,6 @@ std::string VkFormatString(VkFormat value) { case (VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG): return "FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG"; case (VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG): return "FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG"; case (VK_FORMAT_R16G16_SFIXED5_NV): return "FORMAT_R16G16_SFIXED5_NV"; - case (VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR): return "FORMAT_A1B5G5R5_UNORM_PACK16_KHR"; - case (VK_FORMAT_A8_UNORM_KHR): return "FORMAT_A8_UNORM_KHR"; default: return std::string("UNKNOWN_VkFormat_value") + std::to_string(value); } } @@ -390,6 +919,7 @@ std::string VkImageLayoutString(VkImageLayout value) { case (VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL): return "IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL"; case (VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL): return "IMAGE_LAYOUT_READ_ONLY_OPTIMAL"; case (VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL): return "IMAGE_LAYOUT_ATTACHMENT_OPTIMAL"; + case (VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ): return "IMAGE_LAYOUT_RENDERING_LOCAL_READ"; case (VK_IMAGE_LAYOUT_PRESENT_SRC_KHR): return "IMAGE_LAYOUT_PRESENT_SRC_KHR"; case (VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR): return "IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR"; case (VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR): return "IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR"; @@ -397,11 +927,11 @@ std::string VkImageLayoutString(VkImageLayout value) { case (VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR): return "IMAGE_LAYOUT_SHARED_PRESENT_KHR"; case (VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT): return "IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT"; case (VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR): return "IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR"; - case (VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR): return "IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR"; case (VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR): return "IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR"; case (VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR): return "IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR"; case (VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR): return "IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR"; case (VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT): return "IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT"; + case (VK_IMAGE_LAYOUT_VIDEO_ENCODE_QUANTIZATION_MAP_KHR): return "IMAGE_LAYOUT_VIDEO_ENCODE_QUANTIZATION_MAP_KHR"; default: return std::string("UNKNOWN_VkImageLayout_value") + std::to_string(value); } } @@ -425,6 +955,20 @@ void DumpVkImageTiling(Printer &p, std::string name, VkImageTiling value) { else p.PrintKeyString(name, VkImageTilingString(value)); } +std::string VkImageTypeString(VkImageType value) { + switch (value) { + case (VK_IMAGE_TYPE_1D): return "IMAGE_TYPE_1D"; + case (VK_IMAGE_TYPE_2D): return "IMAGE_TYPE_2D"; + case (VK_IMAGE_TYPE_3D): return "IMAGE_TYPE_3D"; + default: return std::string("UNKNOWN_VkImageType_value") + std::to_string(value); + } +} +void DumpVkImageType(Printer &p, std::string name, VkImageType value) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + VkImageTypeString(value)); + else + p.PrintKeyString(name, VkImageTypeString(value)); +} std::string VkPhysicalDeviceLayeredApiKHRString(VkPhysicalDeviceLayeredApiKHR value) { switch (value) { case (VK_PHYSICAL_DEVICE_LAYERED_API_VULKAN_KHR): return "PHYSICAL_DEVICE_LAYERED_API_VULKAN_KHR"; @@ -457,35 +1001,35 @@ void DumpVkPhysicalDeviceType(Printer &p, std::string name, VkPhysicalDeviceType else p.PrintKeyString(name, VkPhysicalDeviceTypeString(value)); } -std::string VkPipelineRobustnessBufferBehaviorEXTString(VkPipelineRobustnessBufferBehaviorEXT value) { +std::string VkPipelineRobustnessBufferBehaviorString(VkPipelineRobustnessBufferBehavior value) { switch (value) { - case (VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT_EXT): return "PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT_EXT"; - case (VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT): return "PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT"; - case (VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT): return "PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT"; - case (VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT): return "PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT"; - default: return std::string("UNKNOWN_VkPipelineRobustnessBufferBehaviorEXT_value") + std::to_string(value); + case (VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT): return "PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT"; + case (VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED): return "PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED"; + case (VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS): return "PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS"; + case (VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2): return "PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2"; + default: return std::string("UNKNOWN_VkPipelineRobustnessBufferBehavior_value") + std::to_string(value); } } -void DumpVkPipelineRobustnessBufferBehaviorEXT(Printer &p, std::string name, VkPipelineRobustnessBufferBehaviorEXT value) { +void DumpVkPipelineRobustnessBufferBehavior(Printer &p, std::string name, VkPipelineRobustnessBufferBehavior value) { if (p.Type() == OutputType::json) - p.PrintKeyString(name, std::string("VK_") + VkPipelineRobustnessBufferBehaviorEXTString(value)); + p.PrintKeyString(name, std::string("VK_") + VkPipelineRobustnessBufferBehaviorString(value)); else - p.PrintKeyString(name, VkPipelineRobustnessBufferBehaviorEXTString(value)); + p.PrintKeyString(name, VkPipelineRobustnessBufferBehaviorString(value)); } -std::string VkPipelineRobustnessImageBehaviorEXTString(VkPipelineRobustnessImageBehaviorEXT value) { +std::string VkPipelineRobustnessImageBehaviorString(VkPipelineRobustnessImageBehavior value) { switch (value) { - case (VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT_EXT): return "PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT_EXT"; - case (VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED_EXT): return "PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED_EXT"; - case (VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_EXT): return "PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_EXT"; - case (VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2_EXT): return "PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2_EXT"; - default: return std::string("UNKNOWN_VkPipelineRobustnessImageBehaviorEXT_value") + std::to_string(value); + case (VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT): return "PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT"; + case (VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED): return "PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED"; + case (VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS): return "PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS"; + case (VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2): return "PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2"; + default: return std::string("UNKNOWN_VkPipelineRobustnessImageBehavior_value") + std::to_string(value); } } -void DumpVkPipelineRobustnessImageBehaviorEXT(Printer &p, std::string name, VkPipelineRobustnessImageBehaviorEXT value) { +void DumpVkPipelineRobustnessImageBehavior(Printer &p, std::string name, VkPipelineRobustnessImageBehavior value) { if (p.Type() == OutputType::json) - p.PrintKeyString(name, std::string("VK_") + VkPipelineRobustnessImageBehaviorEXTString(value)); + p.PrintKeyString(name, std::string("VK_") + VkPipelineRobustnessImageBehaviorString(value)); else - p.PrintKeyString(name, VkPipelineRobustnessImageBehaviorEXTString(value)); + p.PrintKeyString(name, VkPipelineRobustnessImageBehaviorString(value)); } std::string VkPointClippingBehaviorString(VkPointClippingBehavior value) { switch (value) { @@ -508,6 +1052,7 @@ std::string VkPresentModeKHRString(VkPresentModeKHR value) { case (VK_PRESENT_MODE_FIFO_RELAXED_KHR): return "PRESENT_MODE_FIFO_RELAXED_KHR"; case (VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR): return "PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR"; case (VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR): return "PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR"; + case (VK_PRESENT_MODE_FIFO_LATEST_READY_EXT): return "PRESENT_MODE_FIFO_LATEST_READY_EXT"; default: return std::string("UNKNOWN_VkPresentModeKHR_value") + std::to_string(value); } } @@ -517,20 +1062,20 @@ void DumpVkPresentModeKHR(Printer &p, std::string name, VkPresentModeKHR value) else p.PrintKeyString(name, VkPresentModeKHRString(value)); } -std::string VkQueueGlobalPriorityKHRString(VkQueueGlobalPriorityKHR value) { +std::string VkQueueGlobalPriorityString(VkQueueGlobalPriority value) { switch (value) { - case (VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR): return "QUEUE_GLOBAL_PRIORITY_LOW_KHR"; - case (VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR): return "QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR"; - case (VK_QUEUE_GLOBAL_PRIORITY_HIGH_KHR): return "QUEUE_GLOBAL_PRIORITY_HIGH_KHR"; - case (VK_QUEUE_GLOBAL_PRIORITY_REALTIME_KHR): return "QUEUE_GLOBAL_PRIORITY_REALTIME_KHR"; - default: return std::string("UNKNOWN_VkQueueGlobalPriorityKHR_value") + std::to_string(value); + case (VK_QUEUE_GLOBAL_PRIORITY_LOW): return "QUEUE_GLOBAL_PRIORITY_LOW"; + case (VK_QUEUE_GLOBAL_PRIORITY_MEDIUM): return "QUEUE_GLOBAL_PRIORITY_MEDIUM"; + case (VK_QUEUE_GLOBAL_PRIORITY_HIGH): return "QUEUE_GLOBAL_PRIORITY_HIGH"; + case (VK_QUEUE_GLOBAL_PRIORITY_REALTIME): return "QUEUE_GLOBAL_PRIORITY_REALTIME"; + default: return std::string("UNKNOWN_VkQueueGlobalPriority_value") + std::to_string(value); } } -void DumpVkQueueGlobalPriorityKHR(Printer &p, std::string name, VkQueueGlobalPriorityKHR value) { +void DumpVkQueueGlobalPriority(Printer &p, std::string name, VkQueueGlobalPriority value) { if (p.Type() == OutputType::json) - p.PrintKeyString(name, std::string("VK_") + VkQueueGlobalPriorityKHRString(value)); + p.PrintKeyString(name, std::string("VK_") + VkQueueGlobalPriorityString(value)); else - p.PrintKeyString(name, VkQueueGlobalPriorityKHRString(value)); + p.PrintKeyString(name, VkQueueGlobalPriorityString(value)); } std::string VkResultString(VkResult value) { switch (value) { @@ -558,6 +1103,7 @@ std::string VkResultString(VkResult value) { case (VK_ERROR_FRAGMENTATION): return "ERROR_FRAGMENTATION"; case (VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS): return "ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS"; case (VK_PIPELINE_COMPILE_REQUIRED): return "PIPELINE_COMPILE_REQUIRED"; + case (VK_ERROR_NOT_PERMITTED): return "ERROR_NOT_PERMITTED"; case (VK_ERROR_SURFACE_LOST_KHR): return "ERROR_SURFACE_LOST_KHR"; case (VK_ERROR_NATIVE_WINDOW_IN_USE_KHR): return "ERROR_NATIVE_WINDOW_IN_USE_KHR"; case (VK_SUBOPTIMAL_KHR): return "SUBOPTIMAL_KHR"; @@ -572,7 +1118,6 @@ std::string VkResultString(VkResult value) { case (VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR): return "ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR"; case (VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR): return "ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR"; case (VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT): return "ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT"; - case (VK_ERROR_NOT_PERMITTED_KHR): return "ERROR_NOT_PERMITTED_KHR"; case (VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT): return "ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT"; case (VK_THREAD_IDLE_KHR): return "THREAD_IDLE_KHR"; case (VK_THREAD_DONE_KHR): return "THREAD_DONE_KHR"; @@ -581,6 +1126,8 @@ std::string VkResultString(VkResult value) { case (VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR): return "ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR"; case (VK_ERROR_COMPRESSION_EXHAUSTED_EXT): return "ERROR_COMPRESSION_EXHAUSTED_EXT"; case (VK_INCOMPATIBLE_SHADER_BINARY_EXT): return "INCOMPATIBLE_SHADER_BINARY_EXT"; + case (VK_PIPELINE_BINARY_MISSING_KHR): return "PIPELINE_BINARY_MISSING_KHR"; + case (VK_ERROR_NOT_ENOUGH_SPACE_KHR): return "ERROR_NOT_ENOUGH_SPACE_KHR"; default: return std::string("UNKNOWN_VkResult_value") + std::to_string(value); } } @@ -604,6 +1151,22 @@ void DumpVkShaderFloatControlsIndependence(Printer &p, std::string name, VkShade else p.PrintKeyString(name, VkShaderFloatControlsIndependenceString(value)); } +std::string VkVideoEncodeTuningModeKHRString(VkVideoEncodeTuningModeKHR value) { + switch (value) { + case (VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR): return "VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR"; + case (VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR): return "VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR"; + case (VK_VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR): return "VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR"; + case (VK_VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR): return "VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR"; + case (VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR): return "VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR"; + default: return std::string("UNKNOWN_VkVideoEncodeTuningModeKHR_value") + std::to_string(value); + } +} +void DumpVkVideoEncodeTuningModeKHR(Printer &p, std::string name, VkVideoEncodeTuningModeKHR value) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + VkVideoEncodeTuningModeKHRString(value)); + else + p.PrintKeyString(name, VkVideoEncodeTuningModeKHRString(value)); +} std::vector VkCompositeAlphaFlagBitsKHRGetStrings(VkCompositeAlphaFlagBitsKHR value) { std::vector strings; if (value == 0) { strings.push_back("None"); return strings; } @@ -752,7 +1315,6 @@ std::vector VkFormatFeatureFlagBits2GetStrings(VkFormatFeatureFlag if (VK_FORMAT_FEATURE_2_BLIT_SRC_BIT & value) strings.push_back("FORMAT_FEATURE_2_BLIT_SRC_BIT"); if (VK_FORMAT_FEATURE_2_BLIT_DST_BIT & value) strings.push_back("FORMAT_FEATURE_2_BLIT_DST_BIT"); if (VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT & value) strings.push_back("FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT"); - if (VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT & value) strings.push_back("FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT"); if (VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT & value) strings.push_back("FORMAT_FEATURE_2_TRANSFER_SRC_BIT"); if (VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT & value) strings.push_back("FORMAT_FEATURE_2_TRANSFER_DST_BIT"); if (VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT & value) strings.push_back("FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT"); @@ -766,14 +1328,16 @@ std::vector VkFormatFeatureFlagBits2GetStrings(VkFormatFeatureFlag if (VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT & value) strings.push_back("FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT"); if (VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT & value) strings.push_back("FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT"); if (VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT & value) strings.push_back("FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT"); + if (VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT & value) strings.push_back("FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT"); + if (VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT & value) strings.push_back("FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT"); if (VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR & value) strings.push_back("FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR"); if (VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR & value) strings.push_back("FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR"); if (VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR & value) strings.push_back("FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR"); if (VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT & value) strings.push_back("FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT"); if (VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR & value) strings.push_back("FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"); - if (VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT & value) strings.push_back("FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT"); if (VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR & value) strings.push_back("FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR"); if (VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR & value) strings.push_back("FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR"); + if (VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_RADIUS_BUFFER_BIT_NV & value) strings.push_back("FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_RADIUS_BUFFER_BIT_NV"); if (VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV & value) strings.push_back("FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV"); if (VK_FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM & value) strings.push_back("FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM"); if (VK_FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM & value) strings.push_back("FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM"); @@ -782,6 +1346,8 @@ std::vector VkFormatFeatureFlagBits2GetStrings(VkFormatFeatureFlag if (VK_FORMAT_FEATURE_2_OPTICAL_FLOW_IMAGE_BIT_NV & value) strings.push_back("FORMAT_FEATURE_2_OPTICAL_FLOW_IMAGE_BIT_NV"); if (VK_FORMAT_FEATURE_2_OPTICAL_FLOW_VECTOR_BIT_NV & value) strings.push_back("FORMAT_FEATURE_2_OPTICAL_FLOW_VECTOR_BIT_NV"); if (VK_FORMAT_FEATURE_2_OPTICAL_FLOW_COST_BIT_NV & value) strings.push_back("FORMAT_FEATURE_2_OPTICAL_FLOW_COST_BIT_NV"); + if (VK_FORMAT_FEATURE_2_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR & value) strings.push_back("FORMAT_FEATURE_2_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR"); + if (VK_FORMAT_FEATURE_2_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR & value) strings.push_back("FORMAT_FEATURE_2_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR"); return strings; } void DumpVkFormatFeatureFlags2(Printer &p, std::string name, VkFormatFeatureFlags2 value) { @@ -810,6 +1376,57 @@ void DumpVkFormatFeatureFlagBits2(Printer &p, std::string name, VkFormatFeatureF } } +std::vector VkImageCreateFlagBitsGetStrings(VkImageCreateFlagBits value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_IMAGE_CREATE_SPARSE_BINDING_BIT & value) strings.push_back("IMAGE_CREATE_SPARSE_BINDING_BIT"); + if (VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT & value) strings.push_back("IMAGE_CREATE_SPARSE_RESIDENCY_BIT"); + if (VK_IMAGE_CREATE_SPARSE_ALIASED_BIT & value) strings.push_back("IMAGE_CREATE_SPARSE_ALIASED_BIT"); + if (VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT & value) strings.push_back("IMAGE_CREATE_MUTABLE_FORMAT_BIT"); + if (VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT & value) strings.push_back("IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); + if (VK_IMAGE_CREATE_ALIAS_BIT & value) strings.push_back("IMAGE_CREATE_ALIAS_BIT"); + if (VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT & value) strings.push_back("IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT"); + if (VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT & value) strings.push_back("IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT"); + if (VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT & value) strings.push_back("IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT"); + if (VK_IMAGE_CREATE_EXTENDED_USAGE_BIT & value) strings.push_back("IMAGE_CREATE_EXTENDED_USAGE_BIT"); + if (VK_IMAGE_CREATE_PROTECTED_BIT & value) strings.push_back("IMAGE_CREATE_PROTECTED_BIT"); + if (VK_IMAGE_CREATE_DISJOINT_BIT & value) strings.push_back("IMAGE_CREATE_DISJOINT_BIT"); + if (VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV & value) strings.push_back("IMAGE_CREATE_CORNER_SAMPLED_BIT_NV"); + if (VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT & value) strings.push_back("IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT"); + if (VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT & value) strings.push_back("IMAGE_CREATE_SUBSAMPLED_BIT_EXT"); + if (VK_IMAGE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT & value) strings.push_back("IMAGE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT"); + if (VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT & value) strings.push_back("IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT"); + if (VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT & value) strings.push_back("IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT"); + if (VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM & value) strings.push_back("IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM"); + if (VK_IMAGE_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR & value) strings.push_back("IMAGE_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR"); + return strings; +} +void DumpVkImageCreateFlags(Printer &p, std::string name, VkImageCreateFlags value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkImageCreateFlagBitsGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkImageCreateFlagBits(Printer &p, std::string name, VkImageCreateFlagBits value) { + auto strings = VkImageCreateFlagBitsGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + std::vector VkImageUsageFlagBitsGetStrings(VkImageUsageFlagBits value) { std::vector strings; if (value == 0) { strings.push_back("None"); return strings; } @@ -821,12 +1438,12 @@ std::vector VkImageUsageFlagBitsGetStrings(VkImageUsageFlagBits va if (VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT & value) strings.push_back("IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT"); if (VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT & value) strings.push_back("IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT"); if (VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT & value) strings.push_back("IMAGE_USAGE_INPUT_ATTACHMENT_BIT"); + if (VK_IMAGE_USAGE_HOST_TRANSFER_BIT & value) strings.push_back("IMAGE_USAGE_HOST_TRANSFER_BIT"); if (VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR & value) strings.push_back("IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR"); if (VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR & value) strings.push_back("IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR"); if (VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR & value) strings.push_back("IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR"); if (VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT & value) strings.push_back("IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT"); if (VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR & value) strings.push_back("IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"); - if (VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT & value) strings.push_back("IMAGE_USAGE_HOST_TRANSFER_BIT_EXT"); if (VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR & value) strings.push_back("IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR"); if (VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR & value) strings.push_back("IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR"); if (VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR & value) strings.push_back("IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR"); @@ -834,6 +1451,8 @@ std::vector VkImageUsageFlagBitsGetStrings(VkImageUsageFlagBits va if (VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI & value) strings.push_back("IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI"); if (VK_IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM & value) strings.push_back("IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM"); if (VK_IMAGE_USAGE_SAMPLE_BLOCK_MATCH_BIT_QCOM & value) strings.push_back("IMAGE_USAGE_SAMPLE_BLOCK_MATCH_BIT_QCOM"); + if (VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR & value) strings.push_back("IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR"); + if (VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR & value) strings.push_back("IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR"); return strings; } void DumpVkImageUsageFlags(Printer &p, std::string name, VkImageUsageFlags value) { @@ -862,6 +1481,39 @@ void DumpVkImageUsageFlagBits(Printer &p, std::string name, VkImageUsageFlagBits } } +std::vector VkIndirectCommandsInputModeFlagBitsEXTGetStrings(VkIndirectCommandsInputModeFlagBitsEXT value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_INDIRECT_COMMANDS_INPUT_MODE_VULKAN_INDEX_BUFFER_EXT & value) strings.push_back("INDIRECT_COMMANDS_INPUT_MODE_VULKAN_INDEX_BUFFER_EXT"); + if (VK_INDIRECT_COMMANDS_INPUT_MODE_DXGI_INDEX_BUFFER_EXT & value) strings.push_back("INDIRECT_COMMANDS_INPUT_MODE_DXGI_INDEX_BUFFER_EXT"); + return strings; +} +void DumpVkIndirectCommandsInputModeFlagsEXT(Printer &p, std::string name, VkIndirectCommandsInputModeFlagsEXT value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkIndirectCommandsInputModeFlagBitsEXTGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkIndirectCommandsInputModeFlagBitsEXT(Printer &p, std::string name, VkIndirectCommandsInputModeFlagBitsEXT value) { + auto strings = VkIndirectCommandsInputModeFlagBitsEXTGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + std::vector VkMemoryHeapFlagBitsGetStrings(VkMemoryHeapFlagBits value) { std::vector strings; if (value == 0) { strings.push_back("None"); return strings; } @@ -1081,7 +1733,7 @@ std::string VkQueueFlagsString(VkQueueFlags value) { } std::vector VkResolveModeFlagBitsGetStrings(VkResolveModeFlagBits value) { std::vector strings; - if (VK_RESOLVE_MODE_NONE & value) strings.push_back("RESOLVE_MODE_NONE"); + if (value == 0) { strings.push_back("RESOLVE_MODE_NONE"); return strings; } if (VK_RESOLVE_MODE_SAMPLE_ZERO_BIT & value) strings.push_back("RESOLVE_MODE_SAMPLE_ZERO_BIT"); if (VK_RESOLVE_MODE_AVERAGE_BIT & value) strings.push_back("RESOLVE_MODE_AVERAGE_BIT"); if (VK_RESOLVE_MODE_MIN_BIT & value) strings.push_back("RESOLVE_MODE_MIN_BIT"); @@ -1174,14 +1826,746 @@ std::vector VkShaderStageFlagBitsGetStrings(VkShaderStageFlagBits if (VK_SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI & value) strings.push_back("SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI"); return strings; } -void DumpVkShaderStageFlags(Printer &p, std::string name, VkShaderStageFlags value) { - if (static_cast(value) == 0) { +void DumpVkShaderStageFlags(Printer &p, std::string name, VkShaderStageFlags value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkShaderStageFlagBitsGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkShaderStageFlagBits(Printer &p, std::string name, VkShaderStageFlagBits value) { + auto strings = VkShaderStageFlagBitsGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkSubgroupFeatureFlagBitsGetStrings(VkSubgroupFeatureFlagBits value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_SUBGROUP_FEATURE_BASIC_BIT & value) strings.push_back("SUBGROUP_FEATURE_BASIC_BIT"); + if (VK_SUBGROUP_FEATURE_VOTE_BIT & value) strings.push_back("SUBGROUP_FEATURE_VOTE_BIT"); + if (VK_SUBGROUP_FEATURE_ARITHMETIC_BIT & value) strings.push_back("SUBGROUP_FEATURE_ARITHMETIC_BIT"); + if (VK_SUBGROUP_FEATURE_BALLOT_BIT & value) strings.push_back("SUBGROUP_FEATURE_BALLOT_BIT"); + if (VK_SUBGROUP_FEATURE_SHUFFLE_BIT & value) strings.push_back("SUBGROUP_FEATURE_SHUFFLE_BIT"); + if (VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT & value) strings.push_back("SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT"); + if (VK_SUBGROUP_FEATURE_CLUSTERED_BIT & value) strings.push_back("SUBGROUP_FEATURE_CLUSTERED_BIT"); + if (VK_SUBGROUP_FEATURE_QUAD_BIT & value) strings.push_back("SUBGROUP_FEATURE_QUAD_BIT"); + if (VK_SUBGROUP_FEATURE_ROTATE_BIT & value) strings.push_back("SUBGROUP_FEATURE_ROTATE_BIT"); + if (VK_SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT & value) strings.push_back("SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT"); + if (VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV & value) strings.push_back("SUBGROUP_FEATURE_PARTITIONED_BIT_NV"); + return strings; +} +void DumpVkSubgroupFeatureFlags(Printer &p, std::string name, VkSubgroupFeatureFlags value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkSubgroupFeatureFlagBitsGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkSubgroupFeatureFlagBits(Printer &p, std::string name, VkSubgroupFeatureFlagBits value) { + auto strings = VkSubgroupFeatureFlagBitsGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkSurfaceCounterFlagBitsEXTGetStrings(VkSurfaceCounterFlagBitsEXT value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_SURFACE_COUNTER_VBLANK_BIT_EXT & value) strings.push_back("SURFACE_COUNTER_VBLANK_BIT_EXT"); + return strings; +} +void DumpVkSurfaceCounterFlagsEXT(Printer &p, std::string name, VkSurfaceCounterFlagsEXT value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkSurfaceCounterFlagBitsEXTGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkSurfaceCounterFlagBitsEXT(Printer &p, std::string name, VkSurfaceCounterFlagBitsEXT value) { + auto strings = VkSurfaceCounterFlagBitsEXTGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkSurfaceTransformFlagBitsKHRGetStrings(VkSurfaceTransformFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_IDENTITY_BIT_KHR"); + if (VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_ROTATE_90_BIT_KHR"); + if (VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_ROTATE_180_BIT_KHR"); + if (VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_ROTATE_270_BIT_KHR"); + if (VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR"); + if (VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR"); + if (VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR"); + if (VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR"); + if (VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_INHERIT_BIT_KHR"); + return strings; +} +void DumpVkSurfaceTransformFlagsKHR(Printer &p, std::string name, VkSurfaceTransformFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkSurfaceTransformFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkSurfaceTransformFlagBitsKHR(Printer &p, std::string name, VkSurfaceTransformFlagBitsKHR value) { + auto strings = VkSurfaceTransformFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkToolPurposeFlagBitsGetStrings(VkToolPurposeFlagBits value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_TOOL_PURPOSE_VALIDATION_BIT & value) strings.push_back("TOOL_PURPOSE_VALIDATION_BIT"); + if (VK_TOOL_PURPOSE_PROFILING_BIT & value) strings.push_back("TOOL_PURPOSE_PROFILING_BIT"); + if (VK_TOOL_PURPOSE_TRACING_BIT & value) strings.push_back("TOOL_PURPOSE_TRACING_BIT"); + if (VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT & value) strings.push_back("TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT"); + if (VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT & value) strings.push_back("TOOL_PURPOSE_MODIFYING_FEATURES_BIT"); + if (VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT & value) strings.push_back("TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT"); + if (VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT & value) strings.push_back("TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT"); + return strings; +} +void DumpVkToolPurposeFlags(Printer &p, std::string name, VkToolPurposeFlags value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkToolPurposeFlagBitsGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkToolPurposeFlagBits(Printer &p, std::string name, VkToolPurposeFlagBits value) { + auto strings = VkToolPurposeFlagBitsGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoCapabilityFlagBitsKHRGetStrings(VkVideoCapabilityFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR & value) strings.push_back("VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR"); + if (VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR & value) strings.push_back("VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR"); + return strings; +} +void DumpVkVideoCapabilityFlagsKHR(Printer &p, std::string name, VkVideoCapabilityFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoCapabilityFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoCapabilityFlagBitsKHR(Printer &p, std::string name, VkVideoCapabilityFlagBitsKHR value) { + auto strings = VkVideoCapabilityFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoChromaSubsamplingFlagBitsKHRGetStrings(VkVideoChromaSubsamplingFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("VIDEO_CHROMA_SUBSAMPLING_INVALID_KHR"); return strings; } + if (VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR & value) strings.push_back("VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR"); + if (VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR & value) strings.push_back("VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR"); + if (VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR & value) strings.push_back("VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR"); + if (VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR & value) strings.push_back("VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR"); + return strings; +} +void DumpVkVideoChromaSubsamplingFlagsKHR(Printer &p, std::string name, VkVideoChromaSubsamplingFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoChromaSubsamplingFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoChromaSubsamplingFlagBitsKHR(Printer &p, std::string name, VkVideoChromaSubsamplingFlagBitsKHR value) { + auto strings = VkVideoChromaSubsamplingFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoCodecOperationFlagBitsKHRGetStrings(VkVideoCodecOperationFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("VIDEO_CODEC_OPERATION_NONE_KHR"); return strings; } + if (VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR & value) strings.push_back("VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR"); + if (VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR & value) strings.push_back("VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR"); + if (VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR & value) strings.push_back("VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR"); + if (VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR & value) strings.push_back("VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR"); + if (VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR & value) strings.push_back("VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR"); + if (VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR & value) strings.push_back("VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR"); + return strings; +} +void DumpVkVideoCodecOperationFlagsKHR(Printer &p, std::string name, VkVideoCodecOperationFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoCodecOperationFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoCodecOperationFlagBitsKHR(Printer &p, std::string name, VkVideoCodecOperationFlagBitsKHR value) { + auto strings = VkVideoCodecOperationFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoComponentBitDepthFlagBitsKHRGetStrings(VkVideoComponentBitDepthFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR"); return strings; } + if (VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR & value) strings.push_back("VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR"); + if (VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR & value) strings.push_back("VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR"); + if (VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR & value) strings.push_back("VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR"); + return strings; +} +void DumpVkVideoComponentBitDepthFlagsKHR(Printer &p, std::string name, VkVideoComponentBitDepthFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoComponentBitDepthFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoComponentBitDepthFlagBitsKHR(Printer &p, std::string name, VkVideoComponentBitDepthFlagBitsKHR value) { + auto strings = VkVideoComponentBitDepthFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoDecodeCapabilityFlagBitsKHRGetStrings(VkVideoDecodeCapabilityFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR & value) strings.push_back("VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR"); + if (VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR & value) strings.push_back("VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR"); + return strings; +} +void DumpVkVideoDecodeCapabilityFlagsKHR(Printer &p, std::string name, VkVideoDecodeCapabilityFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoDecodeCapabilityFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoDecodeCapabilityFlagBitsKHR(Printer &p, std::string name, VkVideoDecodeCapabilityFlagBitsKHR value) { + auto strings = VkVideoDecodeCapabilityFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoDecodeH264PictureLayoutFlagBitsKHRGetStrings(VkVideoDecodeH264PictureLayoutFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR"); return strings; } + if (VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR & value) strings.push_back("VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR"); + if (VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR & value) strings.push_back("VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR"); + return strings; +} +void DumpVkVideoDecodeH264PictureLayoutFlagsKHR(Printer &p, std::string name, VkVideoDecodeH264PictureLayoutFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoDecodeH264PictureLayoutFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoDecodeH264PictureLayoutFlagBitsKHR(Printer &p, std::string name, VkVideoDecodeH264PictureLayoutFlagBitsKHR value) { + auto strings = VkVideoDecodeH264PictureLayoutFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoDecodeUsageFlagBitsKHRGetStrings(VkVideoDecodeUsageFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("VIDEO_DECODE_USAGE_DEFAULT_KHR"); return strings; } + if (VK_VIDEO_DECODE_USAGE_TRANSCODING_BIT_KHR & value) strings.push_back("VIDEO_DECODE_USAGE_TRANSCODING_BIT_KHR"); + if (VK_VIDEO_DECODE_USAGE_OFFLINE_BIT_KHR & value) strings.push_back("VIDEO_DECODE_USAGE_OFFLINE_BIT_KHR"); + if (VK_VIDEO_DECODE_USAGE_STREAMING_BIT_KHR & value) strings.push_back("VIDEO_DECODE_USAGE_STREAMING_BIT_KHR"); + return strings; +} +void DumpVkVideoDecodeUsageFlagsKHR(Printer &p, std::string name, VkVideoDecodeUsageFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoDecodeUsageFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoDecodeUsageFlagBitsKHR(Printer &p, std::string name, VkVideoDecodeUsageFlagBitsKHR value) { + auto strings = VkVideoDecodeUsageFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoEncodeAV1CapabilityFlagBitsKHRGetStrings(VkVideoEncodeAV1CapabilityFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_VIDEO_ENCODE_AV1_CAPABILITY_PER_RATE_CONTROL_GROUP_MIN_MAX_Q_INDEX_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_AV1_CAPABILITY_PER_RATE_CONTROL_GROUP_MIN_MAX_Q_INDEX_BIT_KHR"); + if (VK_VIDEO_ENCODE_AV1_CAPABILITY_GENERATE_OBU_EXTENSION_HEADER_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_AV1_CAPABILITY_GENERATE_OBU_EXTENSION_HEADER_BIT_KHR"); + if (VK_VIDEO_ENCODE_AV1_CAPABILITY_PRIMARY_REFERENCE_CDF_ONLY_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_AV1_CAPABILITY_PRIMARY_REFERENCE_CDF_ONLY_BIT_KHR"); + if (VK_VIDEO_ENCODE_AV1_CAPABILITY_FRAME_SIZE_OVERRIDE_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_AV1_CAPABILITY_FRAME_SIZE_OVERRIDE_BIT_KHR"); + if (VK_VIDEO_ENCODE_AV1_CAPABILITY_MOTION_VECTOR_SCALING_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_AV1_CAPABILITY_MOTION_VECTOR_SCALING_BIT_KHR"); + return strings; +} +void DumpVkVideoEncodeAV1CapabilityFlagsKHR(Printer &p, std::string name, VkVideoEncodeAV1CapabilityFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoEncodeAV1CapabilityFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoEncodeAV1CapabilityFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeAV1CapabilityFlagBitsKHR value) { + auto strings = VkVideoEncodeAV1CapabilityFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoEncodeAV1StdFlagBitsKHRGetStrings(VkVideoEncodeAV1StdFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_VIDEO_ENCODE_AV1_STD_UNIFORM_TILE_SPACING_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_AV1_STD_UNIFORM_TILE_SPACING_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_AV1_STD_SKIP_MODE_PRESENT_UNSET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_AV1_STD_SKIP_MODE_PRESENT_UNSET_BIT_KHR"); + if (VK_VIDEO_ENCODE_AV1_STD_PRIMARY_REF_FRAME_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_AV1_STD_PRIMARY_REF_FRAME_BIT_KHR"); + if (VK_VIDEO_ENCODE_AV1_STD_DELTA_Q_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_AV1_STD_DELTA_Q_BIT_KHR"); + return strings; +} +void DumpVkVideoEncodeAV1StdFlagsKHR(Printer &p, std::string name, VkVideoEncodeAV1StdFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoEncodeAV1StdFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoEncodeAV1StdFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeAV1StdFlagBitsKHR value) { + auto strings = VkVideoEncodeAV1StdFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoEncodeAV1SuperblockSizeFlagBitsKHRGetStrings(VkVideoEncodeAV1SuperblockSizeFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR"); + if (VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_128_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_128_BIT_KHR"); + return strings; +} +void DumpVkVideoEncodeAV1SuperblockSizeFlagsKHR(Printer &p, std::string name, VkVideoEncodeAV1SuperblockSizeFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoEncodeAV1SuperblockSizeFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoEncodeAV1SuperblockSizeFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeAV1SuperblockSizeFlagBitsKHR value) { + auto strings = VkVideoEncodeAV1SuperblockSizeFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoEncodeCapabilityFlagBitsKHRGetStrings(VkVideoEncodeCapabilityFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR"); + if (VK_VIDEO_ENCODE_CAPABILITY_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_DETECTION_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_CAPABILITY_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_DETECTION_BIT_KHR"); + if (VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR"); + if (VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR"); + return strings; +} +void DumpVkVideoEncodeCapabilityFlagsKHR(Printer &p, std::string name, VkVideoEncodeCapabilityFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoEncodeCapabilityFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoEncodeCapabilityFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeCapabilityFlagBitsKHR value) { + auto strings = VkVideoEncodeCapabilityFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoEncodeContentFlagBitsKHRGetStrings(VkVideoEncodeContentFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("VIDEO_ENCODE_CONTENT_DEFAULT_KHR"); return strings; } + if (VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR"); + if (VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR"); + if (VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR"); + return strings; +} +void DumpVkVideoEncodeContentFlagsKHR(Printer &p, std::string name, VkVideoEncodeContentFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoEncodeContentFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoEncodeContentFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeContentFlagBitsKHR value) { + auto strings = VkVideoEncodeContentFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoEncodeFeedbackFlagBitsKHRGetStrings(VkVideoEncodeFeedbackFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR"); + if (VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR"); + if (VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR"); + return strings; +} +void DumpVkVideoEncodeFeedbackFlagsKHR(Printer &p, std::string name, VkVideoEncodeFeedbackFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoEncodeFeedbackFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoEncodeFeedbackFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeFeedbackFlagBitsKHR value) { + auto strings = VkVideoEncodeFeedbackFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoEncodeH264CapabilityFlagBitsKHRGetStrings(VkVideoEncodeH264CapabilityFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_VIDEO_ENCODE_H264_CAPABILITY_HRD_COMPLIANCE_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_CAPABILITY_HRD_COMPLIANCE_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_CAPABILITY_PER_SLICE_CONSTANT_QP_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_CAPABILITY_PER_SLICE_CONSTANT_QP_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_CAPABILITY_GENERATE_PREFIX_NALU_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_CAPABILITY_GENERATE_PREFIX_NALU_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_CAPABILITY_MB_QP_DIFF_WRAPAROUND_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_CAPABILITY_MB_QP_DIFF_WRAPAROUND_BIT_KHR"); + return strings; +} +void DumpVkVideoEncodeH264CapabilityFlagsKHR(Printer &p, std::string name, VkVideoEncodeH264CapabilityFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoEncodeH264CapabilityFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoEncodeH264CapabilityFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeH264CapabilityFlagBitsKHR value) { + auto strings = VkVideoEncodeH264CapabilityFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoEncodeH264StdFlagBitsKHRGetStrings(VkVideoEncodeH264StdFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_VIDEO_ENCODE_H264_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_QPPRIME_Y_ZERO_TRANSFORM_BYPASS_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_QPPRIME_Y_ZERO_TRANSFORM_BYPASS_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_SCALING_MATRIX_PRESENT_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_SCALING_MATRIX_PRESENT_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_CHROMA_QP_INDEX_OFFSET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_CHROMA_QP_INDEX_OFFSET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_SECOND_CHROMA_QP_INDEX_OFFSET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_SECOND_CHROMA_QP_INDEX_OFFSET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_PIC_INIT_QP_MINUS26_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_PIC_INIT_QP_MINUS26_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_WEIGHTED_BIPRED_IDC_EXPLICIT_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_WEIGHTED_BIPRED_IDC_EXPLICIT_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_WEIGHTED_BIPRED_IDC_IMPLICIT_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_WEIGHTED_BIPRED_IDC_IMPLICIT_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_TRANSFORM_8X8_MODE_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_TRANSFORM_8X8_MODE_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_DIRECT_SPATIAL_MV_PRED_FLAG_UNSET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_DIRECT_SPATIAL_MV_PRED_FLAG_UNSET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_ENTROPY_CODING_MODE_FLAG_UNSET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_ENTROPY_CODING_MODE_FLAG_UNSET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_ENTROPY_CODING_MODE_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_ENTROPY_CODING_MODE_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_DIRECT_8X8_INFERENCE_FLAG_UNSET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_DIRECT_8X8_INFERENCE_FLAG_UNSET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_DISABLED_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_DISABLED_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_ENABLED_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_ENABLED_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_PARTIAL_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_PARTIAL_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_SLICE_QP_DELTA_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_SLICE_QP_DELTA_BIT_KHR"); + if (VK_VIDEO_ENCODE_H264_STD_DIFFERENT_SLICE_QP_DELTA_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H264_STD_DIFFERENT_SLICE_QP_DELTA_BIT_KHR"); + return strings; +} +void DumpVkVideoEncodeH264StdFlagsKHR(Printer &p, std::string name, VkVideoEncodeH264StdFlagsKHR value) { + if (static_cast(value) == 0) { + ArrayWrapper arr(p, name, 0); + if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) + p.SetAsType().PrintString("None"); + return; + } + auto strings = VkVideoEncodeH264StdFlagBitsKHRGetStrings(static_cast(value)); + ArrayWrapper arr(p, name, strings.size()); + for(auto& str : strings){ + if (p.Type() == OutputType::json) + p.SetAsType().PrintString(std::string("VK_") + str); + else + p.SetAsType().PrintString(str); + } +} +void DumpVkVideoEncodeH264StdFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeH264StdFlagBitsKHR value) { + auto strings = VkVideoEncodeH264StdFlagBitsKHRGetStrings(value); + if (strings.size() > 0) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + } +} + +std::vector VkVideoEncodeH265CapabilityFlagBitsKHRGetStrings(VkVideoEncodeH265CapabilityFlagBitsKHR value) { + std::vector strings; + if (value == 0) { strings.push_back("None"); return strings; } + if (VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_SEGMENT_TYPE_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_SEGMENT_TYPE_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CAPABILITY_PER_SLICE_SEGMENT_CONSTANT_QP_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CAPABILITY_PER_SLICE_SEGMENT_CONSTANT_QP_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILES_PER_SLICE_SEGMENT_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILES_PER_SLICE_SEGMENT_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_SEGMENTS_PER_TILE_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_SEGMENTS_PER_TILE_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CAPABILITY_CU_QP_DIFF_WRAPAROUND_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CAPABILITY_CU_QP_DIFF_WRAPAROUND_BIT_KHR"); + return strings; +} +void DumpVkVideoEncodeH265CapabilityFlagsKHR(Printer &p, std::string name, VkVideoEncodeH265CapabilityFlagsKHR value) { + if (static_cast(value) == 0) { ArrayWrapper arr(p, name, 0); if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) p.SetAsType().PrintString("None"); return; } - auto strings = VkShaderStageFlagBitsGetStrings(static_cast(value)); + auto strings = VkVideoEncodeH265CapabilityFlagBitsKHRGetStrings(static_cast(value)); ArrayWrapper arr(p, name, strings.size()); for(auto& str : strings){ if (p.Type() == OutputType::json) @@ -1190,8 +2574,8 @@ void DumpVkShaderStageFlags(Printer &p, std::string name, VkShaderStageFlags val p.SetAsType().PrintString(str); } } -void DumpVkShaderStageFlagBits(Printer &p, std::string name, VkShaderStageFlagBits value) { - auto strings = VkShaderStageFlagBitsGetStrings(value); +void DumpVkVideoEncodeH265CapabilityFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeH265CapabilityFlagBitsKHR value) { + auto strings = VkVideoEncodeH265CapabilityFlagBitsKHRGetStrings(value); if (strings.size() > 0) { if (p.Type() == OutputType::json) p.PrintKeyString(name, std::string("VK_") + strings.at(0)); @@ -1200,30 +2584,22 @@ void DumpVkShaderStageFlagBits(Printer &p, std::string name, VkShaderStageFlagBi } } -std::vector VkSubgroupFeatureFlagBitsGetStrings(VkSubgroupFeatureFlagBits value) { +std::vector VkVideoEncodeH265CtbSizeFlagBitsKHRGetStrings(VkVideoEncodeH265CtbSizeFlagBitsKHR value) { std::vector strings; if (value == 0) { strings.push_back("None"); return strings; } - if (VK_SUBGROUP_FEATURE_BASIC_BIT & value) strings.push_back("SUBGROUP_FEATURE_BASIC_BIT"); - if (VK_SUBGROUP_FEATURE_VOTE_BIT & value) strings.push_back("SUBGROUP_FEATURE_VOTE_BIT"); - if (VK_SUBGROUP_FEATURE_ARITHMETIC_BIT & value) strings.push_back("SUBGROUP_FEATURE_ARITHMETIC_BIT"); - if (VK_SUBGROUP_FEATURE_BALLOT_BIT & value) strings.push_back("SUBGROUP_FEATURE_BALLOT_BIT"); - if (VK_SUBGROUP_FEATURE_SHUFFLE_BIT & value) strings.push_back("SUBGROUP_FEATURE_SHUFFLE_BIT"); - if (VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT & value) strings.push_back("SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT"); - if (VK_SUBGROUP_FEATURE_CLUSTERED_BIT & value) strings.push_back("SUBGROUP_FEATURE_CLUSTERED_BIT"); - if (VK_SUBGROUP_FEATURE_QUAD_BIT & value) strings.push_back("SUBGROUP_FEATURE_QUAD_BIT"); - if (VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV & value) strings.push_back("SUBGROUP_FEATURE_PARTITIONED_BIT_NV"); - if (VK_SUBGROUP_FEATURE_ROTATE_BIT_KHR & value) strings.push_back("SUBGROUP_FEATURE_ROTATE_BIT_KHR"); - if (VK_SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT_KHR & value) strings.push_back("SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR"); return strings; } -void DumpVkSubgroupFeatureFlags(Printer &p, std::string name, VkSubgroupFeatureFlags value) { - if (static_cast(value) == 0) { +void DumpVkVideoEncodeH265CtbSizeFlagsKHR(Printer &p, std::string name, VkVideoEncodeH265CtbSizeFlagsKHR value) { + if (static_cast(value) == 0) { ArrayWrapper arr(p, name, 0); if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) p.SetAsType().PrintString("None"); return; } - auto strings = VkSubgroupFeatureFlagBitsGetStrings(static_cast(value)); + auto strings = VkVideoEncodeH265CtbSizeFlagBitsKHRGetStrings(static_cast(value)); ArrayWrapper arr(p, name, strings.size()); for(auto& str : strings){ if (p.Type() == OutputType::json) @@ -1232,8 +2608,8 @@ void DumpVkSubgroupFeatureFlags(Printer &p, std::string name, VkSubgroupFeatureF p.SetAsType().PrintString(str); } } -void DumpVkSubgroupFeatureFlagBits(Printer &p, std::string name, VkSubgroupFeatureFlagBits value) { - auto strings = VkSubgroupFeatureFlagBitsGetStrings(value); +void DumpVkVideoEncodeH265CtbSizeFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeH265CtbSizeFlagBitsKHR value) { + auto strings = VkVideoEncodeH265CtbSizeFlagBitsKHRGetStrings(value); if (strings.size() > 0) { if (p.Type() == OutputType::json) p.PrintKeyString(name, std::string("VK_") + strings.at(0)); @@ -1242,20 +2618,40 @@ void DumpVkSubgroupFeatureFlagBits(Printer &p, std::string name, VkSubgroupFeatu } } -std::vector VkSurfaceCounterFlagBitsEXTGetStrings(VkSurfaceCounterFlagBitsEXT value) { +std::vector VkVideoEncodeH265StdFlagBitsKHRGetStrings(VkVideoEncodeH265StdFlagBitsKHR value) { std::vector strings; if (value == 0) { strings.push_back("None"); return strings; } - if (VK_SURFACE_COUNTER_VBLANK_BIT_EXT & value) strings.push_back("SURFACE_COUNTER_VBLANK_BIT_EXT"); + if (VK_VIDEO_ENCODE_H265_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_SAMPLE_ADAPTIVE_OFFSET_ENABLED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_SAMPLE_ADAPTIVE_OFFSET_ENABLED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_SCALING_LIST_DATA_PRESENT_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_SCALING_LIST_DATA_PRESENT_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_PCM_ENABLED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_PCM_ENABLED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_SPS_TEMPORAL_MVP_ENABLED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_SPS_TEMPORAL_MVP_ENABLED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_INIT_QP_MINUS26_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_INIT_QP_MINUS26_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_WEIGHTED_BIPRED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_WEIGHTED_BIPRED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_SIGN_DATA_HIDING_ENABLED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_SIGN_DATA_HIDING_ENABLED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_UNSET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_UNSET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_TRANSQUANT_BYPASS_ENABLED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_TRANSQUANT_BYPASS_ENABLED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_ENTROPY_CODING_SYNC_ENABLED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_ENTROPY_CODING_SYNC_ENABLED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_DEBLOCKING_FILTER_OVERRIDE_ENABLED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_DEBLOCKING_FILTER_OVERRIDE_ENABLED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENTS_ENABLED_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENTS_ENABLED_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENT_FLAG_SET_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENT_FLAG_SET_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_SLICE_QP_DELTA_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_SLICE_QP_DELTA_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_STD_DIFFERENT_SLICE_QP_DELTA_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_STD_DIFFERENT_SLICE_QP_DELTA_BIT_KHR"); return strings; } -void DumpVkSurfaceCounterFlagsEXT(Printer &p, std::string name, VkSurfaceCounterFlagsEXT value) { - if (static_cast(value) == 0) { +void DumpVkVideoEncodeH265StdFlagsKHR(Printer &p, std::string name, VkVideoEncodeH265StdFlagsKHR value) { + if (static_cast(value) == 0) { ArrayWrapper arr(p, name, 0); if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) p.SetAsType().PrintString("None"); return; } - auto strings = VkSurfaceCounterFlagBitsEXTGetStrings(static_cast(value)); + auto strings = VkVideoEncodeH265StdFlagBitsKHRGetStrings(static_cast(value)); ArrayWrapper arr(p, name, strings.size()); for(auto& str : strings){ if (p.Type() == OutputType::json) @@ -1264,8 +2660,8 @@ void DumpVkSurfaceCounterFlagsEXT(Printer &p, std::string name, VkSurfaceCounter p.SetAsType().PrintString(str); } } -void DumpVkSurfaceCounterFlagBitsEXT(Printer &p, std::string name, VkSurfaceCounterFlagBitsEXT value) { - auto strings = VkSurfaceCounterFlagBitsEXTGetStrings(value); +void DumpVkVideoEncodeH265StdFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeH265StdFlagBitsKHR value) { + auto strings = VkVideoEncodeH265StdFlagBitsKHRGetStrings(value); if (strings.size() > 0) { if (p.Type() == OutputType::json) p.PrintKeyString(name, std::string("VK_") + strings.at(0)); @@ -1274,28 +2670,23 @@ void DumpVkSurfaceCounterFlagBitsEXT(Printer &p, std::string name, VkSurfaceCoun } } -std::vector VkSurfaceTransformFlagBitsKHRGetStrings(VkSurfaceTransformFlagBitsKHR value) { +std::vector VkVideoEncodeH265TransformBlockSizeFlagBitsKHRGetStrings(VkVideoEncodeH265TransformBlockSizeFlagBitsKHR value) { std::vector strings; if (value == 0) { strings.push_back("None"); return strings; } - if (VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_IDENTITY_BIT_KHR"); - if (VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_ROTATE_90_BIT_KHR"); - if (VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_ROTATE_180_BIT_KHR"); - if (VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_ROTATE_270_BIT_KHR"); - if (VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR"); - if (VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR"); - if (VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR"); - if (VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR"); - if (VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR & value) strings.push_back("SURFACE_TRANSFORM_INHERIT_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_KHR"); + if (VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_KHR"); return strings; } -void DumpVkSurfaceTransformFlagsKHR(Printer &p, std::string name, VkSurfaceTransformFlagsKHR value) { - if (static_cast(value) == 0) { +void DumpVkVideoEncodeH265TransformBlockSizeFlagsKHR(Printer &p, std::string name, VkVideoEncodeH265TransformBlockSizeFlagsKHR value) { + if (static_cast(value) == 0) { ArrayWrapper arr(p, name, 0); if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) p.SetAsType().PrintString("None"); return; } - auto strings = VkSurfaceTransformFlagBitsKHRGetStrings(static_cast(value)); + auto strings = VkVideoEncodeH265TransformBlockSizeFlagBitsKHRGetStrings(static_cast(value)); ArrayWrapper arr(p, name, strings.size()); for(auto& str : strings){ if (p.Type() == OutputType::json) @@ -1304,8 +2695,8 @@ void DumpVkSurfaceTransformFlagsKHR(Printer &p, std::string name, VkSurfaceTrans p.SetAsType().PrintString(str); } } -void DumpVkSurfaceTransformFlagBitsKHR(Printer &p, std::string name, VkSurfaceTransformFlagBitsKHR value) { - auto strings = VkSurfaceTransformFlagBitsKHRGetStrings(value); +void DumpVkVideoEncodeH265TransformBlockSizeFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeH265TransformBlockSizeFlagBitsKHR value) { + auto strings = VkVideoEncodeH265TransformBlockSizeFlagBitsKHRGetStrings(value); if (strings.size() > 0) { if (p.Type() == OutputType::json) p.PrintKeyString(name, std::string("VK_") + strings.at(0)); @@ -1314,26 +2705,22 @@ void DumpVkSurfaceTransformFlagBitsKHR(Printer &p, std::string name, VkSurfaceTr } } -std::vector VkToolPurposeFlagBitsGetStrings(VkToolPurposeFlagBits value) { +std::vector VkVideoEncodeRateControlModeFlagBitsKHRGetStrings(VkVideoEncodeRateControlModeFlagBitsKHR value) { std::vector strings; - if (value == 0) { strings.push_back("None"); return strings; } - if (VK_TOOL_PURPOSE_VALIDATION_BIT & value) strings.push_back("TOOL_PURPOSE_VALIDATION_BIT"); - if (VK_TOOL_PURPOSE_PROFILING_BIT & value) strings.push_back("TOOL_PURPOSE_PROFILING_BIT"); - if (VK_TOOL_PURPOSE_TRACING_BIT & value) strings.push_back("TOOL_PURPOSE_TRACING_BIT"); - if (VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT & value) strings.push_back("TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT"); - if (VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT & value) strings.push_back("TOOL_PURPOSE_MODIFYING_FEATURES_BIT"); - if (VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT & value) strings.push_back("TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT"); - if (VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT & value) strings.push_back("TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT"); + if (value == 0) { strings.push_back("VIDEO_ENCODE_RATE_CONTROL_MODE_DEFAULT_KHR"); return strings; } + if (VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR"); + if (VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR"); + if (VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR"); return strings; } -void DumpVkToolPurposeFlags(Printer &p, std::string name, VkToolPurposeFlags value) { - if (static_cast(value) == 0) { +void DumpVkVideoEncodeRateControlModeFlagsKHR(Printer &p, std::string name, VkVideoEncodeRateControlModeFlagsKHR value) { + if (static_cast(value) == 0) { ArrayWrapper arr(p, name, 0); if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) p.SetAsType().PrintString("None"); return; } - auto strings = VkToolPurposeFlagBitsGetStrings(static_cast(value)); + auto strings = VkVideoEncodeRateControlModeFlagBitsKHRGetStrings(static_cast(value)); ArrayWrapper arr(p, name, strings.size()); for(auto& str : strings){ if (p.Type() == OutputType::json) @@ -1342,8 +2729,8 @@ void DumpVkToolPurposeFlags(Printer &p, std::string name, VkToolPurposeFlags val p.SetAsType().PrintString(str); } } -void DumpVkToolPurposeFlagBits(Printer &p, std::string name, VkToolPurposeFlagBits value) { - auto strings = VkToolPurposeFlagBitsGetStrings(value); +void DumpVkVideoEncodeRateControlModeFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeRateControlModeFlagBitsKHR value) { + auto strings = VkVideoEncodeRateControlModeFlagBitsKHRGetStrings(value); if (strings.size() > 0) { if (p.Type() == OutputType::json) p.PrintKeyString(name, std::string("VK_") + strings.at(0)); @@ -1352,24 +2739,23 @@ void DumpVkToolPurposeFlagBits(Printer &p, std::string name, VkToolPurposeFlagBi } } -std::vector VkVideoCodecOperationFlagBitsKHRGetStrings(VkVideoCodecOperationFlagBitsKHR value) { +std::vector VkVideoEncodeUsageFlagBitsKHRGetStrings(VkVideoEncodeUsageFlagBitsKHR value) { std::vector strings; - if (VK_VIDEO_CODEC_OPERATION_NONE_KHR & value) strings.push_back("VIDEO_CODEC_OPERATION_NONE_KHR"); - if (VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR & value) strings.push_back("VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR"); - if (VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR & value) strings.push_back("VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR"); - if (VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR & value) strings.push_back("VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR"); - if (VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR & value) strings.push_back("VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR"); - if (VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR & value) strings.push_back("VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR"); + if (value == 0) { strings.push_back("VIDEO_ENCODE_USAGE_DEFAULT_KHR"); return strings; } + if (VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR"); + if (VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR"); + if (VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR"); + if (VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR & value) strings.push_back("VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR"); return strings; } -void DumpVkVideoCodecOperationFlagsKHR(Printer &p, std::string name, VkVideoCodecOperationFlagsKHR value) { - if (static_cast(value) == 0) { +void DumpVkVideoEncodeUsageFlagsKHR(Printer &p, std::string name, VkVideoEncodeUsageFlagsKHR value) { + if (static_cast(value) == 0) { ArrayWrapper arr(p, name, 0); if (p.Type() != OutputType::json && p.Type() != OutputType::vkconfig_output) p.SetAsType().PrintString("None"); return; } - auto strings = VkVideoCodecOperationFlagBitsKHRGetStrings(static_cast(value)); + auto strings = VkVideoEncodeUsageFlagBitsKHRGetStrings(static_cast(value)); ArrayWrapper arr(p, name, strings.size()); for(auto& str : strings){ if (p.Type() == OutputType::json) @@ -1378,8 +2764,8 @@ void DumpVkVideoCodecOperationFlagsKHR(Printer &p, std::string name, VkVideoCode p.SetAsType().PrintString(str); } } -void DumpVkVideoCodecOperationFlagBitsKHR(Printer &p, std::string name, VkVideoCodecOperationFlagBitsKHR value) { - auto strings = VkVideoCodecOperationFlagBitsKHRGetStrings(value); +void DumpVkVideoEncodeUsageFlagBitsKHR(Printer &p, std::string name, VkVideoEncodeUsageFlagBitsKHR value) { + auto strings = VkVideoEncodeUsageFlagBitsKHRGetStrings(value); if (strings.size() > 0) { if (p.Type() == OutputType::json) p.PrintKeyString(name, std::string("VK_") + strings.at(0)); @@ -1388,6 +2774,13 @@ void DumpVkVideoCodecOperationFlagBitsKHR(Printer &p, std::string name, VkVideoC } } +void DumpVkComponentMapping(Printer &p, std::string name, const VkComponentMapping &obj) { + ObjectWrapper object{p, name}; + DumpVkComponentSwizzle(p, "r", obj.r); + DumpVkComponentSwizzle(p, "g", obj.g); + DumpVkComponentSwizzle(p, "b", obj.b); + DumpVkComponentSwizzle(p, "a", obj.a); +} void DumpVkConformanceVersion(Printer &p, std::string name, const VkConformanceVersion &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(8); @@ -1404,6 +2797,12 @@ void DumpVkDrmFormatModifierProperties2EXT(Printer &p, std::string name, const V p.SetOpenDetails(); DumpVkFormatFeatureFlags2(p, "drmFormatModifierTilingFeatures", obj.drmFormatModifierTilingFeatures); } +void DumpVkExtensionProperties(Printer &p, std::string name, const VkExtensionProperties &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(18); + p.PrintKeyString("extensionName", obj.extensionName); + p.PrintKeyValue("specVersion", obj.specVersion); +} void DumpVkExtent2D(Printer &p, std::string name, const VkExtent2D &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(6); @@ -1443,6 +2842,12 @@ void DumpVkLayerProperties(Printer &p, std::string name, const VkLayerProperties p.PrintKeyValue("implementationVersion", obj.implementationVersion); p.PrintKeyString("description", obj.description); } +void DumpVkOffset2D(Printer &p, std::string name, const VkOffset2D &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(1); + p.PrintKeyValue("x", obj.x); + p.PrintKeyValue("y", obj.y); +} void DumpVkPhysicalDevice16BitStorageFeatures(Printer &p, std::string name, const VkPhysicalDevice16BitStorageFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(34); @@ -1545,6 +2950,17 @@ void DumpVkPhysicalDeviceColorWriteEnableFeaturesEXT(Printer &p, std::string nam p.SetMinKeyWidth(16); p.PrintKeyBool("colorWriteEnable", static_cast(obj.colorWriteEnable)); } +void DumpVkPhysicalDeviceComputeShaderDerivativesFeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(28); + p.PrintKeyBool("computeDerivativeGroupQuads", static_cast(obj.computeDerivativeGroupQuads)); + p.PrintKeyBool("computeDerivativeGroupLinear", static_cast(obj.computeDerivativeGroupLinear)); +} +void DumpVkPhysicalDeviceComputeShaderDerivativesPropertiesKHR(Printer &p, std::string name, const VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(28); + p.PrintKeyBool("meshAndTaskShaderDerivatives", static_cast(obj.meshAndTaskShaderDerivatives)); +} void DumpVkPhysicalDeviceConditionalRenderingFeaturesEXT(Printer &p, std::string name, const VkPhysicalDeviceConditionalRenderingFeaturesEXT &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(29); @@ -1593,7 +3009,12 @@ void DumpVkPhysicalDeviceDepthBiasControlFeaturesEXT(Printer &p, std::string nam p.PrintKeyBool("floatRepresentation", static_cast(obj.floatRepresentation)); p.PrintKeyBool("depthBiasExact", static_cast(obj.depthBiasExact)); } -void DumpVkPhysicalDeviceDepthClampZeroOneFeaturesEXT(Printer &p, std::string name, const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT &obj) { +void DumpVkPhysicalDeviceDepthClampControlFeaturesEXT(Printer &p, std::string name, const VkPhysicalDeviceDepthClampControlFeaturesEXT &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(17); + p.PrintKeyBool("depthClampControl", static_cast(obj.depthClampControl)); +} +void DumpVkPhysicalDeviceDepthClampZeroOneFeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceDepthClampZeroOneFeaturesKHR &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(17); p.PrintKeyBool("depthClampZeroOne", static_cast(obj.depthClampZeroOne)); @@ -1717,6 +3138,28 @@ void DumpVkPhysicalDeviceDescriptorIndexingProperties(Printer &p, std::string na p.PrintKeyValue("maxDescriptorSetUpdateAfterBindStorageImages", obj.maxDescriptorSetUpdateAfterBindStorageImages); p.PrintKeyValue("maxDescriptorSetUpdateAfterBindInputAttachments", obj.maxDescriptorSetUpdateAfterBindInputAttachments); } +void DumpVkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT(Printer &p, std::string name, const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(30); + p.PrintKeyBool("deviceGeneratedCommands", static_cast(obj.deviceGeneratedCommands)); + p.PrintKeyBool("dynamicGeneratedPipelineLayout", static_cast(obj.dynamicGeneratedPipelineLayout)); +} +void DumpVkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT(Printer &p, std::string name, const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(45); + p.PrintKeyValue("maxIndirectPipelineCount", obj.maxIndirectPipelineCount); + p.PrintKeyValue("maxIndirectShaderObjectCount", obj.maxIndirectShaderObjectCount); + p.PrintKeyValue("maxIndirectSequenceCount", obj.maxIndirectSequenceCount); + p.PrintKeyValue("maxIndirectCommandsTokenCount", obj.maxIndirectCommandsTokenCount); + p.PrintKeyValue("maxIndirectCommandsTokenOffset", obj.maxIndirectCommandsTokenOffset); + p.PrintKeyValue("maxIndirectCommandsIndirectStride", obj.maxIndirectCommandsIndirectStride); + DumpVkIndirectCommandsInputModeFlagsEXT(p, "supportedIndirectCommandsInputModes", obj.supportedIndirectCommandsInputModes); + DumpVkShaderStageFlags(p, "supportedIndirectCommandsShaderStages", obj.supportedIndirectCommandsShaderStages); + DumpVkShaderStageFlags(p, "supportedIndirectCommandsShaderStagesPipelineBinding", obj.supportedIndirectCommandsShaderStagesPipelineBinding); + DumpVkShaderStageFlags(p, "supportedIndirectCommandsShaderStagesShaderBinding", obj.supportedIndirectCommandsShaderStagesShaderBinding); + p.PrintKeyBool("deviceGeneratedCommandsTransformFeedback", static_cast(obj.deviceGeneratedCommandsTransformFeedback)); + p.PrintKeyBool("deviceGeneratedCommandsMultiDrawIndirectCount", static_cast(obj.deviceGeneratedCommandsMultiDrawIndirectCount)); +} void DumpVkPhysicalDeviceDeviceMemoryReportFeaturesEXT(Printer &p, std::string name, const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(18); @@ -1750,7 +3193,7 @@ void DumpVkPhysicalDeviceDynamicRenderingFeatures(Printer &p, std::string name, p.SetMinKeyWidth(16); p.PrintKeyBool("dynamicRendering", static_cast(obj.dynamicRendering)); } -void DumpVkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR &obj) { +void DumpVkPhysicalDeviceDynamicRenderingLocalReadFeatures(Printer &p, std::string name, const VkPhysicalDeviceDynamicRenderingLocalReadFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(25); p.PrintKeyBool("dynamicRenderingLocalRead", static_cast(obj.dynamicRenderingLocalRead)); @@ -1980,7 +3423,7 @@ void DumpVkPhysicalDeviceFrameBoundaryFeaturesEXT(Printer &p, std::string name, p.SetMinKeyWidth(13); p.PrintKeyBool("frameBoundary", static_cast(obj.frameBoundary)); } -void DumpVkPhysicalDeviceGlobalPriorityQueryFeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR &obj) { +void DumpVkPhysicalDeviceGlobalPriorityQueryFeatures(Printer &p, std::string name, const VkPhysicalDeviceGlobalPriorityQueryFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(19); p.PrintKeyBool("globalPriorityQuery", static_cast(obj.globalPriorityQuery)); @@ -1996,12 +3439,12 @@ void DumpVkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT(Printer &p, std::s p.PrintKeyBool("graphicsPipelineLibraryFastLinking", static_cast(obj.graphicsPipelineLibraryFastLinking)); p.PrintKeyBool("graphicsPipelineLibraryIndependentInterpolationDecoration", static_cast(obj.graphicsPipelineLibraryIndependentInterpolationDecoration)); } -void DumpVkPhysicalDeviceHostImageCopyFeaturesEXT(Printer &p, std::string name, const VkPhysicalDeviceHostImageCopyFeaturesEXT &obj) { +void DumpVkPhysicalDeviceHostImageCopyFeatures(Printer &p, std::string name, const VkPhysicalDeviceHostImageCopyFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(13); p.PrintKeyBool("hostImageCopy", static_cast(obj.hostImageCopy)); } -void DumpVkPhysicalDeviceHostImageCopyPropertiesEXT(Printer &p, std::string name, const VkPhysicalDeviceHostImageCopyPropertiesEXT &obj) { +void DumpVkPhysicalDeviceHostImageCopyProperties(Printer &p, std::string name, const VkPhysicalDeviceHostImageCopyProperties &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(35); p.PrintKeyValue("copySrcLayoutCount", obj.copySrcLayoutCount); @@ -2077,7 +3520,7 @@ void DumpVkPhysicalDeviceImagelessFramebufferFeatures(Printer &p, std::string na p.SetMinKeyWidth(20); p.PrintKeyBool("imagelessFramebuffer", static_cast(obj.imagelessFramebuffer)); } -void DumpVkPhysicalDeviceIndexTypeUint8FeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceIndexTypeUint8FeaturesKHR &obj) { +void DumpVkPhysicalDeviceIndexTypeUint8Features(Printer &p, std::string name, const VkPhysicalDeviceIndexTypeUint8Features &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(14); p.PrintKeyBool("indexTypeUint8", static_cast(obj.indexTypeUint8)); @@ -2265,7 +3708,7 @@ void DumpVkPhysicalDeviceLimits(Printer &p, std::string name, const VkPhysicalDe p.PrintKeyValue("nonCoherentAtomSize", to_hex_str(p, obj.nonCoherentAtomSize)); p.ObjectEnd(); } -void DumpVkPhysicalDeviceLineRasterizationFeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceLineRasterizationFeaturesKHR &obj) { +void DumpVkPhysicalDeviceLineRasterizationFeatures(Printer &p, std::string name, const VkPhysicalDeviceLineRasterizationFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(24); p.PrintKeyBool("rectangularLines", static_cast(obj.rectangularLines)); @@ -2275,7 +3718,7 @@ void DumpVkPhysicalDeviceLineRasterizationFeaturesKHR(Printer &p, std::string na p.PrintKeyBool("stippledBresenhamLines", static_cast(obj.stippledBresenhamLines)); p.PrintKeyBool("stippledSmoothLines", static_cast(obj.stippledSmoothLines)); } -void DumpVkPhysicalDeviceLineRasterizationPropertiesKHR(Printer &p, std::string name, const VkPhysicalDeviceLineRasterizationPropertiesKHR &obj) { +void DumpVkPhysicalDeviceLineRasterizationProperties(Printer &p, std::string name, const VkPhysicalDeviceLineRasterizationProperties &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(25); p.PrintKeyValue("lineSubPixelPrecisionBits", obj.lineSubPixelPrecisionBits); @@ -2296,12 +3739,12 @@ void DumpVkPhysicalDeviceMaintenance4Properties(Printer &p, std::string name, co p.SetMinKeyWidth(13); p.PrintKeyValue("maxBufferSize", to_hex_str(p, obj.maxBufferSize)); } -void DumpVkPhysicalDeviceMaintenance5FeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceMaintenance5FeaturesKHR &obj) { +void DumpVkPhysicalDeviceMaintenance5Features(Printer &p, std::string name, const VkPhysicalDeviceMaintenance5Features &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(12); p.PrintKeyBool("maintenance5", static_cast(obj.maintenance5)); } -void DumpVkPhysicalDeviceMaintenance5PropertiesKHR(Printer &p, std::string name, const VkPhysicalDeviceMaintenance5PropertiesKHR &obj) { +void DumpVkPhysicalDeviceMaintenance5Properties(Printer &p, std::string name, const VkPhysicalDeviceMaintenance5Properties &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(51); p.PrintKeyBool("earlyFragmentMultisampleCoverageAfterSampleCounting", static_cast(obj.earlyFragmentMultisampleCoverageAfterSampleCounting)); @@ -2311,12 +3754,12 @@ void DumpVkPhysicalDeviceMaintenance5PropertiesKHR(Printer &p, std::string name, p.PrintKeyBool("nonStrictSinglePixelWideLinesUseParallelogram", static_cast(obj.nonStrictSinglePixelWideLinesUseParallelogram)); p.PrintKeyBool("nonStrictWideLinesUseParallelogram", static_cast(obj.nonStrictWideLinesUseParallelogram)); } -void DumpVkPhysicalDeviceMaintenance6FeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceMaintenance6FeaturesKHR &obj) { +void DumpVkPhysicalDeviceMaintenance6Features(Printer &p, std::string name, const VkPhysicalDeviceMaintenance6Features &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(12); p.PrintKeyBool("maintenance6", static_cast(obj.maintenance6)); } -void DumpVkPhysicalDeviceMaintenance6PropertiesKHR(Printer &p, std::string name, const VkPhysicalDeviceMaintenance6PropertiesKHR &obj) { +void DumpVkPhysicalDeviceMaintenance6Properties(Printer &p, std::string name, const VkPhysicalDeviceMaintenance6Properties &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(38); p.PrintKeyBool("blockTexelViewCompatibleMultipleLayers", static_cast(obj.blockTexelViewCompatibleMultipleLayers)); @@ -2340,6 +3783,11 @@ void DumpVkPhysicalDeviceMaintenance7PropertiesKHR(Printer &p, std::string name, p.PrintKeyValue("maxDescriptorSetUpdateAfterBindTotalStorageBuffersDynamic", obj.maxDescriptorSetUpdateAfterBindTotalStorageBuffersDynamic); p.PrintKeyValue("maxDescriptorSetUpdateAfterBindTotalBuffersDynamic", obj.maxDescriptorSetUpdateAfterBindTotalBuffersDynamic); } +void DumpVkPhysicalDeviceMaintenance8FeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceMaintenance8FeaturesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(12); + p.PrintKeyBool("maintenance8", static_cast(obj.maintenance8)); +} void DumpVkPhysicalDeviceMapMemoryPlacedFeaturesEXT(Printer &p, std::string name, const VkPhysicalDeviceMapMemoryPlacedFeaturesEXT &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(20); @@ -2509,6 +3957,20 @@ void DumpVkPhysicalDevicePerformanceQueryPropertiesKHR(Printer &p, std::string n p.SetMinKeyWidth(29); p.PrintKeyBool("allowCommandBufferQueryCopies", static_cast(obj.allowCommandBufferQueryCopies)); } +void DumpVkPhysicalDevicePipelineBinaryFeaturesKHR(Printer &p, std::string name, const VkPhysicalDevicePipelineBinaryFeaturesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(16); + p.PrintKeyBool("pipelineBinaries", static_cast(obj.pipelineBinaries)); +} +void DumpVkPhysicalDevicePipelineBinaryPropertiesKHR(Printer &p, std::string name, const VkPhysicalDevicePipelineBinaryPropertiesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(38); + p.PrintKeyBool("pipelineBinaryInternalCache", static_cast(obj.pipelineBinaryInternalCache)); + p.PrintKeyBool("pipelineBinaryInternalCacheControl", static_cast(obj.pipelineBinaryInternalCacheControl)); + p.PrintKeyBool("pipelineBinaryPrefersInternalCache", static_cast(obj.pipelineBinaryPrefersInternalCache)); + p.PrintKeyBool("pipelineBinaryPrecompiledInternalCache", static_cast(obj.pipelineBinaryPrecompiledInternalCache)); + p.PrintKeyBool("pipelineBinaryCompressedData", static_cast(obj.pipelineBinaryCompressedData)); +} void DumpVkPhysicalDevicePipelineCreationCacheControlFeatures(Printer &p, std::string name, const VkPhysicalDevicePipelineCreationCacheControlFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(28); @@ -2529,22 +3991,22 @@ void DumpVkPhysicalDevicePipelinePropertiesFeaturesEXT(Printer &p, std::string n p.SetMinKeyWidth(28); p.PrintKeyBool("pipelinePropertiesIdentifier", static_cast(obj.pipelinePropertiesIdentifier)); } -void DumpVkPhysicalDevicePipelineProtectedAccessFeaturesEXT(Printer &p, std::string name, const VkPhysicalDevicePipelineProtectedAccessFeaturesEXT &obj) { +void DumpVkPhysicalDevicePipelineProtectedAccessFeatures(Printer &p, std::string name, const VkPhysicalDevicePipelineProtectedAccessFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(23); p.PrintKeyBool("pipelineProtectedAccess", static_cast(obj.pipelineProtectedAccess)); } -void DumpVkPhysicalDevicePipelineRobustnessFeaturesEXT(Printer &p, std::string name, const VkPhysicalDevicePipelineRobustnessFeaturesEXT &obj) { +void DumpVkPhysicalDevicePipelineRobustnessFeatures(Printer &p, std::string name, const VkPhysicalDevicePipelineRobustnessFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(18); p.PrintKeyBool("pipelineRobustness", static_cast(obj.pipelineRobustness)); } -void DumpVkPhysicalDevicePipelineRobustnessPropertiesEXT(Printer &p, std::string name, const VkPhysicalDevicePipelineRobustnessPropertiesEXT &obj) { +void DumpVkPhysicalDevicePipelineRobustnessProperties(Printer &p, std::string name, const VkPhysicalDevicePipelineRobustnessProperties &obj) { ObjectWrapper object{p, name}; - DumpVkPipelineRobustnessBufferBehaviorEXT(p, "defaultRobustnessStorageBuffers", obj.defaultRobustnessStorageBuffers); - DumpVkPipelineRobustnessBufferBehaviorEXT(p, "defaultRobustnessUniformBuffers", obj.defaultRobustnessUniformBuffers); - DumpVkPipelineRobustnessBufferBehaviorEXT(p, "defaultRobustnessVertexInputs", obj.defaultRobustnessVertexInputs); - DumpVkPipelineRobustnessImageBehaviorEXT(p, "defaultRobustnessImages", obj.defaultRobustnessImages); + DumpVkPipelineRobustnessBufferBehavior(p, "defaultRobustnessStorageBuffers", obj.defaultRobustnessStorageBuffers); + DumpVkPipelineRobustnessBufferBehavior(p, "defaultRobustnessUniformBuffers", obj.defaultRobustnessUniformBuffers); + DumpVkPipelineRobustnessBufferBehavior(p, "defaultRobustnessVertexInputs", obj.defaultRobustnessVertexInputs); + DumpVkPipelineRobustnessImageBehavior(p, "defaultRobustnessImages", obj.defaultRobustnessImages); } void DumpVkPhysicalDevicePointClippingProperties(Printer &p, std::string name, const VkPhysicalDevicePointClippingProperties &obj) { ObjectWrapper object{p, name}; @@ -2583,6 +4045,11 @@ void DumpVkPhysicalDevicePresentIdFeaturesKHR(Printer &p, std::string name, cons p.SetMinKeyWidth(9); p.PrintKeyBool("presentId", static_cast(obj.presentId)); } +void DumpVkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT(Printer &p, std::string name, const VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(26); + p.PrintKeyBool("presentModeFifoLatestReady", static_cast(obj.presentModeFifoLatestReady)); +} void DumpVkPhysicalDevicePresentWaitFeaturesKHR(Printer &p, std::string name, const VkPhysicalDevicePresentWaitFeaturesKHR &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(11); @@ -2628,7 +4095,7 @@ void DumpVkPhysicalDeviceProvokingVertexPropertiesEXT(Printer &p, std::string na p.PrintKeyBool("provokingVertexModePerPipeline", static_cast(obj.provokingVertexModePerPipeline)); p.PrintKeyBool("transformFeedbackPreservesTriangleFanProvokingVertex", static_cast(obj.transformFeedbackPreservesTriangleFanProvokingVertex)); } -void DumpVkPhysicalDevicePushDescriptorPropertiesKHR(Printer &p, std::string name, const VkPhysicalDevicePushDescriptorPropertiesKHR &obj) { +void DumpVkPhysicalDevicePushDescriptorProperties(Printer &p, std::string name, const VkPhysicalDevicePushDescriptorProperties &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(18); p.PrintKeyValue("maxPushDescriptors", obj.maxPushDescriptors); @@ -2782,7 +4249,7 @@ void DumpVkPhysicalDeviceShaderDrawParametersFeatures(Printer &p, std::string na p.SetMinKeyWidth(20); p.PrintKeyBool("shaderDrawParameters", static_cast(obj.shaderDrawParameters)); } -void DumpVkPhysicalDeviceShaderExpectAssumeFeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceShaderExpectAssumeFeaturesKHR &obj) { +void DumpVkPhysicalDeviceShaderExpectAssumeFeatures(Printer &p, std::string name, const VkPhysicalDeviceShaderExpectAssumeFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(18); p.PrintKeyBool("shaderExpectAssume", static_cast(obj.shaderExpectAssume)); @@ -2793,7 +4260,7 @@ void DumpVkPhysicalDeviceShaderFloat16Int8Features(Printer &p, std::string name, p.PrintKeyBool("shaderFloat16", static_cast(obj.shaderFloat16)); p.PrintKeyBool("shaderInt8", static_cast(obj.shaderInt8)); } -void DumpVkPhysicalDeviceShaderFloatControls2FeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceShaderFloatControls2FeaturesKHR &obj) { +void DumpVkPhysicalDeviceShaderFloatControls2Features(Printer &p, std::string name, const VkPhysicalDeviceShaderFloatControls2Features &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(20); p.PrintKeyBool("shaderFloatControls2", static_cast(obj.shaderFloatControls2)); @@ -2889,7 +4356,7 @@ void DumpVkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(Printer &p, std::st p.SetMinKeyWidth(27); p.PrintKeyBool("shaderSubgroupExtendedTypes", static_cast(obj.shaderSubgroupExtendedTypes)); } -void DumpVkPhysicalDeviceShaderSubgroupRotateFeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR &obj) { +void DumpVkPhysicalDeviceShaderSubgroupRotateFeatures(Printer &p, std::string name, const VkPhysicalDeviceShaderSubgroupRotateFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(29); p.PrintKeyBool("shaderSubgroupRotate", static_cast(obj.shaderSubgroupRotate)); @@ -3037,33 +4504,53 @@ void DumpVkPhysicalDeviceVariablePointersFeatures(Printer &p, std::string name, p.PrintKeyBool("variablePointersStorageBuffer", static_cast(obj.variablePointersStorageBuffer)); p.PrintKeyBool("variablePointers", static_cast(obj.variablePointers)); } -void DumpVkPhysicalDeviceVertexAttributeDivisorFeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR &obj) { +void DumpVkPhysicalDeviceVertexAttributeDivisorFeatures(Printer &p, std::string name, const VkPhysicalDeviceVertexAttributeDivisorFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(38); p.PrintKeyBool("vertexAttributeInstanceRateDivisor", static_cast(obj.vertexAttributeInstanceRateDivisor)); p.PrintKeyBool("vertexAttributeInstanceRateZeroDivisor", static_cast(obj.vertexAttributeInstanceRateZeroDivisor)); } +void DumpVkPhysicalDeviceVertexAttributeDivisorProperties(Printer &p, std::string name, const VkPhysicalDeviceVertexAttributeDivisorProperties &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(28); + p.PrintKeyValue("maxVertexAttribDivisor", obj.maxVertexAttribDivisor); + p.PrintKeyBool("supportsNonZeroFirstInstance", static_cast(obj.supportsNonZeroFirstInstance)); +} void DumpVkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(Printer &p, std::string name, const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(22); p.PrintKeyValue("maxVertexAttribDivisor", obj.maxVertexAttribDivisor); } -void DumpVkPhysicalDeviceVertexAttributeDivisorPropertiesKHR(Printer &p, std::string name, const VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR &obj) { +void DumpVkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT(Printer &p, std::string name, const VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT &obj) { ObjectWrapper object{p, name}; - p.SetMinKeyWidth(28); - p.PrintKeyValue("maxVertexAttribDivisor", obj.maxVertexAttribDivisor); - p.PrintKeyBool("supportsNonZeroFirstInstance", static_cast(obj.supportsNonZeroFirstInstance)); + p.SetMinKeyWidth(25); + p.PrintKeyBool("vertexAttributeRobustness", static_cast(obj.vertexAttributeRobustness)); } void DumpVkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(Printer &p, std::string name, const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(23); p.PrintKeyBool("vertexInputDynamicState", static_cast(obj.vertexInputDynamicState)); } +void DumpVkPhysicalDeviceVideoEncodeAV1FeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceVideoEncodeAV1FeaturesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(14); + p.PrintKeyBool("videoEncodeAV1", static_cast(obj.videoEncodeAV1)); +} +void DumpVkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(26); + p.PrintKeyBool("videoEncodeQuantizationMap", static_cast(obj.videoEncodeQuantizationMap)); +} void DumpVkPhysicalDeviceVideoMaintenance1FeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceVideoMaintenance1FeaturesKHR &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(17); p.PrintKeyBool("videoMaintenance1", static_cast(obj.videoMaintenance1)); } +void DumpVkPhysicalDeviceVideoMaintenance2FeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceVideoMaintenance2FeaturesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(17); + p.PrintKeyBool("videoMaintenance2", static_cast(obj.videoMaintenance2)); +} void DumpVkPhysicalDeviceVulkan11Features(Printer &p, std::string name, const VkPhysicalDeviceVulkan11Features &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(34); @@ -3276,6 +4763,74 @@ void DumpVkPhysicalDeviceVulkan13Properties(Printer &p, std::string name, const p.PrintKeyBool("uniformTexelBufferOffsetSingleTexelAlignment", static_cast(obj.uniformTexelBufferOffsetSingleTexelAlignment)); p.PrintKeyValue("maxBufferSize", to_hex_str(p, obj.maxBufferSize)); } +void DumpVkPhysicalDeviceVulkan14Features(Printer &p, std::string name, const VkPhysicalDeviceVulkan14Features &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(38); + p.PrintKeyBool("globalPriorityQuery", static_cast(obj.globalPriorityQuery)); + p.PrintKeyBool("shaderSubgroupRotate", static_cast(obj.shaderSubgroupRotate)); + p.PrintKeyBool("shaderSubgroupRotateClustered", static_cast(obj.shaderSubgroupRotateClustered)); + p.PrintKeyBool("shaderFloatControls2", static_cast(obj.shaderFloatControls2)); + p.PrintKeyBool("shaderExpectAssume", static_cast(obj.shaderExpectAssume)); + p.PrintKeyBool("rectangularLines", static_cast(obj.rectangularLines)); + p.PrintKeyBool("bresenhamLines", static_cast(obj.bresenhamLines)); + p.PrintKeyBool("smoothLines", static_cast(obj.smoothLines)); + p.PrintKeyBool("stippledRectangularLines", static_cast(obj.stippledRectangularLines)); + p.PrintKeyBool("stippledBresenhamLines", static_cast(obj.stippledBresenhamLines)); + p.PrintKeyBool("stippledSmoothLines", static_cast(obj.stippledSmoothLines)); + p.PrintKeyBool("vertexAttributeInstanceRateDivisor", static_cast(obj.vertexAttributeInstanceRateDivisor)); + p.PrintKeyBool("vertexAttributeInstanceRateZeroDivisor", static_cast(obj.vertexAttributeInstanceRateZeroDivisor)); + p.PrintKeyBool("indexTypeUint8", static_cast(obj.indexTypeUint8)); + p.PrintKeyBool("dynamicRenderingLocalRead", static_cast(obj.dynamicRenderingLocalRead)); + p.PrintKeyBool("maintenance5", static_cast(obj.maintenance5)); + p.PrintKeyBool("maintenance6", static_cast(obj.maintenance6)); + p.PrintKeyBool("pipelineProtectedAccess", static_cast(obj.pipelineProtectedAccess)); + p.PrintKeyBool("pipelineRobustness", static_cast(obj.pipelineRobustness)); + p.PrintKeyBool("hostImageCopy", static_cast(obj.hostImageCopy)); + p.PrintKeyBool("pushDescriptor", static_cast(obj.pushDescriptor)); +} +void DumpVkPhysicalDeviceVulkan14Properties(Printer &p, std::string name, const VkPhysicalDeviceVulkan14Properties &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(51); + p.PrintKeyValue("lineSubPixelPrecisionBits", obj.lineSubPixelPrecisionBits); + p.PrintKeyValue("maxVertexAttribDivisor", obj.maxVertexAttribDivisor); + p.PrintKeyBool("supportsNonZeroFirstInstance", static_cast(obj.supportsNonZeroFirstInstance)); + p.PrintKeyValue("maxPushDescriptors", obj.maxPushDescriptors); + p.PrintKeyBool("dynamicRenderingLocalReadDepthStencilAttachments", static_cast(obj.dynamicRenderingLocalReadDepthStencilAttachments)); + p.PrintKeyBool("dynamicRenderingLocalReadMultisampledAttachments", static_cast(obj.dynamicRenderingLocalReadMultisampledAttachments)); + p.PrintKeyBool("earlyFragmentMultisampleCoverageAfterSampleCounting", static_cast(obj.earlyFragmentMultisampleCoverageAfterSampleCounting)); + p.PrintKeyBool("earlyFragmentSampleMaskTestBeforeSampleCounting", static_cast(obj.earlyFragmentSampleMaskTestBeforeSampleCounting)); + p.PrintKeyBool("depthStencilSwizzleOneSupport", static_cast(obj.depthStencilSwizzleOneSupport)); + p.PrintKeyBool("polygonModePointSize", static_cast(obj.polygonModePointSize)); + p.PrintKeyBool("nonStrictSinglePixelWideLinesUseParallelogram", static_cast(obj.nonStrictSinglePixelWideLinesUseParallelogram)); + p.PrintKeyBool("nonStrictWideLinesUseParallelogram", static_cast(obj.nonStrictWideLinesUseParallelogram)); + p.PrintKeyBool("blockTexelViewCompatibleMultipleLayers", static_cast(obj.blockTexelViewCompatibleMultipleLayers)); + p.PrintKeyValue("maxCombinedImageSamplerDescriptorCount", obj.maxCombinedImageSamplerDescriptorCount); + p.PrintKeyBool("fragmentShadingRateClampCombinerInputs", static_cast(obj.fragmentShadingRateClampCombinerInputs)); + DumpVkPipelineRobustnessBufferBehavior(p, "defaultRobustnessStorageBuffers", obj.defaultRobustnessStorageBuffers); + DumpVkPipelineRobustnessBufferBehavior(p, "defaultRobustnessUniformBuffers", obj.defaultRobustnessUniformBuffers); + DumpVkPipelineRobustnessBufferBehavior(p, "defaultRobustnessVertexInputs", obj.defaultRobustnessVertexInputs); + DumpVkPipelineRobustnessImageBehavior(p, "defaultRobustnessImages", obj.defaultRobustnessImages); + p.PrintKeyValue("copySrcLayoutCount", obj.copySrcLayoutCount); + if (obj.copySrcLayoutCount == 0 || obj.pCopySrcLayouts == nullptr) { + p.PrintKeyString("pCopySrcLayouts", "NULL"); + } else { + ArrayWrapper arr(p,"pCopySrcLayouts", obj.copySrcLayoutCount); + for (uint32_t i = 0; i < obj.copySrcLayoutCount; i++) { + DumpVkImageLayout(p, std::to_string(i), obj.pCopySrcLayouts[i]); + } + } + p.PrintKeyValue("copyDstLayoutCount", obj.copyDstLayoutCount); + if (obj.copyDstLayoutCount == 0 || obj.pCopyDstLayouts == nullptr) { + p.PrintKeyString("pCopyDstLayouts", "NULL"); + } else { + ArrayWrapper arr(p,"pCopyDstLayouts", obj.copyDstLayoutCount); + for (uint32_t i = 0; i < obj.copyDstLayoutCount; i++) { + DumpVkImageLayout(p, std::to_string(i), obj.pCopyDstLayouts[i]); + } + } + p.PrintKeyValue("optimalTilingLayoutUUID", obj.optimalTilingLayoutUUID); + p.PrintKeyBool("identicalMemoryTypeRequirements", static_cast(obj.identicalMemoryTypeRequirements)); +} void DumpVkPhysicalDeviceVulkanMemoryModelFeatures(Printer &p, std::string name, const VkPhysicalDeviceVulkanMemoryModelFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(45); @@ -3306,16 +4861,16 @@ void DumpVkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures(Printer &p, std:: p.SetMinKeyWidth(35); p.PrintKeyBool("shaderZeroInitializeWorkgroupMemory", static_cast(obj.shaderZeroInitializeWorkgroupMemory)); } -void DumpVkQueueFamilyGlobalPriorityPropertiesKHR(Printer &p, std::string name, const VkQueueFamilyGlobalPriorityPropertiesKHR &obj) { +void DumpVkQueueFamilyGlobalPriorityProperties(Printer &p, std::string name, const VkQueueFamilyGlobalPriorityProperties &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(14); p.PrintKeyValue("priorityCount", obj.priorityCount); ArrayWrapper arr(p,"priorities", obj.priorityCount); for (uint32_t i = 0; i < obj.priorityCount; i++) { if (p.Type() == OutputType::json) - p.PrintString(std::string("VK_") + VkQueueGlobalPriorityKHRString(obj.priorities[i])); + p.PrintString(std::string("VK_") + VkQueueGlobalPriorityString(obj.priorities[i])); else - p.PrintString(VkQueueGlobalPriorityKHRString(obj.priorities[i])); + p.PrintString(VkQueueGlobalPriorityString(obj.priorities[i])); } } void DumpVkQueueFamilyQueryResultStatusPropertiesKHR(Printer &p, std::string name, const VkQueueFamilyQueryResultStatusPropertiesKHR &obj) { @@ -3362,31 +4917,224 @@ void DumpVkSurfaceFormatKHR(Printer &p, std::string name, const VkSurfaceFormatK DumpVkFormat(p, "format", obj.format); DumpVkColorSpaceKHR(p, "colorSpace", obj.colorSpace); } -void DumpVkSurfacePresentModeCompatibilityEXT(Printer &p, std::string name, const VkSurfacePresentModeCompatibilityEXT &obj) { +void DumpVkSurfacePresentModeCompatibilityEXT(Printer &p, std::string name, const VkSurfacePresentModeCompatibilityEXT &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(31); + p.PrintKeyValue("presentModeCount", obj.presentModeCount); + if (obj.presentModeCount == 0 || obj.pPresentModes == nullptr) { + p.PrintKeyString("pPresentModes", "NULL"); + } else { + ArrayWrapper arr(p,"pPresentModes", obj.presentModeCount); + for (uint32_t i = 0; i < obj.presentModeCount; i++) { + DumpVkPresentModeKHR(p, std::to_string(i), obj.pPresentModes[i]); + } + } +} +void DumpVkSurfacePresentScalingCapabilitiesEXT(Printer &p, std::string name, const VkSurfacePresentScalingCapabilitiesEXT &obj) { + ObjectWrapper object{p, name}; + DumpVkPresentScalingFlagsEXT(p, "supportedPresentScaling", obj.supportedPresentScaling); + DumpVkPresentGravityFlagsEXT(p, "supportedPresentGravityX", obj.supportedPresentGravityX); + DumpVkPresentGravityFlagsEXT(p, "supportedPresentGravityY", obj.supportedPresentGravityY); + DumpVkExtent2D(p, "minScaledImageExtent", obj.minScaledImageExtent); + DumpVkExtent2D(p, "maxScaledImageExtent", obj.maxScaledImageExtent); +} +void DumpVkSurfaceProtectedCapabilitiesKHR(Printer &p, std::string name, const VkSurfaceProtectedCapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(17); + p.PrintKeyBool("supportsProtected", static_cast(obj.supportsProtected)); +} +void DumpVkVideoCapabilitiesKHR(Printer &p, std::string name, const VkVideoCapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(33); + DumpVkVideoCapabilityFlagsKHR(p, "flags", obj.flags); + p.PrintKeyValue("minBitstreamBufferOffsetAlignment", to_hex_str(p, obj.minBitstreamBufferOffsetAlignment)); + p.PrintKeyValue("minBitstreamBufferSizeAlignment", to_hex_str(p, obj.minBitstreamBufferSizeAlignment)); + DumpVkExtent2D(p, "pictureAccessGranularity", obj.pictureAccessGranularity); + DumpVkExtent2D(p, "minCodedExtent", obj.minCodedExtent); + DumpVkExtent2D(p, "maxCodedExtent", obj.maxCodedExtent); + p.PrintKeyValue("maxDpbSlots", obj.maxDpbSlots); + p.PrintKeyValue("maxActiveReferencePictures", obj.maxActiveReferencePictures); + DumpVkExtensionProperties(p, "stdHeaderVersion", obj.stdHeaderVersion); +} +void DumpVkVideoDecodeAV1CapabilitiesKHR(Printer &p, std::string name, const VkVideoDecodeAV1CapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + DumpStdVideoAV1Level(p, "maxLevel", obj.maxLevel); +} +void DumpVkVideoDecodeAV1ProfileInfoKHR(Printer &p, std::string name, const VkVideoDecodeAV1ProfileInfoKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(16); + DumpStdVideoAV1Profile(p, "stdProfile", obj.stdProfile); + p.PrintKeyBool("filmGrainSupport", static_cast(obj.filmGrainSupport)); +} +void DumpVkVideoDecodeCapabilitiesKHR(Printer &p, std::string name, const VkVideoDecodeCapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + DumpVkVideoDecodeCapabilityFlagsKHR(p, "flags", obj.flags); +} +void DumpVkVideoDecodeH264CapabilitiesKHR(Printer &p, std::string name, const VkVideoDecodeH264CapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + DumpStdVideoH264LevelIdc(p, "maxLevelIdc", obj.maxLevelIdc); + DumpVkOffset2D(p, "fieldOffsetGranularity", obj.fieldOffsetGranularity); +} +void DumpVkVideoDecodeH264ProfileInfoKHR(Printer &p, std::string name, const VkVideoDecodeH264ProfileInfoKHR &obj) { + ObjectWrapper object{p, name}; + DumpStdVideoH264ProfileIdc(p, "stdProfileIdc", obj.stdProfileIdc); + DumpVkVideoDecodeH264PictureLayoutFlagBitsKHR(p, "pictureLayout", obj.pictureLayout); +} +void DumpVkVideoDecodeH265CapabilitiesKHR(Printer &p, std::string name, const VkVideoDecodeH265CapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + DumpStdVideoH265LevelIdc(p, "maxLevelIdc", obj.maxLevelIdc); +} +void DumpVkVideoDecodeH265ProfileInfoKHR(Printer &p, std::string name, const VkVideoDecodeH265ProfileInfoKHR &obj) { + ObjectWrapper object{p, name}; + DumpStdVideoH265ProfileIdc(p, "stdProfileIdc", obj.stdProfileIdc); +} +void DumpVkVideoDecodeUsageInfoKHR(Printer &p, std::string name, const VkVideoDecodeUsageInfoKHR &obj) { + ObjectWrapper object{p, name}; + DumpVkVideoDecodeUsageFlagsKHR(p, "videoUsageHints", obj.videoUsageHints); +} +void DumpVkVideoEncodeAV1CapabilitiesKHR(Printer &p, std::string name, const VkVideoEncodeAV1CapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(45); + DumpVkVideoEncodeAV1CapabilityFlagsKHR(p, "flags", obj.flags); + DumpStdVideoAV1Level(p, "maxLevel", obj.maxLevel); + DumpVkExtent2D(p, "codedPictureAlignment", obj.codedPictureAlignment); + DumpVkExtent2D(p, "maxTiles", obj.maxTiles); + DumpVkExtent2D(p, "minTileSize", obj.minTileSize); + DumpVkExtent2D(p, "maxTileSize", obj.maxTileSize); + DumpVkVideoEncodeAV1SuperblockSizeFlagsKHR(p, "superblockSizes", obj.superblockSizes); + p.PrintKeyValue("maxSingleReferenceCount", obj.maxSingleReferenceCount); + p.PrintKeyValue("singleReferenceNameMask", obj.singleReferenceNameMask); + p.PrintKeyValue("maxUnidirectionalCompoundReferenceCount", obj.maxUnidirectionalCompoundReferenceCount); + p.PrintKeyValue("maxUnidirectionalCompoundGroup1ReferenceCount", obj.maxUnidirectionalCompoundGroup1ReferenceCount); + p.PrintKeyValue("unidirectionalCompoundReferenceNameMask", obj.unidirectionalCompoundReferenceNameMask); + p.PrintKeyValue("maxBidirectionalCompoundReferenceCount", obj.maxBidirectionalCompoundReferenceCount); + p.PrintKeyValue("maxBidirectionalCompoundGroup1ReferenceCount", obj.maxBidirectionalCompoundGroup1ReferenceCount); + p.PrintKeyValue("maxBidirectionalCompoundGroup2ReferenceCount", obj.maxBidirectionalCompoundGroup2ReferenceCount); + p.PrintKeyValue("bidirectionalCompoundReferenceNameMask", obj.bidirectionalCompoundReferenceNameMask); + p.PrintKeyValue("maxTemporalLayerCount", obj.maxTemporalLayerCount); + p.PrintKeyValue("maxSpatialLayerCount", obj.maxSpatialLayerCount); + p.PrintKeyValue("maxOperatingPoints", obj.maxOperatingPoints); + p.PrintKeyValue("minQIndex", obj.minQIndex); + p.PrintKeyValue("maxQIndex", obj.maxQIndex); + p.PrintKeyBool("prefersGopRemainingFrames", static_cast(obj.prefersGopRemainingFrames)); + p.PrintKeyBool("requiresGopRemainingFrames", static_cast(obj.requiresGopRemainingFrames)); + DumpVkVideoEncodeAV1StdFlagsKHR(p, "stdSyntaxFlags", obj.stdSyntaxFlags); +} +void DumpVkVideoEncodeAV1ProfileInfoKHR(Printer &p, std::string name, const VkVideoEncodeAV1ProfileInfoKHR &obj) { + ObjectWrapper object{p, name}; + DumpStdVideoAV1Profile(p, "stdProfile", obj.stdProfile); +} +void DumpVkVideoEncodeAV1QuantizationMapCapabilitiesKHR(Printer &p, std::string name, const VkVideoEncodeAV1QuantizationMapCapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(14); + p.PrintKeyValue("minQIndexDelta", obj.minQIndexDelta); + p.PrintKeyValue("maxQIndexDelta", obj.maxQIndexDelta); +} +void DumpVkVideoEncodeCapabilitiesKHR(Printer &p, std::string name, const VkVideoEncodeCapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(20); + DumpVkVideoEncodeCapabilityFlagsKHR(p, "flags", obj.flags); + DumpVkVideoEncodeRateControlModeFlagsKHR(p, "rateControlModes", obj.rateControlModes); + p.PrintKeyValue("maxRateControlLayers", obj.maxRateControlLayers); + p.PrintKeyValue("maxBitrate", obj.maxBitrate); + p.PrintKeyValue("maxQualityLevels", obj.maxQualityLevels); + DumpVkExtent2D(p, "encodeInputPictureGranularity", obj.encodeInputPictureGranularity); + DumpVkVideoEncodeFeedbackFlagsKHR(p, "supportedEncodeFeedbackFlags", obj.supportedEncodeFeedbackFlags); +} +void DumpVkVideoEncodeH264CapabilitiesKHR(Printer &p, std::string name, const VkVideoEncodeH264CapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(32); + DumpVkVideoEncodeH264CapabilityFlagsKHR(p, "flags", obj.flags); + DumpStdVideoH264LevelIdc(p, "maxLevelIdc", obj.maxLevelIdc); + p.PrintKeyValue("maxSliceCount", obj.maxSliceCount); + p.PrintKeyValue("maxPPictureL0ReferenceCount", obj.maxPPictureL0ReferenceCount); + p.PrintKeyValue("maxBPictureL0ReferenceCount", obj.maxBPictureL0ReferenceCount); + p.PrintKeyValue("maxL1ReferenceCount", obj.maxL1ReferenceCount); + p.PrintKeyValue("maxTemporalLayerCount", obj.maxTemporalLayerCount); + p.PrintKeyBool("expectDyadicTemporalLayerPattern", static_cast(obj.expectDyadicTemporalLayerPattern)); + p.PrintKeyValue("minQp", obj.minQp); + p.PrintKeyValue("maxQp", obj.maxQp); + p.PrintKeyBool("prefersGopRemainingFrames", static_cast(obj.prefersGopRemainingFrames)); + p.PrintKeyBool("requiresGopRemainingFrames", static_cast(obj.requiresGopRemainingFrames)); + DumpVkVideoEncodeH264StdFlagsKHR(p, "stdSyntaxFlags", obj.stdSyntaxFlags); +} +void DumpVkVideoEncodeH264ProfileInfoKHR(Printer &p, std::string name, const VkVideoEncodeH264ProfileInfoKHR &obj) { + ObjectWrapper object{p, name}; + DumpStdVideoH264ProfileIdc(p, "stdProfileIdc", obj.stdProfileIdc); +} +void DumpVkVideoEncodeH264QuantizationMapCapabilitiesKHR(Printer &p, std::string name, const VkVideoEncodeH264QuantizationMapCapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(10); + p.PrintKeyValue("minQpDelta", obj.minQpDelta); + p.PrintKeyValue("maxQpDelta", obj.maxQpDelta); +} +void DumpVkVideoEncodeH265CapabilitiesKHR(Printer &p, std::string name, const VkVideoEncodeH265CapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(35); + DumpVkVideoEncodeH265CapabilityFlagsKHR(p, "flags", obj.flags); + DumpStdVideoH265LevelIdc(p, "maxLevelIdc", obj.maxLevelIdc); + p.PrintKeyValue("maxSliceSegmentCount", obj.maxSliceSegmentCount); + DumpVkExtent2D(p, "maxTiles", obj.maxTiles); + DumpVkVideoEncodeH265CtbSizeFlagsKHR(p, "ctbSizes", obj.ctbSizes); + DumpVkVideoEncodeH265TransformBlockSizeFlagsKHR(p, "transformBlockSizes", obj.transformBlockSizes); + p.PrintKeyValue("maxPPictureL0ReferenceCount", obj.maxPPictureL0ReferenceCount); + p.PrintKeyValue("maxBPictureL0ReferenceCount", obj.maxBPictureL0ReferenceCount); + p.PrintKeyValue("maxL1ReferenceCount", obj.maxL1ReferenceCount); + p.PrintKeyValue("maxSubLayerCount", obj.maxSubLayerCount); + p.PrintKeyBool("expectDyadicTemporalSubLayerPattern", static_cast(obj.expectDyadicTemporalSubLayerPattern)); + p.PrintKeyValue("minQp", obj.minQp); + p.PrintKeyValue("maxQp", obj.maxQp); + p.PrintKeyBool("prefersGopRemainingFrames", static_cast(obj.prefersGopRemainingFrames)); + p.PrintKeyBool("requiresGopRemainingFrames", static_cast(obj.requiresGopRemainingFrames)); + DumpVkVideoEncodeH265StdFlagsKHR(p, "stdSyntaxFlags", obj.stdSyntaxFlags); +} +void DumpVkVideoEncodeH265ProfileInfoKHR(Printer &p, std::string name, const VkVideoEncodeH265ProfileInfoKHR &obj) { + ObjectWrapper object{p, name}; + DumpStdVideoH265ProfileIdc(p, "stdProfileIdc", obj.stdProfileIdc); +} +void DumpVkVideoEncodeH265QuantizationMapCapabilitiesKHR(Printer &p, std::string name, const VkVideoEncodeH265QuantizationMapCapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(10); + p.PrintKeyValue("minQpDelta", obj.minQpDelta); + p.PrintKeyValue("maxQpDelta", obj.maxQpDelta); +} +void DumpVkVideoEncodeQuantizationMapCapabilitiesKHR(Printer &p, std::string name, const VkVideoEncodeQuantizationMapCapabilitiesKHR &obj) { + ObjectWrapper object{p, name}; + DumpVkExtent2D(p, "maxQuantizationMapExtent", obj.maxQuantizationMapExtent); +} +void DumpVkVideoEncodeUsageInfoKHR(Printer &p, std::string name, const VkVideoEncodeUsageInfoKHR &obj) { + ObjectWrapper object{p, name}; + DumpVkVideoEncodeUsageFlagsKHR(p, "videoUsageHints", obj.videoUsageHints); + DumpVkVideoEncodeContentFlagsKHR(p, "videoContentHints", obj.videoContentHints); + DumpVkVideoEncodeTuningModeKHR(p, "tuningMode", obj.tuningMode); +} +void DumpVkVideoFormatAV1QuantizationMapPropertiesKHR(Printer &p, std::string name, const VkVideoFormatAV1QuantizationMapPropertiesKHR &obj) { + ObjectWrapper object{p, name}; + DumpVkVideoEncodeAV1SuperblockSizeFlagsKHR(p, "compatibleSuperblockSizes", obj.compatibleSuperblockSizes); +} +void DumpVkVideoFormatH265QuantizationMapPropertiesKHR(Printer &p, std::string name, const VkVideoFormatH265QuantizationMapPropertiesKHR &obj) { + ObjectWrapper object{p, name}; + DumpVkVideoEncodeH265CtbSizeFlagsKHR(p, "compatibleCtbSizes", obj.compatibleCtbSizes); +} +void DumpVkVideoFormatPropertiesKHR(Printer &p, std::string name, const VkVideoFormatPropertiesKHR &obj) { ObjectWrapper object{p, name}; - p.SetMinKeyWidth(31); - p.PrintKeyValue("presentModeCount", obj.presentModeCount); - if (obj.presentModeCount == 0 || obj.pPresentModes == nullptr) { - p.PrintKeyString("pPresentModes", "NULL"); - } else { - ArrayWrapper arr(p,"pPresentModes", obj.presentModeCount); - for (uint32_t i = 0; i < obj.presentModeCount; i++) { - DumpVkPresentModeKHR(p, std::to_string(i), obj.pPresentModes[i]); - } - } + DumpVkFormat(p, "format", obj.format); + DumpVkComponentMapping(p, "componentMapping", obj.componentMapping); + DumpVkImageCreateFlags(p, "imageCreateFlags", obj.imageCreateFlags); + DumpVkImageType(p, "imageType", obj.imageType); + DumpVkImageTiling(p, "imageTiling", obj.imageTiling); + DumpVkImageUsageFlags(p, "imageUsageFlags", obj.imageUsageFlags); } -void DumpVkSurfacePresentScalingCapabilitiesEXT(Printer &p, std::string name, const VkSurfacePresentScalingCapabilitiesEXT &obj) { +void DumpVkVideoFormatQuantizationMapPropertiesKHR(Printer &p, std::string name, const VkVideoFormatQuantizationMapPropertiesKHR &obj) { ObjectWrapper object{p, name}; - DumpVkPresentScalingFlagsEXT(p, "supportedPresentScaling", obj.supportedPresentScaling); - DumpVkPresentGravityFlagsEXT(p, "supportedPresentGravityX", obj.supportedPresentGravityX); - DumpVkPresentGravityFlagsEXT(p, "supportedPresentGravityY", obj.supportedPresentGravityY); - DumpVkExtent2D(p, "minScaledImageExtent", obj.minScaledImageExtent); - DumpVkExtent2D(p, "maxScaledImageExtent", obj.maxScaledImageExtent); + DumpVkExtent2D(p, "quantizationMapTexelSize", obj.quantizationMapTexelSize); } -void DumpVkSurfaceProtectedCapabilitiesKHR(Printer &p, std::string name, const VkSurfaceProtectedCapabilitiesKHR &obj) { +void DumpVkVideoProfileInfoKHR(Printer &p, std::string name, const VkVideoProfileInfoKHR &obj) { ObjectWrapper object{p, name}; - p.SetMinKeyWidth(17); - p.PrintKeyBool("supportsProtected", static_cast(obj.supportsProtected)); + DumpVkVideoCodecOperationFlagBitsKHR(p, "videoCodecOperation", obj.videoCodecOperation); + DumpVkVideoChromaSubsamplingFlagsKHR(p, "chromaSubsampling", obj.chromaSubsampling); + DumpVkVideoComponentBitDepthFlagsKHR(p, "lumaBitDepth", obj.lumaBitDepth); + DumpVkVideoComponentBitDepthFlagsKHR(p, "chromaBitDepth", obj.chromaBitDepth); } struct phys_device_props2_chain { phys_device_props2_chain() = default; @@ -3397,6 +5145,7 @@ struct phys_device_props2_chain { void* start_of_chain = nullptr; VkPhysicalDeviceAccelerationStructurePropertiesKHR PhysicalDeviceAccelerationStructurePropertiesKHR{}; VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT PhysicalDeviceBlendOperationAdvancedPropertiesEXT{}; + VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR PhysicalDeviceComputeShaderDerivativesPropertiesKHR{}; VkPhysicalDeviceConservativeRasterizationPropertiesEXT PhysicalDeviceConservativeRasterizationPropertiesEXT{}; VkPhysicalDeviceCooperativeMatrixPropertiesKHR PhysicalDeviceCooperativeMatrixPropertiesKHR{}; VkPhysicalDeviceCustomBorderColorPropertiesEXT PhysicalDeviceCustomBorderColorPropertiesEXT{}; @@ -3404,6 +5153,7 @@ struct phys_device_props2_chain { VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT PhysicalDeviceDescriptorBufferDensityMapPropertiesEXT{}; VkPhysicalDeviceDescriptorBufferPropertiesEXT PhysicalDeviceDescriptorBufferPropertiesEXT{}; VkPhysicalDeviceDescriptorIndexingProperties PhysicalDeviceDescriptorIndexingProperties{}; + VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT PhysicalDeviceDeviceGeneratedCommandsPropertiesEXT{}; VkPhysicalDeviceDiscardRectanglePropertiesEXT PhysicalDeviceDiscardRectanglePropertiesEXT{}; VkPhysicalDeviceDriverProperties PhysicalDeviceDriverProperties{}; VkPhysicalDeviceDrmPropertiesEXT PhysicalDeviceDrmPropertiesEXT{}; @@ -3415,19 +5165,19 @@ struct phys_device_props2_chain { VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR PhysicalDeviceFragmentShaderBarycentricPropertiesKHR{}; VkPhysicalDeviceFragmentShadingRatePropertiesKHR PhysicalDeviceFragmentShadingRatePropertiesKHR{}; VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT{}; - VkPhysicalDeviceHostImageCopyPropertiesEXT PhysicalDeviceHostImageCopyPropertiesEXT{}; - std::vector VkPhysicalDeviceHostImageCopyPropertiesEXT_pCopySrcLayouts; - std::vector VkPhysicalDeviceHostImageCopyPropertiesEXT_pCopyDstLayouts; + VkPhysicalDeviceHostImageCopyProperties PhysicalDeviceHostImageCopyProperties{}; + std::vector VkPhysicalDeviceHostImageCopyProperties_pCopySrcLayouts; + std::vector VkPhysicalDeviceHostImageCopyProperties_pCopyDstLayouts; VkPhysicalDeviceIDProperties PhysicalDeviceIDProperties{}; VkPhysicalDeviceInlineUniformBlockProperties PhysicalDeviceInlineUniformBlockProperties{}; VkPhysicalDeviceLayeredApiPropertiesListKHR PhysicalDeviceLayeredApiPropertiesListKHR{}; std::vector VkPhysicalDeviceLayeredApiPropertiesListKHR_pLayeredApis; VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT PhysicalDeviceLegacyVertexAttributesPropertiesEXT{}; - VkPhysicalDeviceLineRasterizationPropertiesKHR PhysicalDeviceLineRasterizationPropertiesKHR{}; + VkPhysicalDeviceLineRasterizationProperties PhysicalDeviceLineRasterizationProperties{}; VkPhysicalDeviceMaintenance3Properties PhysicalDeviceMaintenance3Properties{}; VkPhysicalDeviceMaintenance4Properties PhysicalDeviceMaintenance4Properties{}; - VkPhysicalDeviceMaintenance5PropertiesKHR PhysicalDeviceMaintenance5PropertiesKHR{}; - VkPhysicalDeviceMaintenance6PropertiesKHR PhysicalDeviceMaintenance6PropertiesKHR{}; + VkPhysicalDeviceMaintenance5Properties PhysicalDeviceMaintenance5Properties{}; + VkPhysicalDeviceMaintenance6Properties PhysicalDeviceMaintenance6Properties{}; VkPhysicalDeviceMaintenance7PropertiesKHR PhysicalDeviceMaintenance7PropertiesKHR{}; VkPhysicalDeviceMapMemoryPlacedPropertiesEXT PhysicalDeviceMapMemoryPlacedPropertiesEXT{}; VkPhysicalDeviceMeshShaderPropertiesEXT PhysicalDeviceMeshShaderPropertiesEXT{}; @@ -3437,14 +5187,15 @@ struct phys_device_props2_chain { VkPhysicalDeviceOpacityMicromapPropertiesEXT PhysicalDeviceOpacityMicromapPropertiesEXT{}; VkPhysicalDevicePCIBusInfoPropertiesEXT PhysicalDevicePCIBusInfoPropertiesEXT{}; VkPhysicalDevicePerformanceQueryPropertiesKHR PhysicalDevicePerformanceQueryPropertiesKHR{}; - VkPhysicalDevicePipelineRobustnessPropertiesEXT PhysicalDevicePipelineRobustnessPropertiesEXT{}; + VkPhysicalDevicePipelineBinaryPropertiesKHR PhysicalDevicePipelineBinaryPropertiesKHR{}; + VkPhysicalDevicePipelineRobustnessProperties PhysicalDevicePipelineRobustnessProperties{}; VkPhysicalDevicePointClippingProperties PhysicalDevicePointClippingProperties{}; #ifdef VK_ENABLE_BETA_EXTENSIONS VkPhysicalDevicePortabilitySubsetPropertiesKHR PhysicalDevicePortabilitySubsetPropertiesKHR{}; #endif // VK_ENABLE_BETA_EXTENSIONS VkPhysicalDeviceProtectedMemoryProperties PhysicalDeviceProtectedMemoryProperties{}; VkPhysicalDeviceProvokingVertexPropertiesEXT PhysicalDeviceProvokingVertexPropertiesEXT{}; - VkPhysicalDevicePushDescriptorPropertiesKHR PhysicalDevicePushDescriptorPropertiesKHR{}; + VkPhysicalDevicePushDescriptorProperties PhysicalDevicePushDescriptorProperties{}; VkPhysicalDeviceRayTracingPipelinePropertiesKHR PhysicalDeviceRayTracingPipelinePropertiesKHR{}; VkPhysicalDeviceRobustness2PropertiesEXT PhysicalDeviceRobustness2PropertiesEXT{}; VkPhysicalDeviceSampleLocationsPropertiesEXT PhysicalDeviceSampleLocationsPropertiesEXT{}; @@ -3458,14 +5209,18 @@ struct phys_device_props2_chain { VkPhysicalDeviceTexelBufferAlignmentProperties PhysicalDeviceTexelBufferAlignmentProperties{}; VkPhysicalDeviceTimelineSemaphoreProperties PhysicalDeviceTimelineSemaphoreProperties{}; VkPhysicalDeviceTransformFeedbackPropertiesEXT PhysicalDeviceTransformFeedbackPropertiesEXT{}; + VkPhysicalDeviceVertexAttributeDivisorProperties PhysicalDeviceVertexAttributeDivisorProperties{}; VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT PhysicalDeviceVertexAttributeDivisorPropertiesEXT{}; - VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR PhysicalDeviceVertexAttributeDivisorPropertiesKHR{}; VkPhysicalDeviceVulkan11Properties PhysicalDeviceVulkan11Properties{}; VkPhysicalDeviceVulkan12Properties PhysicalDeviceVulkan12Properties{}; VkPhysicalDeviceVulkan13Properties PhysicalDeviceVulkan13Properties{}; + VkPhysicalDeviceVulkan14Properties PhysicalDeviceVulkan14Properties{}; + std::vector VkPhysicalDeviceVulkan14Properties_pCopySrcLayouts; + std::vector VkPhysicalDeviceVulkan14Properties_pCopyDstLayouts; void initialize_chain(AppInstance &inst, AppGpu &gpu , bool show_promoted_structs) noexcept { PhysicalDeviceAccelerationStructurePropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR; PhysicalDeviceBlendOperationAdvancedPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT; + PhysicalDeviceComputeShaderDerivativesPropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR; PhysicalDeviceConservativeRasterizationPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT; PhysicalDeviceCooperativeMatrixPropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR; PhysicalDeviceCustomBorderColorPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT; @@ -3473,6 +5228,7 @@ struct phys_device_props2_chain { PhysicalDeviceDescriptorBufferDensityMapPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT; PhysicalDeviceDescriptorBufferPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT; PhysicalDeviceDescriptorIndexingProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES; + PhysicalDeviceDeviceGeneratedCommandsPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT; PhysicalDeviceDiscardRectanglePropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT; PhysicalDeviceDriverProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES; PhysicalDeviceDrmPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT; @@ -3484,16 +5240,16 @@ struct phys_device_props2_chain { PhysicalDeviceFragmentShaderBarycentricPropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR; PhysicalDeviceFragmentShadingRatePropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR; PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT; - PhysicalDeviceHostImageCopyPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT; + PhysicalDeviceHostImageCopyProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES; PhysicalDeviceIDProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES; PhysicalDeviceInlineUniformBlockProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES; PhysicalDeviceLayeredApiPropertiesListKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_LIST_KHR; PhysicalDeviceLegacyVertexAttributesPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT; - PhysicalDeviceLineRasterizationPropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR; + PhysicalDeviceLineRasterizationProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES; PhysicalDeviceMaintenance3Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES; PhysicalDeviceMaintenance4Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES; - PhysicalDeviceMaintenance5PropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR; - PhysicalDeviceMaintenance6PropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES_KHR; + PhysicalDeviceMaintenance5Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES; + PhysicalDeviceMaintenance6Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES; PhysicalDeviceMaintenance7PropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR; PhysicalDeviceMapMemoryPlacedPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_PROPERTIES_EXT; PhysicalDeviceMeshShaderPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT; @@ -3503,14 +5259,15 @@ struct phys_device_props2_chain { PhysicalDeviceOpacityMicromapPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT; PhysicalDevicePCIBusInfoPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT; PhysicalDevicePerformanceQueryPropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR; - PhysicalDevicePipelineRobustnessPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT; + PhysicalDevicePipelineBinaryPropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR; + PhysicalDevicePipelineRobustnessProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES; PhysicalDevicePointClippingProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES; #ifdef VK_ENABLE_BETA_EXTENSIONS PhysicalDevicePortabilitySubsetPropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR; #endif // VK_ENABLE_BETA_EXTENSIONS PhysicalDeviceProtectedMemoryProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES; PhysicalDeviceProvokingVertexPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT; - PhysicalDevicePushDescriptorPropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR; + PhysicalDevicePushDescriptorProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES; PhysicalDeviceRayTracingPipelinePropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR; PhysicalDeviceRobustness2PropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT; PhysicalDeviceSampleLocationsPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT; @@ -3524,16 +5281,19 @@ struct phys_device_props2_chain { PhysicalDeviceTexelBufferAlignmentProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES; PhysicalDeviceTimelineSemaphoreProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES; PhysicalDeviceTransformFeedbackPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; + PhysicalDeviceVertexAttributeDivisorProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES; PhysicalDeviceVertexAttributeDivisorPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT; - PhysicalDeviceVertexAttributeDivisorPropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR; PhysicalDeviceVulkan11Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES; PhysicalDeviceVulkan12Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES; PhysicalDeviceVulkan13Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES; + PhysicalDeviceVulkan14Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES; std::vector chain_members{}; if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceAccelerationStructurePropertiesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceBlendOperationAdvancedPropertiesEXT)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceComputeShaderDerivativesPropertiesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceConservativeRasterizationPropertiesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME)) @@ -3550,6 +5310,8 @@ struct phys_device_props2_chain { if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_2 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceDescriptorIndexingProperties)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceDeviceGeneratedCommandsPropertiesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceDiscardRectanglePropertiesEXT)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME)) @@ -3574,8 +5336,9 @@ struct phys_device_props2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceFragmentShadingRatePropertiesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_HOST_IMAGE_COPY_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceHostImageCopyPropertiesEXT)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_HOST_IMAGE_COPY_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceHostImageCopyProperties)); if ((inst.CheckExtensionEnabled(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) || inst.CheckExtensionEnabled(VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME) || inst.CheckExtensionEnabled(VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME)) @@ -3588,19 +5351,22 @@ struct phys_device_props2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceLayeredApiPropertiesListKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceLegacyVertexAttributesPropertiesEXT)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME) + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME) || gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceLineRasterizationPropertiesKHR)); + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceLineRasterizationProperties)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_3_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_1 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance3Properties)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_4_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_3 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance4Properties)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance5PropertiesKHR)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_6_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance6PropertiesKHR)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance5Properties)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_6_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance6Properties)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_7_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance7PropertiesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_MAP_MEMORY_PLACED_EXTENSION_NAME)) @@ -3620,8 +5386,11 @@ struct phys_device_props2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDevicePCIBusInfoPropertiesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDevicePerformanceQueryPropertiesKHR)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PIPELINE_ROBUSTNESS_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDevicePipelineRobustnessPropertiesEXT)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_PIPELINE_BINARY_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDevicePipelineBinaryPropertiesKHR)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PIPELINE_ROBUSTNESS_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDevicePipelineRobustnessProperties)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_2_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_1 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDevicePointClippingProperties)); @@ -3633,8 +5402,9 @@ struct phys_device_props2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceProtectedMemoryProperties)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceProvokingVertexPropertiesEXT)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDevicePushDescriptorPropertiesKHR)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDevicePushDescriptorProperties)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceRayTracingPipelinePropertiesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME)) @@ -3666,16 +5436,19 @@ struct phys_device_props2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceTimelineSemaphoreProperties)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceTransformFeedbackPropertiesEXT)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceVertexAttributeDivisorProperties)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVertexAttributeDivisorPropertiesEXT)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceVertexAttributeDivisorPropertiesKHR)); if ((gpu.api_version >= VK_API_VERSION_1_2)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVulkan11Properties)); if ((gpu.api_version >= VK_API_VERSION_1_2)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVulkan12Properties)); if ((gpu.api_version >= VK_API_VERSION_1_3)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVulkan13Properties)); + if ((gpu.api_version >= VK_API_VERSION_1_4)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceVulkan14Properties)); if (!chain_members.empty()) { for(size_t i = 0; i < chain_members.size() - 1; i++){ @@ -3691,338 +5464,364 @@ void setup_phys_device_props2_chain(VkPhysicalDeviceProperties2& start, std::uni start.pNext = chain->start_of_chain; }; -void chain_iterator_phys_device_props2(Printer &p, AppInstance &inst, AppGpu &gpu, bool show_promoted_structs, void * place) { +void chain_iterator_phys_device_props2(Printer &p, AppInstance &inst, AppGpu &gpu, bool show_promoted_structs, const void * place) { while (place) { - struct VkBaseOutStructure *structure = (struct VkBaseOutStructure *)place; + const VkBaseOutStructure *structure = (const VkBaseOutStructure *)place; p.SetSubHeader(); if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR) { - VkPhysicalDeviceAccelerationStructurePropertiesKHR* props = (VkPhysicalDeviceAccelerationStructurePropertiesKHR*)structure; + const VkPhysicalDeviceAccelerationStructurePropertiesKHR* props = (const VkPhysicalDeviceAccelerationStructurePropertiesKHR*)structure; DumpVkPhysicalDeviceAccelerationStructurePropertiesKHR(p, "VkPhysicalDeviceAccelerationStructurePropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT) { - VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* props = (VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT*)structure; + const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* props = (const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT*)structure; DumpVkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(p, "VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR) { + const VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR* props = (const VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR*)structure; + DumpVkPhysicalDeviceComputeShaderDerivativesPropertiesKHR(p, "VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT) { - VkPhysicalDeviceConservativeRasterizationPropertiesEXT* props = (VkPhysicalDeviceConservativeRasterizationPropertiesEXT*)structure; + const VkPhysicalDeviceConservativeRasterizationPropertiesEXT* props = (const VkPhysicalDeviceConservativeRasterizationPropertiesEXT*)structure; DumpVkPhysicalDeviceConservativeRasterizationPropertiesEXT(p, "VkPhysicalDeviceConservativeRasterizationPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR) { - VkPhysicalDeviceCooperativeMatrixPropertiesKHR* props = (VkPhysicalDeviceCooperativeMatrixPropertiesKHR*)structure; + const VkPhysicalDeviceCooperativeMatrixPropertiesKHR* props = (const VkPhysicalDeviceCooperativeMatrixPropertiesKHR*)structure; DumpVkPhysicalDeviceCooperativeMatrixPropertiesKHR(p, "VkPhysicalDeviceCooperativeMatrixPropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT) { - VkPhysicalDeviceCustomBorderColorPropertiesEXT* props = (VkPhysicalDeviceCustomBorderColorPropertiesEXT*)structure; + const VkPhysicalDeviceCustomBorderColorPropertiesEXT* props = (const VkPhysicalDeviceCustomBorderColorPropertiesEXT*)structure; DumpVkPhysicalDeviceCustomBorderColorPropertiesEXT(p, "VkPhysicalDeviceCustomBorderColorPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES) { - VkPhysicalDeviceDepthStencilResolveProperties* props = (VkPhysicalDeviceDepthStencilResolveProperties*)structure; + const VkPhysicalDeviceDepthStencilResolveProperties* props = (const VkPhysicalDeviceDepthStencilResolveProperties*)structure; DumpVkPhysicalDeviceDepthStencilResolveProperties(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceDepthStencilResolveProperties":"VkPhysicalDeviceDepthStencilResolvePropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT) { - VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT* props = (VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT*)structure; + const VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT* props = (const VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT*)structure; DumpVkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT(p, "VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT) { - VkPhysicalDeviceDescriptorBufferPropertiesEXT* props = (VkPhysicalDeviceDescriptorBufferPropertiesEXT*)structure; + const VkPhysicalDeviceDescriptorBufferPropertiesEXT* props = (const VkPhysicalDeviceDescriptorBufferPropertiesEXT*)structure; DumpVkPhysicalDeviceDescriptorBufferPropertiesEXT(p, "VkPhysicalDeviceDescriptorBufferPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES) { - VkPhysicalDeviceDescriptorIndexingProperties* props = (VkPhysicalDeviceDescriptorIndexingProperties*)structure; + const VkPhysicalDeviceDescriptorIndexingProperties* props = (const VkPhysicalDeviceDescriptorIndexingProperties*)structure; DumpVkPhysicalDeviceDescriptorIndexingProperties(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceDescriptorIndexingProperties":"VkPhysicalDeviceDescriptorIndexingPropertiesEXT", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT) { + const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT* props = (const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT*)structure; + DumpVkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT(p, "VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT) { - VkPhysicalDeviceDiscardRectanglePropertiesEXT* props = (VkPhysicalDeviceDiscardRectanglePropertiesEXT*)structure; + const VkPhysicalDeviceDiscardRectanglePropertiesEXT* props = (const VkPhysicalDeviceDiscardRectanglePropertiesEXT*)structure; DumpVkPhysicalDeviceDiscardRectanglePropertiesEXT(p, "VkPhysicalDeviceDiscardRectanglePropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES) { - VkPhysicalDeviceDriverProperties* props = (VkPhysicalDeviceDriverProperties*)structure; + const VkPhysicalDeviceDriverProperties* props = (const VkPhysicalDeviceDriverProperties*)structure; DumpVkPhysicalDeviceDriverProperties(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceDriverProperties":"VkPhysicalDeviceDriverPropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT) { - VkPhysicalDeviceDrmPropertiesEXT* props = (VkPhysicalDeviceDrmPropertiesEXT*)structure; + const VkPhysicalDeviceDrmPropertiesEXT* props = (const VkPhysicalDeviceDrmPropertiesEXT*)structure; DumpVkPhysicalDeviceDrmPropertiesEXT(p, "VkPhysicalDeviceDrmPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT) { - VkPhysicalDeviceExtendedDynamicState3PropertiesEXT* props = (VkPhysicalDeviceExtendedDynamicState3PropertiesEXT*)structure; + const VkPhysicalDeviceExtendedDynamicState3PropertiesEXT* props = (const VkPhysicalDeviceExtendedDynamicState3PropertiesEXT*)structure; DumpVkPhysicalDeviceExtendedDynamicState3PropertiesEXT(p, "VkPhysicalDeviceExtendedDynamicState3PropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT) { - VkPhysicalDeviceExternalMemoryHostPropertiesEXT* props = (VkPhysicalDeviceExternalMemoryHostPropertiesEXT*)structure; + const VkPhysicalDeviceExternalMemoryHostPropertiesEXT* props = (const VkPhysicalDeviceExternalMemoryHostPropertiesEXT*)structure; DumpVkPhysicalDeviceExternalMemoryHostPropertiesEXT(p, "VkPhysicalDeviceExternalMemoryHostPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES) { - VkPhysicalDeviceFloatControlsProperties* props = (VkPhysicalDeviceFloatControlsProperties*)structure; + const VkPhysicalDeviceFloatControlsProperties* props = (const VkPhysicalDeviceFloatControlsProperties*)structure; DumpVkPhysicalDeviceFloatControlsProperties(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceFloatControlsProperties":"VkPhysicalDeviceFloatControlsPropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT) { - VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* props = (VkPhysicalDeviceFragmentDensityMap2PropertiesEXT*)structure; + const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* props = (const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT*)structure; DumpVkPhysicalDeviceFragmentDensityMap2PropertiesEXT(p, "VkPhysicalDeviceFragmentDensityMap2PropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT) { - VkPhysicalDeviceFragmentDensityMapPropertiesEXT* props = (VkPhysicalDeviceFragmentDensityMapPropertiesEXT*)structure; + const VkPhysicalDeviceFragmentDensityMapPropertiesEXT* props = (const VkPhysicalDeviceFragmentDensityMapPropertiesEXT*)structure; DumpVkPhysicalDeviceFragmentDensityMapPropertiesEXT(p, "VkPhysicalDeviceFragmentDensityMapPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR) { - VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR* props = (VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR*)structure; + const VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR* props = (const VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR*)structure; DumpVkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR(p, "VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR) { - VkPhysicalDeviceFragmentShadingRatePropertiesKHR* props = (VkPhysicalDeviceFragmentShadingRatePropertiesKHR*)structure; + const VkPhysicalDeviceFragmentShadingRatePropertiesKHR* props = (const VkPhysicalDeviceFragmentShadingRatePropertiesKHR*)structure; DumpVkPhysicalDeviceFragmentShadingRatePropertiesKHR(p, "VkPhysicalDeviceFragmentShadingRatePropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT) { - VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT* props = (VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT*)structure; + const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT* props = (const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT*)structure; DumpVkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT(p, "VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT) { - VkPhysicalDeviceHostImageCopyPropertiesEXT* props = (VkPhysicalDeviceHostImageCopyPropertiesEXT*)structure; - DumpVkPhysicalDeviceHostImageCopyPropertiesEXT(p, "VkPhysicalDeviceHostImageCopyPropertiesEXT", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES) { + const VkPhysicalDeviceHostImageCopyProperties* props = (const VkPhysicalDeviceHostImageCopyProperties*)structure; + DumpVkPhysicalDeviceHostImageCopyProperties(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceHostImageCopyProperties":"VkPhysicalDeviceHostImageCopyPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES) { - VkPhysicalDeviceIDProperties* props = (VkPhysicalDeviceIDProperties*)structure; + const VkPhysicalDeviceIDProperties* props = (const VkPhysicalDeviceIDProperties*)structure; DumpVkPhysicalDeviceIDProperties(p, gpu.api_version >= VK_API_VERSION_1_1 ?"VkPhysicalDeviceIDProperties":"VkPhysicalDeviceIDPropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES) { - VkPhysicalDeviceInlineUniformBlockProperties* props = (VkPhysicalDeviceInlineUniformBlockProperties*)structure; + const VkPhysicalDeviceInlineUniformBlockProperties* props = (const VkPhysicalDeviceInlineUniformBlockProperties*)structure; DumpVkPhysicalDeviceInlineUniformBlockProperties(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceInlineUniformBlockProperties":"VkPhysicalDeviceInlineUniformBlockPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_LIST_KHR) { - VkPhysicalDeviceLayeredApiPropertiesListKHR* props = (VkPhysicalDeviceLayeredApiPropertiesListKHR*)structure; + const VkPhysicalDeviceLayeredApiPropertiesListKHR* props = (const VkPhysicalDeviceLayeredApiPropertiesListKHR*)structure; DumpVkPhysicalDeviceLayeredApiPropertiesListKHR(p, "VkPhysicalDeviceLayeredApiPropertiesListKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT) { - VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT* props = (VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT*)structure; + const VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT* props = (const VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT*)structure; DumpVkPhysicalDeviceLegacyVertexAttributesPropertiesEXT(p, "VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR) { - VkPhysicalDeviceLineRasterizationPropertiesKHR* props = (VkPhysicalDeviceLineRasterizationPropertiesKHR*)structure; - DumpVkPhysicalDeviceLineRasterizationPropertiesKHR(p, "VkPhysicalDeviceLineRasterizationPropertiesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES) { + const VkPhysicalDeviceLineRasterizationProperties* props = (const VkPhysicalDeviceLineRasterizationProperties*)structure; + DumpVkPhysicalDeviceLineRasterizationProperties(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceLineRasterizationProperties":"VkPhysicalDeviceLineRasterizationPropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES) { - VkPhysicalDeviceMaintenance3Properties* props = (VkPhysicalDeviceMaintenance3Properties*)structure; + const VkPhysicalDeviceMaintenance3Properties* props = (const VkPhysicalDeviceMaintenance3Properties*)structure; DumpVkPhysicalDeviceMaintenance3Properties(p, gpu.api_version >= VK_API_VERSION_1_1 ?"VkPhysicalDeviceMaintenance3Properties":"VkPhysicalDeviceMaintenance3PropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES) { - VkPhysicalDeviceMaintenance4Properties* props = (VkPhysicalDeviceMaintenance4Properties*)structure; + const VkPhysicalDeviceMaintenance4Properties* props = (const VkPhysicalDeviceMaintenance4Properties*)structure; DumpVkPhysicalDeviceMaintenance4Properties(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceMaintenance4Properties":"VkPhysicalDeviceMaintenance4PropertiesKHR", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR) { - VkPhysicalDeviceMaintenance5PropertiesKHR* props = (VkPhysicalDeviceMaintenance5PropertiesKHR*)structure; - DumpVkPhysicalDeviceMaintenance5PropertiesKHR(p, "VkPhysicalDeviceMaintenance5PropertiesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES) { + const VkPhysicalDeviceMaintenance5Properties* props = (const VkPhysicalDeviceMaintenance5Properties*)structure; + DumpVkPhysicalDeviceMaintenance5Properties(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceMaintenance5Properties":"VkPhysicalDeviceMaintenance5PropertiesKHR", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES_KHR) { - VkPhysicalDeviceMaintenance6PropertiesKHR* props = (VkPhysicalDeviceMaintenance6PropertiesKHR*)structure; - DumpVkPhysicalDeviceMaintenance6PropertiesKHR(p, "VkPhysicalDeviceMaintenance6PropertiesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES) { + const VkPhysicalDeviceMaintenance6Properties* props = (const VkPhysicalDeviceMaintenance6Properties*)structure; + DumpVkPhysicalDeviceMaintenance6Properties(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceMaintenance6Properties":"VkPhysicalDeviceMaintenance6PropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR) { - VkPhysicalDeviceMaintenance7PropertiesKHR* props = (VkPhysicalDeviceMaintenance7PropertiesKHR*)structure; + const VkPhysicalDeviceMaintenance7PropertiesKHR* props = (const VkPhysicalDeviceMaintenance7PropertiesKHR*)structure; DumpVkPhysicalDeviceMaintenance7PropertiesKHR(p, "VkPhysicalDeviceMaintenance7PropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_PROPERTIES_EXT) { - VkPhysicalDeviceMapMemoryPlacedPropertiesEXT* props = (VkPhysicalDeviceMapMemoryPlacedPropertiesEXT*)structure; + const VkPhysicalDeviceMapMemoryPlacedPropertiesEXT* props = (const VkPhysicalDeviceMapMemoryPlacedPropertiesEXT*)structure; DumpVkPhysicalDeviceMapMemoryPlacedPropertiesEXT(p, "VkPhysicalDeviceMapMemoryPlacedPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT) { - VkPhysicalDeviceMeshShaderPropertiesEXT* props = (VkPhysicalDeviceMeshShaderPropertiesEXT*)structure; + const VkPhysicalDeviceMeshShaderPropertiesEXT* props = (const VkPhysicalDeviceMeshShaderPropertiesEXT*)structure; DumpVkPhysicalDeviceMeshShaderPropertiesEXT(p, "VkPhysicalDeviceMeshShaderPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT) { - VkPhysicalDeviceMultiDrawPropertiesEXT* props = (VkPhysicalDeviceMultiDrawPropertiesEXT*)structure; + const VkPhysicalDeviceMultiDrawPropertiesEXT* props = (const VkPhysicalDeviceMultiDrawPropertiesEXT*)structure; DumpVkPhysicalDeviceMultiDrawPropertiesEXT(p, "VkPhysicalDeviceMultiDrawPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES) { - VkPhysicalDeviceMultiviewProperties* props = (VkPhysicalDeviceMultiviewProperties*)structure; + const VkPhysicalDeviceMultiviewProperties* props = (const VkPhysicalDeviceMultiviewProperties*)structure; DumpVkPhysicalDeviceMultiviewProperties(p, gpu.api_version >= VK_API_VERSION_1_1 ?"VkPhysicalDeviceMultiviewProperties":"VkPhysicalDeviceMultiviewPropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT) { - VkPhysicalDeviceNestedCommandBufferPropertiesEXT* props = (VkPhysicalDeviceNestedCommandBufferPropertiesEXT*)structure; + const VkPhysicalDeviceNestedCommandBufferPropertiesEXT* props = (const VkPhysicalDeviceNestedCommandBufferPropertiesEXT*)structure; DumpVkPhysicalDeviceNestedCommandBufferPropertiesEXT(p, "VkPhysicalDeviceNestedCommandBufferPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT) { - VkPhysicalDeviceOpacityMicromapPropertiesEXT* props = (VkPhysicalDeviceOpacityMicromapPropertiesEXT*)structure; + const VkPhysicalDeviceOpacityMicromapPropertiesEXT* props = (const VkPhysicalDeviceOpacityMicromapPropertiesEXT*)structure; DumpVkPhysicalDeviceOpacityMicromapPropertiesEXT(p, "VkPhysicalDeviceOpacityMicromapPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT) { - VkPhysicalDevicePCIBusInfoPropertiesEXT* props = (VkPhysicalDevicePCIBusInfoPropertiesEXT*)structure; + const VkPhysicalDevicePCIBusInfoPropertiesEXT* props = (const VkPhysicalDevicePCIBusInfoPropertiesEXT*)structure; DumpVkPhysicalDevicePCIBusInfoPropertiesEXT(p, "VkPhysicalDevicePCIBusInfoPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR) { - VkPhysicalDevicePerformanceQueryPropertiesKHR* props = (VkPhysicalDevicePerformanceQueryPropertiesKHR*)structure; + const VkPhysicalDevicePerformanceQueryPropertiesKHR* props = (const VkPhysicalDevicePerformanceQueryPropertiesKHR*)structure; DumpVkPhysicalDevicePerformanceQueryPropertiesKHR(p, "VkPhysicalDevicePerformanceQueryPropertiesKHR", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT) { - VkPhysicalDevicePipelineRobustnessPropertiesEXT* props = (VkPhysicalDevicePipelineRobustnessPropertiesEXT*)structure; - DumpVkPhysicalDevicePipelineRobustnessPropertiesEXT(p, "VkPhysicalDevicePipelineRobustnessPropertiesEXT", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR) { + const VkPhysicalDevicePipelineBinaryPropertiesKHR* props = (const VkPhysicalDevicePipelineBinaryPropertiesKHR*)structure; + DumpVkPhysicalDevicePipelineBinaryPropertiesKHR(p, "VkPhysicalDevicePipelineBinaryPropertiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES) { + const VkPhysicalDevicePipelineRobustnessProperties* props = (const VkPhysicalDevicePipelineRobustnessProperties*)structure; + DumpVkPhysicalDevicePipelineRobustnessProperties(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDevicePipelineRobustnessProperties":"VkPhysicalDevicePipelineRobustnessPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES) { - VkPhysicalDevicePointClippingProperties* props = (VkPhysicalDevicePointClippingProperties*)structure; + const VkPhysicalDevicePointClippingProperties* props = (const VkPhysicalDevicePointClippingProperties*)structure; DumpVkPhysicalDevicePointClippingProperties(p, gpu.api_version >= VK_API_VERSION_1_1 ?"VkPhysicalDevicePointClippingProperties":"VkPhysicalDevicePointClippingPropertiesKHR", *props); p.AddNewline(); } #ifdef VK_ENABLE_BETA_EXTENSIONS if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR && p.Type() != OutputType::json) { - VkPhysicalDevicePortabilitySubsetPropertiesKHR* props = (VkPhysicalDevicePortabilitySubsetPropertiesKHR*)structure; + const VkPhysicalDevicePortabilitySubsetPropertiesKHR* props = (const VkPhysicalDevicePortabilitySubsetPropertiesKHR*)structure; DumpVkPhysicalDevicePortabilitySubsetPropertiesKHR(p, "VkPhysicalDevicePortabilitySubsetPropertiesKHR", *props); p.AddNewline(); } #endif // VK_ENABLE_BETA_EXTENSIONS if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES) { - VkPhysicalDeviceProtectedMemoryProperties* props = (VkPhysicalDeviceProtectedMemoryProperties*)structure; + const VkPhysicalDeviceProtectedMemoryProperties* props = (const VkPhysicalDeviceProtectedMemoryProperties*)structure; DumpVkPhysicalDeviceProtectedMemoryProperties(p, "VkPhysicalDeviceProtectedMemoryProperties", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT) { - VkPhysicalDeviceProvokingVertexPropertiesEXT* props = (VkPhysicalDeviceProvokingVertexPropertiesEXT*)structure; + const VkPhysicalDeviceProvokingVertexPropertiesEXT* props = (const VkPhysicalDeviceProvokingVertexPropertiesEXT*)structure; DumpVkPhysicalDeviceProvokingVertexPropertiesEXT(p, "VkPhysicalDeviceProvokingVertexPropertiesEXT", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR) { - VkPhysicalDevicePushDescriptorPropertiesKHR* props = (VkPhysicalDevicePushDescriptorPropertiesKHR*)structure; - DumpVkPhysicalDevicePushDescriptorPropertiesKHR(p, "VkPhysicalDevicePushDescriptorPropertiesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES) { + const VkPhysicalDevicePushDescriptorProperties* props = (const VkPhysicalDevicePushDescriptorProperties*)structure; + DumpVkPhysicalDevicePushDescriptorProperties(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDevicePushDescriptorProperties":"VkPhysicalDevicePushDescriptorPropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR) { - VkPhysicalDeviceRayTracingPipelinePropertiesKHR* props = (VkPhysicalDeviceRayTracingPipelinePropertiesKHR*)structure; + const VkPhysicalDeviceRayTracingPipelinePropertiesKHR* props = (const VkPhysicalDeviceRayTracingPipelinePropertiesKHR*)structure; DumpVkPhysicalDeviceRayTracingPipelinePropertiesKHR(p, "VkPhysicalDeviceRayTracingPipelinePropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT) { - VkPhysicalDeviceRobustness2PropertiesEXT* props = (VkPhysicalDeviceRobustness2PropertiesEXT*)structure; + const VkPhysicalDeviceRobustness2PropertiesEXT* props = (const VkPhysicalDeviceRobustness2PropertiesEXT*)structure; DumpVkPhysicalDeviceRobustness2PropertiesEXT(p, "VkPhysicalDeviceRobustness2PropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT) { - VkPhysicalDeviceSampleLocationsPropertiesEXT* props = (VkPhysicalDeviceSampleLocationsPropertiesEXT*)structure; + const VkPhysicalDeviceSampleLocationsPropertiesEXT* props = (const VkPhysicalDeviceSampleLocationsPropertiesEXT*)structure; DumpVkPhysicalDeviceSampleLocationsPropertiesEXT(p, "VkPhysicalDeviceSampleLocationsPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES) { - VkPhysicalDeviceSamplerFilterMinmaxProperties* props = (VkPhysicalDeviceSamplerFilterMinmaxProperties*)structure; + const VkPhysicalDeviceSamplerFilterMinmaxProperties* props = (const VkPhysicalDeviceSamplerFilterMinmaxProperties*)structure; DumpVkPhysicalDeviceSamplerFilterMinmaxProperties(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceSamplerFilterMinmaxProperties":"VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES) { - VkPhysicalDeviceShaderIntegerDotProductProperties* props = (VkPhysicalDeviceShaderIntegerDotProductProperties*)structure; + const VkPhysicalDeviceShaderIntegerDotProductProperties* props = (const VkPhysicalDeviceShaderIntegerDotProductProperties*)structure; DumpVkPhysicalDeviceShaderIntegerDotProductProperties(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceShaderIntegerDotProductProperties":"VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT) { - VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT* props = (VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT*)structure; + const VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT* props = (const VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT*)structure; DumpVkPhysicalDeviceShaderModuleIdentifierPropertiesEXT(p, "VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT) { - VkPhysicalDeviceShaderObjectPropertiesEXT* props = (VkPhysicalDeviceShaderObjectPropertiesEXT*)structure; + const VkPhysicalDeviceShaderObjectPropertiesEXT* props = (const VkPhysicalDeviceShaderObjectPropertiesEXT*)structure; DumpVkPhysicalDeviceShaderObjectPropertiesEXT(p, "VkPhysicalDeviceShaderObjectPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT) { - VkPhysicalDeviceShaderTileImagePropertiesEXT* props = (VkPhysicalDeviceShaderTileImagePropertiesEXT*)structure; + const VkPhysicalDeviceShaderTileImagePropertiesEXT* props = (const VkPhysicalDeviceShaderTileImagePropertiesEXT*)structure; DumpVkPhysicalDeviceShaderTileImagePropertiesEXT(p, "VkPhysicalDeviceShaderTileImagePropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES) { - VkPhysicalDeviceSubgroupProperties* props = (VkPhysicalDeviceSubgroupProperties*)structure; + const VkPhysicalDeviceSubgroupProperties* props = (const VkPhysicalDeviceSubgroupProperties*)structure; DumpVkPhysicalDeviceSubgroupProperties(p, "VkPhysicalDeviceSubgroupProperties", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES) { - VkPhysicalDeviceSubgroupSizeControlProperties* props = (VkPhysicalDeviceSubgroupSizeControlProperties*)structure; + const VkPhysicalDeviceSubgroupSizeControlProperties* props = (const VkPhysicalDeviceSubgroupSizeControlProperties*)structure; DumpVkPhysicalDeviceSubgroupSizeControlProperties(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceSubgroupSizeControlProperties":"VkPhysicalDeviceSubgroupSizeControlPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES) { - VkPhysicalDeviceTexelBufferAlignmentProperties* props = (VkPhysicalDeviceTexelBufferAlignmentProperties*)structure; + const VkPhysicalDeviceTexelBufferAlignmentProperties* props = (const VkPhysicalDeviceTexelBufferAlignmentProperties*)structure; DumpVkPhysicalDeviceTexelBufferAlignmentProperties(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceTexelBufferAlignmentProperties":"VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES) { - VkPhysicalDeviceTimelineSemaphoreProperties* props = (VkPhysicalDeviceTimelineSemaphoreProperties*)structure; + const VkPhysicalDeviceTimelineSemaphoreProperties* props = (const VkPhysicalDeviceTimelineSemaphoreProperties*)structure; DumpVkPhysicalDeviceTimelineSemaphoreProperties(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceTimelineSemaphoreProperties":"VkPhysicalDeviceTimelineSemaphorePropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT) { - VkPhysicalDeviceTransformFeedbackPropertiesEXT* props = (VkPhysicalDeviceTransformFeedbackPropertiesEXT*)structure; + const VkPhysicalDeviceTransformFeedbackPropertiesEXT* props = (const VkPhysicalDeviceTransformFeedbackPropertiesEXT*)structure; DumpVkPhysicalDeviceTransformFeedbackPropertiesEXT(p, "VkPhysicalDeviceTransformFeedbackPropertiesEXT", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT) { - VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* props = (VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*)structure; - DumpVkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(p, "VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES) { + const VkPhysicalDeviceVertexAttributeDivisorProperties* props = (const VkPhysicalDeviceVertexAttributeDivisorProperties*)structure; + DumpVkPhysicalDeviceVertexAttributeDivisorProperties(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceVertexAttributeDivisorProperties":"VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR) { - VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR* props = (VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR*)structure; - DumpVkPhysicalDeviceVertexAttributeDivisorPropertiesKHR(p, "VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT) { + const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* props = (const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*)structure; + DumpVkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(p, "VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES) { - VkPhysicalDeviceVulkan11Properties* props = (VkPhysicalDeviceVulkan11Properties*)structure; + const VkPhysicalDeviceVulkan11Properties* props = (const VkPhysicalDeviceVulkan11Properties*)structure; DumpVkPhysicalDeviceVulkan11Properties(p, "VkPhysicalDeviceVulkan11Properties", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES) { - VkPhysicalDeviceVulkan12Properties* props = (VkPhysicalDeviceVulkan12Properties*)structure; + const VkPhysicalDeviceVulkan12Properties* props = (const VkPhysicalDeviceVulkan12Properties*)structure; DumpVkPhysicalDeviceVulkan12Properties(p, "VkPhysicalDeviceVulkan12Properties", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES) { - VkPhysicalDeviceVulkan13Properties* props = (VkPhysicalDeviceVulkan13Properties*)structure; + const VkPhysicalDeviceVulkan13Properties* props = (const VkPhysicalDeviceVulkan13Properties*)structure; DumpVkPhysicalDeviceVulkan13Properties(p, "VkPhysicalDeviceVulkan13Properties", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES) { + const VkPhysicalDeviceVulkan14Properties* props = (const VkPhysicalDeviceVulkan14Properties*)structure; + DumpVkPhysicalDeviceVulkan14Properties(p, "VkPhysicalDeviceVulkan14Properties", *props); + p.AddNewline(); + } place = structure->pNext; } } -void prepare_phys_device_props2_twocall_chain_vectors(std::unique_ptr& chain) { - chain->VkPhysicalDeviceHostImageCopyPropertiesEXT_pCopySrcLayouts.resize(chain->PhysicalDeviceHostImageCopyPropertiesEXT.copySrcLayoutCount); - chain->PhysicalDeviceHostImageCopyPropertiesEXT.pCopySrcLayouts = chain->VkPhysicalDeviceHostImageCopyPropertiesEXT_pCopySrcLayouts.data(); - chain->VkPhysicalDeviceHostImageCopyPropertiesEXT_pCopyDstLayouts.resize(chain->PhysicalDeviceHostImageCopyPropertiesEXT.copyDstLayoutCount); - chain->PhysicalDeviceHostImageCopyPropertiesEXT.pCopyDstLayouts = chain->VkPhysicalDeviceHostImageCopyPropertiesEXT_pCopyDstLayouts.data(); +bool prepare_phys_device_props2_twocall_chain_vectors(std::unique_ptr& chain) { + (void)chain; + chain->VkPhysicalDeviceHostImageCopyProperties_pCopySrcLayouts.resize(chain->PhysicalDeviceHostImageCopyProperties.copySrcLayoutCount); + chain->PhysicalDeviceHostImageCopyProperties.pCopySrcLayouts = chain->VkPhysicalDeviceHostImageCopyProperties_pCopySrcLayouts.data(); + chain->VkPhysicalDeviceHostImageCopyProperties_pCopyDstLayouts.resize(chain->PhysicalDeviceHostImageCopyProperties.copyDstLayoutCount); + chain->PhysicalDeviceHostImageCopyProperties.pCopyDstLayouts = chain->VkPhysicalDeviceHostImageCopyProperties_pCopyDstLayouts.data(); chain->VkPhysicalDeviceLayeredApiPropertiesListKHR_pLayeredApis.resize(chain->PhysicalDeviceLayeredApiPropertiesListKHR.layeredApiCount); chain->PhysicalDeviceLayeredApiPropertiesListKHR.pLayeredApis = chain->VkPhysicalDeviceLayeredApiPropertiesListKHR_pLayeredApis.data(); + chain->VkPhysicalDeviceVulkan14Properties_pCopySrcLayouts.resize(chain->PhysicalDeviceVulkan14Properties.copySrcLayoutCount); + chain->PhysicalDeviceVulkan14Properties.pCopySrcLayouts = chain->VkPhysicalDeviceVulkan14Properties_pCopySrcLayouts.data(); + chain->VkPhysicalDeviceVulkan14Properties_pCopyDstLayouts.resize(chain->PhysicalDeviceVulkan14Properties.copyDstLayoutCount); + chain->PhysicalDeviceVulkan14Properties.pCopyDstLayouts = chain->VkPhysicalDeviceVulkan14Properties_pCopyDstLayouts.data(); + return true; } struct phys_device_mem_props2_chain { phys_device_mem_props2_chain() = default; @@ -4051,6 +5850,11 @@ void setup_phys_device_mem_props2_chain(VkPhysicalDeviceMemoryProperties2& start chain->initialize_chain(gpu); start.pNext = chain->start_of_chain; }; + +bool prepare_phys_device_mem_props2_twocall_chain_vectors(std::unique_ptr& chain) { + (void)chain; + return false; +} struct phys_device_features2_chain { phys_device_features2_chain() = default; phys_device_features2_chain(const phys_device_features2_chain &) = delete; @@ -4071,18 +5875,21 @@ struct phys_device_features2_chain { VkPhysicalDeviceBufferDeviceAddressFeatures PhysicalDeviceBufferDeviceAddressFeatures{}; VkPhysicalDeviceBufferDeviceAddressFeaturesEXT PhysicalDeviceBufferDeviceAddressFeaturesEXT{}; VkPhysicalDeviceColorWriteEnableFeaturesEXT PhysicalDeviceColorWriteEnableFeaturesEXT{}; + VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR PhysicalDeviceComputeShaderDerivativesFeaturesKHR{}; VkPhysicalDeviceConditionalRenderingFeaturesEXT PhysicalDeviceConditionalRenderingFeaturesEXT{}; VkPhysicalDeviceCooperativeMatrixFeaturesKHR PhysicalDeviceCooperativeMatrixFeaturesKHR{}; VkPhysicalDeviceCustomBorderColorFeaturesEXT PhysicalDeviceCustomBorderColorFeaturesEXT{}; VkPhysicalDeviceDepthBiasControlFeaturesEXT PhysicalDeviceDepthBiasControlFeaturesEXT{}; - VkPhysicalDeviceDepthClampZeroOneFeaturesEXT PhysicalDeviceDepthClampZeroOneFeaturesEXT{}; + VkPhysicalDeviceDepthClampControlFeaturesEXT PhysicalDeviceDepthClampControlFeaturesEXT{}; + VkPhysicalDeviceDepthClampZeroOneFeaturesKHR PhysicalDeviceDepthClampZeroOneFeaturesKHR{}; VkPhysicalDeviceDepthClipControlFeaturesEXT PhysicalDeviceDepthClipControlFeaturesEXT{}; VkPhysicalDeviceDepthClipEnableFeaturesEXT PhysicalDeviceDepthClipEnableFeaturesEXT{}; VkPhysicalDeviceDescriptorBufferFeaturesEXT PhysicalDeviceDescriptorBufferFeaturesEXT{}; VkPhysicalDeviceDescriptorIndexingFeatures PhysicalDeviceDescriptorIndexingFeatures{}; + VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT PhysicalDeviceDeviceGeneratedCommandsFeaturesEXT{}; VkPhysicalDeviceDeviceMemoryReportFeaturesEXT PhysicalDeviceDeviceMemoryReportFeaturesEXT{}; VkPhysicalDeviceDynamicRenderingFeatures PhysicalDeviceDynamicRenderingFeatures{}; - VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR{}; + VkPhysicalDeviceDynamicRenderingLocalReadFeatures PhysicalDeviceDynamicRenderingLocalReadFeatures{}; VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT PhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT{}; VkPhysicalDeviceExtendedDynamicState2FeaturesEXT PhysicalDeviceExtendedDynamicState2FeaturesEXT{}; VkPhysicalDeviceExtendedDynamicState3FeaturesEXT PhysicalDeviceExtendedDynamicState3FeaturesEXT{}; @@ -4094,10 +5901,9 @@ struct phys_device_features2_chain { VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT PhysicalDeviceFragmentShaderInterlockFeaturesEXT{}; VkPhysicalDeviceFragmentShadingRateFeaturesKHR PhysicalDeviceFragmentShadingRateFeaturesKHR{}; VkPhysicalDeviceFrameBoundaryFeaturesEXT PhysicalDeviceFrameBoundaryFeaturesEXT{}; - VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR PhysicalDeviceGlobalPriorityQueryFeaturesKHR{}; + VkPhysicalDeviceGlobalPriorityQueryFeatures PhysicalDeviceGlobalPriorityQueryFeatures{}; VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT{}; - VkPhysicalDeviceHostImageCopyFeaturesEXT PhysicalDeviceHostImageCopyFeaturesEXT{}; - char VkPhysicalDeviceHostImageCopyFeaturesEXT_padding[64]; + VkPhysicalDeviceHostImageCopyFeatures PhysicalDeviceHostImageCopyFeatures{}; VkPhysicalDeviceHostQueryResetFeatures PhysicalDeviceHostQueryResetFeatures{}; VkPhysicalDeviceImage2DViewOf3DFeaturesEXT PhysicalDeviceImage2DViewOf3DFeaturesEXT{}; VkPhysicalDeviceImageCompressionControlFeaturesEXT PhysicalDeviceImageCompressionControlFeaturesEXT{}; @@ -4106,15 +5912,16 @@ struct phys_device_features2_chain { VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT PhysicalDeviceImageSlicedViewOf3DFeaturesEXT{}; VkPhysicalDeviceImageViewMinLodFeaturesEXT PhysicalDeviceImageViewMinLodFeaturesEXT{}; VkPhysicalDeviceImagelessFramebufferFeatures PhysicalDeviceImagelessFramebufferFeatures{}; - VkPhysicalDeviceIndexTypeUint8FeaturesKHR PhysicalDeviceIndexTypeUint8FeaturesKHR{}; + VkPhysicalDeviceIndexTypeUint8Features PhysicalDeviceIndexTypeUint8Features{}; VkPhysicalDeviceInlineUniformBlockFeatures PhysicalDeviceInlineUniformBlockFeatures{}; VkPhysicalDeviceLegacyDitheringFeaturesEXT PhysicalDeviceLegacyDitheringFeaturesEXT{}; VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT PhysicalDeviceLegacyVertexAttributesFeaturesEXT{}; - VkPhysicalDeviceLineRasterizationFeaturesKHR PhysicalDeviceLineRasterizationFeaturesKHR{}; + VkPhysicalDeviceLineRasterizationFeatures PhysicalDeviceLineRasterizationFeatures{}; VkPhysicalDeviceMaintenance4Features PhysicalDeviceMaintenance4Features{}; - VkPhysicalDeviceMaintenance5FeaturesKHR PhysicalDeviceMaintenance5FeaturesKHR{}; - VkPhysicalDeviceMaintenance6FeaturesKHR PhysicalDeviceMaintenance6FeaturesKHR{}; + VkPhysicalDeviceMaintenance5Features PhysicalDeviceMaintenance5Features{}; + VkPhysicalDeviceMaintenance6Features PhysicalDeviceMaintenance6Features{}; VkPhysicalDeviceMaintenance7FeaturesKHR PhysicalDeviceMaintenance7FeaturesKHR{}; + VkPhysicalDeviceMaintenance8FeaturesKHR PhysicalDeviceMaintenance8FeaturesKHR{}; VkPhysicalDeviceMapMemoryPlacedFeaturesEXT PhysicalDeviceMapMemoryPlacedFeaturesEXT{}; VkPhysicalDeviceMemoryPriorityFeaturesEXT PhysicalDeviceMemoryPriorityFeaturesEXT{}; VkPhysicalDeviceMeshShaderFeaturesEXT PhysicalDeviceMeshShaderFeaturesEXT{}; @@ -4127,16 +5934,18 @@ struct phys_device_features2_chain { VkPhysicalDeviceOpacityMicromapFeaturesEXT PhysicalDeviceOpacityMicromapFeaturesEXT{}; VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT{}; VkPhysicalDevicePerformanceQueryFeaturesKHR PhysicalDevicePerformanceQueryFeaturesKHR{}; + VkPhysicalDevicePipelineBinaryFeaturesKHR PhysicalDevicePipelineBinaryFeaturesKHR{}; VkPhysicalDevicePipelineCreationCacheControlFeatures PhysicalDevicePipelineCreationCacheControlFeatures{}; VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR PhysicalDevicePipelineExecutablePropertiesFeaturesKHR{}; VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT PhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT{}; VkPhysicalDevicePipelinePropertiesFeaturesEXT PhysicalDevicePipelinePropertiesFeaturesEXT{}; - VkPhysicalDevicePipelineProtectedAccessFeaturesEXT PhysicalDevicePipelineProtectedAccessFeaturesEXT{}; - VkPhysicalDevicePipelineRobustnessFeaturesEXT PhysicalDevicePipelineRobustnessFeaturesEXT{}; + VkPhysicalDevicePipelineProtectedAccessFeatures PhysicalDevicePipelineProtectedAccessFeatures{}; + VkPhysicalDevicePipelineRobustnessFeatures PhysicalDevicePipelineRobustnessFeatures{}; #ifdef VK_ENABLE_BETA_EXTENSIONS VkPhysicalDevicePortabilitySubsetFeaturesKHR PhysicalDevicePortabilitySubsetFeaturesKHR{}; #endif // VK_ENABLE_BETA_EXTENSIONS VkPhysicalDevicePresentIdFeaturesKHR PhysicalDevicePresentIdFeaturesKHR{}; + VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT{}; VkPhysicalDevicePresentWaitFeaturesKHR PhysicalDevicePresentWaitFeaturesKHR{}; VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT{}; VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT{}; @@ -4159,9 +5968,9 @@ struct phys_device_features2_chain { VkPhysicalDeviceShaderClockFeaturesKHR PhysicalDeviceShaderClockFeaturesKHR{}; VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures PhysicalDeviceShaderDemoteToHelperInvocationFeatures{}; VkPhysicalDeviceShaderDrawParametersFeatures PhysicalDeviceShaderDrawParametersFeatures{}; - VkPhysicalDeviceShaderExpectAssumeFeaturesKHR PhysicalDeviceShaderExpectAssumeFeaturesKHR{}; + VkPhysicalDeviceShaderExpectAssumeFeatures PhysicalDeviceShaderExpectAssumeFeatures{}; VkPhysicalDeviceShaderFloat16Int8Features PhysicalDeviceShaderFloat16Int8Features{}; - VkPhysicalDeviceShaderFloatControls2FeaturesKHR PhysicalDeviceShaderFloatControls2FeaturesKHR{}; + VkPhysicalDeviceShaderFloatControls2Features PhysicalDeviceShaderFloatControls2Features{}; VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT PhysicalDeviceShaderImageAtomicInt64FeaturesEXT{}; VkPhysicalDeviceShaderIntegerDotProductFeatures PhysicalDeviceShaderIntegerDotProductFeatures{}; char VkPhysicalDeviceShaderIntegerDotProductFeatures_padding[64]; @@ -4172,7 +5981,7 @@ struct phys_device_features2_chain { VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR PhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR{}; VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT PhysicalDeviceShaderReplicatedCompositesFeaturesEXT{}; VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures PhysicalDeviceShaderSubgroupExtendedTypesFeatures{}; - VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR PhysicalDeviceShaderSubgroupRotateFeaturesKHR{}; + VkPhysicalDeviceShaderSubgroupRotateFeatures PhysicalDeviceShaderSubgroupRotateFeatures{}; VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR{}; VkPhysicalDeviceShaderTerminateInvocationFeatures PhysicalDeviceShaderTerminateInvocationFeatures{}; VkPhysicalDeviceShaderTileImageFeaturesEXT PhysicalDeviceShaderTileImageFeaturesEXT{}; @@ -4186,12 +5995,17 @@ struct phys_device_features2_chain { VkPhysicalDeviceTransformFeedbackFeaturesEXT PhysicalDeviceTransformFeedbackFeaturesEXT{}; VkPhysicalDeviceUniformBufferStandardLayoutFeatures PhysicalDeviceUniformBufferStandardLayoutFeatures{}; VkPhysicalDeviceVariablePointersFeatures PhysicalDeviceVariablePointersFeatures{}; - VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR PhysicalDeviceVertexAttributeDivisorFeaturesKHR{}; + VkPhysicalDeviceVertexAttributeDivisorFeatures PhysicalDeviceVertexAttributeDivisorFeatures{}; + VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT PhysicalDeviceVertexAttributeRobustnessFeaturesEXT{}; VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT PhysicalDeviceVertexInputDynamicStateFeaturesEXT{}; + VkPhysicalDeviceVideoEncodeAV1FeaturesKHR PhysicalDeviceVideoEncodeAV1FeaturesKHR{}; + VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR PhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR{}; VkPhysicalDeviceVideoMaintenance1FeaturesKHR PhysicalDeviceVideoMaintenance1FeaturesKHR{}; + VkPhysicalDeviceVideoMaintenance2FeaturesKHR PhysicalDeviceVideoMaintenance2FeaturesKHR{}; VkPhysicalDeviceVulkan11Features PhysicalDeviceVulkan11Features{}; VkPhysicalDeviceVulkan12Features PhysicalDeviceVulkan12Features{}; VkPhysicalDeviceVulkan13Features PhysicalDeviceVulkan13Features{}; + VkPhysicalDeviceVulkan14Features PhysicalDeviceVulkan14Features{}; VkPhysicalDeviceVulkanMemoryModelFeatures PhysicalDeviceVulkanMemoryModelFeatures{}; VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR{}; VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT{}; @@ -4211,18 +6025,21 @@ struct phys_device_features2_chain { PhysicalDeviceBufferDeviceAddressFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES; PhysicalDeviceBufferDeviceAddressFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT; PhysicalDeviceColorWriteEnableFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT; + PhysicalDeviceComputeShaderDerivativesFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR; PhysicalDeviceConditionalRenderingFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT; PhysicalDeviceCooperativeMatrixFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR; PhysicalDeviceCustomBorderColorFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; PhysicalDeviceDepthBiasControlFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT; - PhysicalDeviceDepthClampZeroOneFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT; + PhysicalDeviceDepthClampControlFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT; + PhysicalDeviceDepthClampZeroOneFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_KHR; PhysicalDeviceDepthClipControlFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT; PhysicalDeviceDepthClipEnableFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT; PhysicalDeviceDescriptorBufferFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; PhysicalDeviceDescriptorIndexingFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES; + PhysicalDeviceDeviceGeneratedCommandsFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT; PhysicalDeviceDeviceMemoryReportFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT; PhysicalDeviceDynamicRenderingFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES; - PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES_KHR; + PhysicalDeviceDynamicRenderingLocalReadFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES; PhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT; PhysicalDeviceExtendedDynamicState2FeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT; PhysicalDeviceExtendedDynamicState3FeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT; @@ -4234,9 +6051,9 @@ struct phys_device_features2_chain { PhysicalDeviceFragmentShaderInterlockFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT; PhysicalDeviceFragmentShadingRateFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR; PhysicalDeviceFrameBoundaryFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT; - PhysicalDeviceGlobalPriorityQueryFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR; + PhysicalDeviceGlobalPriorityQueryFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES; PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT; - PhysicalDeviceHostImageCopyFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT; + PhysicalDeviceHostImageCopyFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES; PhysicalDeviceHostQueryResetFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; PhysicalDeviceImage2DViewOf3DFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT; PhysicalDeviceImageCompressionControlFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT; @@ -4245,15 +6062,16 @@ struct phys_device_features2_chain { PhysicalDeviceImageSlicedViewOf3DFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT; PhysicalDeviceImageViewMinLodFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT; PhysicalDeviceImagelessFramebufferFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES; - PhysicalDeviceIndexTypeUint8FeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_KHR; + PhysicalDeviceIndexTypeUint8Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES; PhysicalDeviceInlineUniformBlockFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES; PhysicalDeviceLegacyDitheringFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT; PhysicalDeviceLegacyVertexAttributesFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT; - PhysicalDeviceLineRasterizationFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_KHR; + PhysicalDeviceLineRasterizationFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES; PhysicalDeviceMaintenance4Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES; - PhysicalDeviceMaintenance5FeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR; - PhysicalDeviceMaintenance6FeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES_KHR; + PhysicalDeviceMaintenance5Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES; + PhysicalDeviceMaintenance6Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES; PhysicalDeviceMaintenance7FeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR; + PhysicalDeviceMaintenance8FeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_8_FEATURES_KHR; PhysicalDeviceMapMemoryPlacedFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT; PhysicalDeviceMemoryPriorityFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT; PhysicalDeviceMeshShaderFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT; @@ -4266,16 +6084,18 @@ struct phys_device_features2_chain { PhysicalDeviceOpacityMicromapFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT; PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT; PhysicalDevicePerformanceQueryFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR; + PhysicalDevicePipelineBinaryFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR; PhysicalDevicePipelineCreationCacheControlFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES; PhysicalDevicePipelineExecutablePropertiesFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; PhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT; PhysicalDevicePipelinePropertiesFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT; - PhysicalDevicePipelineProtectedAccessFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT; - PhysicalDevicePipelineRobustnessFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT; + PhysicalDevicePipelineProtectedAccessFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES; + PhysicalDevicePipelineRobustnessFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES; #ifdef VK_ENABLE_BETA_EXTENSIONS PhysicalDevicePortabilitySubsetFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR; #endif // VK_ENABLE_BETA_EXTENSIONS PhysicalDevicePresentIdFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR; + PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT; PhysicalDevicePresentWaitFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR; PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT; @@ -4298,9 +6118,9 @@ struct phys_device_features2_chain { PhysicalDeviceShaderClockFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR; PhysicalDeviceShaderDemoteToHelperInvocationFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; PhysicalDeviceShaderDrawParametersFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES; - PhysicalDeviceShaderExpectAssumeFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES_KHR; + PhysicalDeviceShaderExpectAssumeFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES; PhysicalDeviceShaderFloat16Int8Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES; - PhysicalDeviceShaderFloatControls2FeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES_KHR; + PhysicalDeviceShaderFloatControls2Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES; PhysicalDeviceShaderImageAtomicInt64FeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT; PhysicalDeviceShaderIntegerDotProductFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES; PhysicalDeviceShaderMaximalReconvergenceFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR; @@ -4310,7 +6130,7 @@ struct phys_device_features2_chain { PhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR; PhysicalDeviceShaderReplicatedCompositesFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT; PhysicalDeviceShaderSubgroupExtendedTypesFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES; - PhysicalDeviceShaderSubgroupRotateFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES_KHR; + PhysicalDeviceShaderSubgroupRotateFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES; PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR; PhysicalDeviceShaderTerminateInvocationFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES; PhysicalDeviceShaderTileImageFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT; @@ -4324,12 +6144,17 @@ struct phys_device_features2_chain { PhysicalDeviceTransformFeedbackFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; PhysicalDeviceUniformBufferStandardLayoutFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES; PhysicalDeviceVariablePointersFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES; - PhysicalDeviceVertexAttributeDivisorFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR; + PhysicalDeviceVertexAttributeDivisorFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES; + PhysicalDeviceVertexAttributeRobustnessFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT; PhysicalDeviceVertexInputDynamicStateFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; + PhysicalDeviceVideoEncodeAV1FeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR; + PhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR; PhysicalDeviceVideoMaintenance1FeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR; + PhysicalDeviceVideoMaintenance2FeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_2_FEATURES_KHR; PhysicalDeviceVulkan11Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES; PhysicalDeviceVulkan12Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; PhysicalDeviceVulkan13Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; + PhysicalDeviceVulkan14Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES; PhysicalDeviceVulkanMemoryModelFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES; PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT; @@ -4365,6 +6190,9 @@ struct phys_device_features2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceBufferDeviceAddressFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceColorWriteEnableFeaturesEXT)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME) + || gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceComputeShaderDerivativesFeaturesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceConditionalRenderingFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME)) @@ -4373,8 +6201,11 @@ struct phys_device_features2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceCustomBorderColorFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DEPTH_BIAS_CONTROL_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceDepthBiasControlFeaturesEXT)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DEPTH_CLAMP_ZERO_ONE_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceDepthClampZeroOneFeaturesEXT)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DEPTH_CLAMP_CONTROL_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceDepthClampControlFeaturesEXT)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DEPTH_CLAMP_ZERO_ONE_EXTENSION_NAME) + || gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_DEPTH_CLAMP_ZERO_ONE_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceDepthClampZeroOneFeaturesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceDepthClipControlFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME)) @@ -4384,13 +6215,16 @@ struct phys_device_features2_chain { if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_2 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceDescriptorIndexingFeatures)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceDeviceGeneratedCommandsFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DEVICE_MEMORY_REPORT_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceDeviceMemoryReportFeaturesEXT)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_3 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceDynamicRenderingFeatures)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceDynamicRenderingLocalReadFeatures)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME)) @@ -4414,13 +6248,15 @@ struct phys_device_features2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceFragmentShadingRateFeaturesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_FRAME_BOUNDARY_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceFrameBoundaryFeaturesEXT)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME) + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME) || gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_GLOBAL_PRIORITY_QUERY_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceGlobalPriorityQueryFeaturesKHR)); + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceGlobalPriorityQueryFeatures)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_HOST_IMAGE_COPY_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceHostImageCopyFeaturesEXT)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_HOST_IMAGE_COPY_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceHostImageCopyFeatures)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_2 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceHostQueryResetFeatures)); @@ -4440,9 +6276,10 @@ struct phys_device_features2_chain { if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_2 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceImagelessFramebufferFeatures)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME) + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME) || gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_INDEX_TYPE_UINT8_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceIndexTypeUint8FeaturesKHR)); + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceIndexTypeUint8Features)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_3 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceInlineUniformBlockFeatures)); @@ -4450,18 +6287,23 @@ struct phys_device_features2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceLegacyDitheringFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceLegacyVertexAttributesFeaturesEXT)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME) + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME) || gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceLineRasterizationFeaturesKHR)); + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceLineRasterizationFeatures)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_4_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_3 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance4Features)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance5FeaturesKHR)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_6_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance6FeaturesKHR)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance5Features)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_6_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance6Features)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_7_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance7FeaturesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE_8_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceMaintenance8FeaturesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_MAP_MEMORY_PLACED_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceMapMemoryPlacedFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME)) @@ -4488,6 +6330,8 @@ struct phys_device_features2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDevicePerformanceQueryFeaturesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_PIPELINE_BINARY_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDevicePipelineBinaryFeaturesKHR)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_3 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDevicePipelineCreationCacheControlFeatures)); @@ -4497,16 +6341,20 @@ struct phys_device_features2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PIPELINE_PROPERTIES_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDevicePipelinePropertiesFeaturesEXT)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PIPELINE_PROTECTED_ACCESS_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDevicePipelineProtectedAccessFeaturesEXT)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PIPELINE_ROBUSTNESS_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDevicePipelineRobustnessFeaturesEXT)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PIPELINE_PROTECTED_ACCESS_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDevicePipelineProtectedAccessFeatures)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PIPELINE_ROBUSTNESS_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDevicePipelineRobustnessFeatures)); #ifdef VK_ENABLE_BETA_EXTENSIONS if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDevicePortabilitySubsetFeaturesKHR)); #endif // VK_ENABLE_BETA_EXTENSIONS if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_PRESENT_ID_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDevicePresentIdFeaturesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PRESENT_MODE_FIFO_LATEST_READY_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_PRESENT_WAIT_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDevicePresentWaitFeaturesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME)) @@ -4558,13 +6406,15 @@ struct phys_device_features2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceShaderDemoteToHelperInvocationFeatures)); if (gpu.api_version == VK_API_VERSION_1_1 || show_promoted_structs) chain_members.push_back(reinterpret_cast(&PhysicalDeviceShaderDrawParametersFeatures)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_SHADER_EXPECT_ASSUME_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceShaderExpectAssumeFeaturesKHR)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_SHADER_EXPECT_ASSUME_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceShaderExpectAssumeFeatures)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_2 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceShaderFloat16Int8Features)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_SHADER_FLOAT_CONTROLS_2_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceShaderFloatControls2FeaturesKHR)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_SHADER_FLOAT_CONTROLS_2_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceShaderFloatControls2Features)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceShaderImageAtomicInt64FeaturesEXT)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_SHADER_INTEGER_DOT_PRODUCT_EXTENSION_NAME)) @@ -4585,8 +6435,9 @@ struct phys_device_features2_chain { if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_SHADER_SUBGROUP_EXTENDED_TYPES_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_2 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceShaderSubgroupExtendedTypesFeatures)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_SHADER_SUBGROUP_ROTATE_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceShaderSubgroupRotateFeaturesKHR)); + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_SHADER_SUBGROUP_ROTATE_EXTENSION_NAME)) + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceShaderSubgroupRotateFeatures)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_SHADER_TERMINATE_INVOCATION_EXTENSION_NAME)) @@ -4620,19 +6471,30 @@ struct phys_device_features2_chain { if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_1 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVariablePointersFeatures)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME) + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME) || gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceVertexAttributeDivisorFeaturesKHR)); + && (gpu.api_version < VK_API_VERSION_1_4 || show_promoted_structs)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceVertexAttributeDivisorFeatures)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_VERTEX_ATTRIBUTE_ROBUSTNESS_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceVertexAttributeRobustnessFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVertexInputDynamicStateFeaturesEXT)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_AV1_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceVideoEncodeAV1FeaturesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVideoMaintenance1FeaturesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_MAINTENANCE_2_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceVideoMaintenance2FeaturesKHR)); if ((gpu.api_version >= VK_API_VERSION_1_2)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVulkan11Features)); if ((gpu.api_version >= VK_API_VERSION_1_2)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVulkan12Features)); if ((gpu.api_version >= VK_API_VERSION_1_3)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVulkan13Features)); + if ((gpu.api_version >= VK_API_VERSION_1_4)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceVulkan14Features)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME)) && (gpu.api_version < VK_API_VERSION_1_2 || show_promoted_structs)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVulkanMemoryModelFeatures)); @@ -4660,690 +6522,750 @@ void setup_phys_device_features2_chain(VkPhysicalDeviceFeatures2& start, std::un start.pNext = chain->start_of_chain; }; -void chain_iterator_phys_device_features2(Printer &p, AppGpu &gpu, bool show_promoted_structs, void * place) { +void chain_iterator_phys_device_features2(Printer &p, AppGpu &gpu, bool show_promoted_structs, const void * place) { while (place) { - struct VkBaseOutStructure *structure = (struct VkBaseOutStructure *)place; + const VkBaseOutStructure *structure = (const VkBaseOutStructure *)place; p.SetSubHeader(); if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES) { - VkPhysicalDevice16BitStorageFeatures* props = (VkPhysicalDevice16BitStorageFeatures*)structure; + const VkPhysicalDevice16BitStorageFeatures* props = (const VkPhysicalDevice16BitStorageFeatures*)structure; DumpVkPhysicalDevice16BitStorageFeatures(p, gpu.api_version >= VK_API_VERSION_1_1 ?"VkPhysicalDevice16BitStorageFeatures":"VkPhysicalDevice16BitStorageFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT) { - VkPhysicalDevice4444FormatsFeaturesEXT* props = (VkPhysicalDevice4444FormatsFeaturesEXT*)structure; + const VkPhysicalDevice4444FormatsFeaturesEXT* props = (const VkPhysicalDevice4444FormatsFeaturesEXT*)structure; DumpVkPhysicalDevice4444FormatsFeaturesEXT(p, "VkPhysicalDevice4444FormatsFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES) { - VkPhysicalDevice8BitStorageFeatures* props = (VkPhysicalDevice8BitStorageFeatures*)structure; + const VkPhysicalDevice8BitStorageFeatures* props = (const VkPhysicalDevice8BitStorageFeatures*)structure; DumpVkPhysicalDevice8BitStorageFeatures(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDevice8BitStorageFeatures":"VkPhysicalDevice8BitStorageFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT) { - VkPhysicalDeviceASTCDecodeFeaturesEXT* props = (VkPhysicalDeviceASTCDecodeFeaturesEXT*)structure; + const VkPhysicalDeviceASTCDecodeFeaturesEXT* props = (const VkPhysicalDeviceASTCDecodeFeaturesEXT*)structure; DumpVkPhysicalDeviceASTCDecodeFeaturesEXT(p, "VkPhysicalDeviceASTCDecodeFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR) { - VkPhysicalDeviceAccelerationStructureFeaturesKHR* props = (VkPhysicalDeviceAccelerationStructureFeaturesKHR*)structure; + const VkPhysicalDeviceAccelerationStructureFeaturesKHR* props = (const VkPhysicalDeviceAccelerationStructureFeaturesKHR*)structure; DumpVkPhysicalDeviceAccelerationStructureFeaturesKHR(p, "VkPhysicalDeviceAccelerationStructureFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT) { - VkPhysicalDeviceAddressBindingReportFeaturesEXT* props = (VkPhysicalDeviceAddressBindingReportFeaturesEXT*)structure; + const VkPhysicalDeviceAddressBindingReportFeaturesEXT* props = (const VkPhysicalDeviceAddressBindingReportFeaturesEXT*)structure; DumpVkPhysicalDeviceAddressBindingReportFeaturesEXT(p, "VkPhysicalDeviceAddressBindingReportFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT) { - VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT* props = (VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT*)structure; + const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT* props = (const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT*)structure; DumpVkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT(p, "VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT) { - VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT* props = (VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT*)structure; + const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT* props = (const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT*)structure; DumpVkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT(p, "VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT) { - VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* props = (VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*)structure; + const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* props = (const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*)structure; DumpVkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(p, "VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT) { - VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* props = (VkPhysicalDeviceBorderColorSwizzleFeaturesEXT*)structure; + const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* props = (const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT*)structure; DumpVkPhysicalDeviceBorderColorSwizzleFeaturesEXT(p, "VkPhysicalDeviceBorderColorSwizzleFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES) { - VkPhysicalDeviceBufferDeviceAddressFeatures* props = (VkPhysicalDeviceBufferDeviceAddressFeatures*)structure; + const VkPhysicalDeviceBufferDeviceAddressFeatures* props = (const VkPhysicalDeviceBufferDeviceAddressFeatures*)structure; DumpVkPhysicalDeviceBufferDeviceAddressFeatures(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceBufferDeviceAddressFeatures":"VkPhysicalDeviceBufferDeviceAddressFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT) { - VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* props = (VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*)structure; + const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* props = (const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*)structure; DumpVkPhysicalDeviceBufferDeviceAddressFeaturesEXT(p, "VkPhysicalDeviceBufferDeviceAddressFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT) { - VkPhysicalDeviceColorWriteEnableFeaturesEXT* props = (VkPhysicalDeviceColorWriteEnableFeaturesEXT*)structure; + const VkPhysicalDeviceColorWriteEnableFeaturesEXT* props = (const VkPhysicalDeviceColorWriteEnableFeaturesEXT*)structure; DumpVkPhysicalDeviceColorWriteEnableFeaturesEXT(p, "VkPhysicalDeviceColorWriteEnableFeaturesEXT", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR) { + const VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR* props = (const VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR*)structure; + DumpVkPhysicalDeviceComputeShaderDerivativesFeaturesKHR(p, "VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT) { - VkPhysicalDeviceConditionalRenderingFeaturesEXT* props = (VkPhysicalDeviceConditionalRenderingFeaturesEXT*)structure; + const VkPhysicalDeviceConditionalRenderingFeaturesEXT* props = (const VkPhysicalDeviceConditionalRenderingFeaturesEXT*)structure; DumpVkPhysicalDeviceConditionalRenderingFeaturesEXT(p, "VkPhysicalDeviceConditionalRenderingFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR) { - VkPhysicalDeviceCooperativeMatrixFeaturesKHR* props = (VkPhysicalDeviceCooperativeMatrixFeaturesKHR*)structure; + const VkPhysicalDeviceCooperativeMatrixFeaturesKHR* props = (const VkPhysicalDeviceCooperativeMatrixFeaturesKHR*)structure; DumpVkPhysicalDeviceCooperativeMatrixFeaturesKHR(p, "VkPhysicalDeviceCooperativeMatrixFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT) { - VkPhysicalDeviceCustomBorderColorFeaturesEXT* props = (VkPhysicalDeviceCustomBorderColorFeaturesEXT*)structure; + const VkPhysicalDeviceCustomBorderColorFeaturesEXT* props = (const VkPhysicalDeviceCustomBorderColorFeaturesEXT*)structure; DumpVkPhysicalDeviceCustomBorderColorFeaturesEXT(p, "VkPhysicalDeviceCustomBorderColorFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT) { - VkPhysicalDeviceDepthBiasControlFeaturesEXT* props = (VkPhysicalDeviceDepthBiasControlFeaturesEXT*)structure; + const VkPhysicalDeviceDepthBiasControlFeaturesEXT* props = (const VkPhysicalDeviceDepthBiasControlFeaturesEXT*)structure; DumpVkPhysicalDeviceDepthBiasControlFeaturesEXT(p, "VkPhysicalDeviceDepthBiasControlFeaturesEXT", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT) { - VkPhysicalDeviceDepthClampZeroOneFeaturesEXT* props = (VkPhysicalDeviceDepthClampZeroOneFeaturesEXT*)structure; - DumpVkPhysicalDeviceDepthClampZeroOneFeaturesEXT(p, "VkPhysicalDeviceDepthClampZeroOneFeaturesEXT", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT) { + const VkPhysicalDeviceDepthClampControlFeaturesEXT* props = (const VkPhysicalDeviceDepthClampControlFeaturesEXT*)structure; + DumpVkPhysicalDeviceDepthClampControlFeaturesEXT(p, "VkPhysicalDeviceDepthClampControlFeaturesEXT", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_KHR) { + const VkPhysicalDeviceDepthClampZeroOneFeaturesKHR* props = (const VkPhysicalDeviceDepthClampZeroOneFeaturesKHR*)structure; + DumpVkPhysicalDeviceDepthClampZeroOneFeaturesKHR(p, "VkPhysicalDeviceDepthClampZeroOneFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT) { - VkPhysicalDeviceDepthClipControlFeaturesEXT* props = (VkPhysicalDeviceDepthClipControlFeaturesEXT*)structure; + const VkPhysicalDeviceDepthClipControlFeaturesEXT* props = (const VkPhysicalDeviceDepthClipControlFeaturesEXT*)structure; DumpVkPhysicalDeviceDepthClipControlFeaturesEXT(p, "VkPhysicalDeviceDepthClipControlFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT) { - VkPhysicalDeviceDepthClipEnableFeaturesEXT* props = (VkPhysicalDeviceDepthClipEnableFeaturesEXT*)structure; + const VkPhysicalDeviceDepthClipEnableFeaturesEXT* props = (const VkPhysicalDeviceDepthClipEnableFeaturesEXT*)structure; DumpVkPhysicalDeviceDepthClipEnableFeaturesEXT(p, "VkPhysicalDeviceDepthClipEnableFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT) { - VkPhysicalDeviceDescriptorBufferFeaturesEXT* props = (VkPhysicalDeviceDescriptorBufferFeaturesEXT*)structure; + const VkPhysicalDeviceDescriptorBufferFeaturesEXT* props = (const VkPhysicalDeviceDescriptorBufferFeaturesEXT*)structure; DumpVkPhysicalDeviceDescriptorBufferFeaturesEXT(p, "VkPhysicalDeviceDescriptorBufferFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES) { - VkPhysicalDeviceDescriptorIndexingFeatures* props = (VkPhysicalDeviceDescriptorIndexingFeatures*)structure; + const VkPhysicalDeviceDescriptorIndexingFeatures* props = (const VkPhysicalDeviceDescriptorIndexingFeatures*)structure; DumpVkPhysicalDeviceDescriptorIndexingFeatures(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceDescriptorIndexingFeatures":"VkPhysicalDeviceDescriptorIndexingFeaturesEXT", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT) { + const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT* props = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT*)structure; + DumpVkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT(p, "VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT) { - VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* props = (VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*)structure; + const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* props = (const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*)structure; DumpVkPhysicalDeviceDeviceMemoryReportFeaturesEXT(p, "VkPhysicalDeviceDeviceMemoryReportFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES) { - VkPhysicalDeviceDynamicRenderingFeatures* props = (VkPhysicalDeviceDynamicRenderingFeatures*)structure; + const VkPhysicalDeviceDynamicRenderingFeatures* props = (const VkPhysicalDeviceDynamicRenderingFeatures*)structure; DumpVkPhysicalDeviceDynamicRenderingFeatures(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceDynamicRenderingFeatures":"VkPhysicalDeviceDynamicRenderingFeaturesKHR", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES_KHR) { - VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR* props = (VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR*)structure; - DumpVkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR(p, "VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES) { + const VkPhysicalDeviceDynamicRenderingLocalReadFeatures* props = (const VkPhysicalDeviceDynamicRenderingLocalReadFeatures*)structure; + DumpVkPhysicalDeviceDynamicRenderingLocalReadFeatures(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceDynamicRenderingLocalReadFeatures":"VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT) { - VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT* props = (VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT*)structure; + const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT* props = (const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT*)structure; DumpVkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT(p, "VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT) { - VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* props = (VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*)structure; + const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* props = (const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*)structure; DumpVkPhysicalDeviceExtendedDynamicState2FeaturesEXT(p, "VkPhysicalDeviceExtendedDynamicState2FeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT) { - VkPhysicalDeviceExtendedDynamicState3FeaturesEXT* props = (VkPhysicalDeviceExtendedDynamicState3FeaturesEXT*)structure; + const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT* props = (const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT*)structure; DumpVkPhysicalDeviceExtendedDynamicState3FeaturesEXT(p, "VkPhysicalDeviceExtendedDynamicState3FeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT) { - VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* props = (VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*)structure; + const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* props = (const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*)structure; DumpVkPhysicalDeviceExtendedDynamicStateFeaturesEXT(p, "VkPhysicalDeviceExtendedDynamicStateFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT) { - VkPhysicalDeviceFaultFeaturesEXT* props = (VkPhysicalDeviceFaultFeaturesEXT*)structure; + const VkPhysicalDeviceFaultFeaturesEXT* props = (const VkPhysicalDeviceFaultFeaturesEXT*)structure; DumpVkPhysicalDeviceFaultFeaturesEXT(p, "VkPhysicalDeviceFaultFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT) { - VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* props = (VkPhysicalDeviceFragmentDensityMap2FeaturesEXT*)structure; + const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* props = (const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT*)structure; DumpVkPhysicalDeviceFragmentDensityMap2FeaturesEXT(p, "VkPhysicalDeviceFragmentDensityMap2FeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT) { - VkPhysicalDeviceFragmentDensityMapFeaturesEXT* props = (VkPhysicalDeviceFragmentDensityMapFeaturesEXT*)structure; + const VkPhysicalDeviceFragmentDensityMapFeaturesEXT* props = (const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*)structure; DumpVkPhysicalDeviceFragmentDensityMapFeaturesEXT(p, "VkPhysicalDeviceFragmentDensityMapFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR) { - VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR* props = (VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR*)structure; + const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR* props = (const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR*)structure; DumpVkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR(p, "VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT) { - VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* props = (VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*)structure; + const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* props = (const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*)structure; DumpVkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(p, "VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR) { - VkPhysicalDeviceFragmentShadingRateFeaturesKHR* props = (VkPhysicalDeviceFragmentShadingRateFeaturesKHR*)structure; + const VkPhysicalDeviceFragmentShadingRateFeaturesKHR* props = (const VkPhysicalDeviceFragmentShadingRateFeaturesKHR*)structure; DumpVkPhysicalDeviceFragmentShadingRateFeaturesKHR(p, "VkPhysicalDeviceFragmentShadingRateFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT) { - VkPhysicalDeviceFrameBoundaryFeaturesEXT* props = (VkPhysicalDeviceFrameBoundaryFeaturesEXT*)structure; + const VkPhysicalDeviceFrameBoundaryFeaturesEXT* props = (const VkPhysicalDeviceFrameBoundaryFeaturesEXT*)structure; DumpVkPhysicalDeviceFrameBoundaryFeaturesEXT(p, "VkPhysicalDeviceFrameBoundaryFeaturesEXT", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR) { - VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR* props = (VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR*)structure; - DumpVkPhysicalDeviceGlobalPriorityQueryFeaturesKHR(p, "VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES) { + const VkPhysicalDeviceGlobalPriorityQueryFeatures* props = (const VkPhysicalDeviceGlobalPriorityQueryFeatures*)structure; + DumpVkPhysicalDeviceGlobalPriorityQueryFeatures(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceGlobalPriorityQueryFeatures":"VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT) { - VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT* props = (VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT*)structure; + const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT* props = (const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT*)structure; DumpVkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT(p, "VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT) { - VkPhysicalDeviceHostImageCopyFeaturesEXT* props = (VkPhysicalDeviceHostImageCopyFeaturesEXT*)structure; - DumpVkPhysicalDeviceHostImageCopyFeaturesEXT(p, "VkPhysicalDeviceHostImageCopyFeaturesEXT", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES) { + const VkPhysicalDeviceHostImageCopyFeatures* props = (const VkPhysicalDeviceHostImageCopyFeatures*)structure; + DumpVkPhysicalDeviceHostImageCopyFeatures(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceHostImageCopyFeatures":"VkPhysicalDeviceHostImageCopyFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES) { - VkPhysicalDeviceHostQueryResetFeatures* props = (VkPhysicalDeviceHostQueryResetFeatures*)structure; + const VkPhysicalDeviceHostQueryResetFeatures* props = (const VkPhysicalDeviceHostQueryResetFeatures*)structure; DumpVkPhysicalDeviceHostQueryResetFeatures(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceHostQueryResetFeatures":"VkPhysicalDeviceHostQueryResetFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT) { - VkPhysicalDeviceImage2DViewOf3DFeaturesEXT* props = (VkPhysicalDeviceImage2DViewOf3DFeaturesEXT*)structure; + const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT* props = (const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT*)structure; DumpVkPhysicalDeviceImage2DViewOf3DFeaturesEXT(p, "VkPhysicalDeviceImage2DViewOf3DFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT) { - VkPhysicalDeviceImageCompressionControlFeaturesEXT* props = (VkPhysicalDeviceImageCompressionControlFeaturesEXT*)structure; + const VkPhysicalDeviceImageCompressionControlFeaturesEXT* props = (const VkPhysicalDeviceImageCompressionControlFeaturesEXT*)structure; DumpVkPhysicalDeviceImageCompressionControlFeaturesEXT(p, "VkPhysicalDeviceImageCompressionControlFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT) { - VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT* props = (VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT*)structure; + const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT* props = (const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT*)structure; DumpVkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT(p, "VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES) { - VkPhysicalDeviceImageRobustnessFeatures* props = (VkPhysicalDeviceImageRobustnessFeatures*)structure; + const VkPhysicalDeviceImageRobustnessFeatures* props = (const VkPhysicalDeviceImageRobustnessFeatures*)structure; DumpVkPhysicalDeviceImageRobustnessFeatures(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceImageRobustnessFeatures":"VkPhysicalDeviceImageRobustnessFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT) { - VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT* props = (VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT*)structure; + const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT* props = (const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT*)structure; DumpVkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT(p, "VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT) { - VkPhysicalDeviceImageViewMinLodFeaturesEXT* props = (VkPhysicalDeviceImageViewMinLodFeaturesEXT*)structure; + const VkPhysicalDeviceImageViewMinLodFeaturesEXT* props = (const VkPhysicalDeviceImageViewMinLodFeaturesEXT*)structure; DumpVkPhysicalDeviceImageViewMinLodFeaturesEXT(p, "VkPhysicalDeviceImageViewMinLodFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES) { - VkPhysicalDeviceImagelessFramebufferFeatures* props = (VkPhysicalDeviceImagelessFramebufferFeatures*)structure; + const VkPhysicalDeviceImagelessFramebufferFeatures* props = (const VkPhysicalDeviceImagelessFramebufferFeatures*)structure; DumpVkPhysicalDeviceImagelessFramebufferFeatures(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceImagelessFramebufferFeatures":"VkPhysicalDeviceImagelessFramebufferFeaturesKHR", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_KHR) { - VkPhysicalDeviceIndexTypeUint8FeaturesKHR* props = (VkPhysicalDeviceIndexTypeUint8FeaturesKHR*)structure; - DumpVkPhysicalDeviceIndexTypeUint8FeaturesKHR(p, "VkPhysicalDeviceIndexTypeUint8FeaturesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES) { + const VkPhysicalDeviceIndexTypeUint8Features* props = (const VkPhysicalDeviceIndexTypeUint8Features*)structure; + DumpVkPhysicalDeviceIndexTypeUint8Features(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceIndexTypeUint8Features":"VkPhysicalDeviceIndexTypeUint8FeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES) { - VkPhysicalDeviceInlineUniformBlockFeatures* props = (VkPhysicalDeviceInlineUniformBlockFeatures*)structure; + const VkPhysicalDeviceInlineUniformBlockFeatures* props = (const VkPhysicalDeviceInlineUniformBlockFeatures*)structure; DumpVkPhysicalDeviceInlineUniformBlockFeatures(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceInlineUniformBlockFeatures":"VkPhysicalDeviceInlineUniformBlockFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT) { - VkPhysicalDeviceLegacyDitheringFeaturesEXT* props = (VkPhysicalDeviceLegacyDitheringFeaturesEXT*)structure; + const VkPhysicalDeviceLegacyDitheringFeaturesEXT* props = (const VkPhysicalDeviceLegacyDitheringFeaturesEXT*)structure; DumpVkPhysicalDeviceLegacyDitheringFeaturesEXT(p, "VkPhysicalDeviceLegacyDitheringFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT) { - VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT* props = (VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT*)structure; + const VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT* props = (const VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT*)structure; DumpVkPhysicalDeviceLegacyVertexAttributesFeaturesEXT(p, "VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_KHR) { - VkPhysicalDeviceLineRasterizationFeaturesKHR* props = (VkPhysicalDeviceLineRasterizationFeaturesKHR*)structure; - DumpVkPhysicalDeviceLineRasterizationFeaturesKHR(p, "VkPhysicalDeviceLineRasterizationFeaturesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES) { + const VkPhysicalDeviceLineRasterizationFeatures* props = (const VkPhysicalDeviceLineRasterizationFeatures*)structure; + DumpVkPhysicalDeviceLineRasterizationFeatures(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceLineRasterizationFeatures":"VkPhysicalDeviceLineRasterizationFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES) { - VkPhysicalDeviceMaintenance4Features* props = (VkPhysicalDeviceMaintenance4Features*)structure; + const VkPhysicalDeviceMaintenance4Features* props = (const VkPhysicalDeviceMaintenance4Features*)structure; DumpVkPhysicalDeviceMaintenance4Features(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceMaintenance4Features":"VkPhysicalDeviceMaintenance4FeaturesKHR", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR) { - VkPhysicalDeviceMaintenance5FeaturesKHR* props = (VkPhysicalDeviceMaintenance5FeaturesKHR*)structure; - DumpVkPhysicalDeviceMaintenance5FeaturesKHR(p, "VkPhysicalDeviceMaintenance5FeaturesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES) { + const VkPhysicalDeviceMaintenance5Features* props = (const VkPhysicalDeviceMaintenance5Features*)structure; + DumpVkPhysicalDeviceMaintenance5Features(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceMaintenance5Features":"VkPhysicalDeviceMaintenance5FeaturesKHR", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES_KHR) { - VkPhysicalDeviceMaintenance6FeaturesKHR* props = (VkPhysicalDeviceMaintenance6FeaturesKHR*)structure; - DumpVkPhysicalDeviceMaintenance6FeaturesKHR(p, "VkPhysicalDeviceMaintenance6FeaturesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES) { + const VkPhysicalDeviceMaintenance6Features* props = (const VkPhysicalDeviceMaintenance6Features*)structure; + DumpVkPhysicalDeviceMaintenance6Features(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceMaintenance6Features":"VkPhysicalDeviceMaintenance6FeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR) { - VkPhysicalDeviceMaintenance7FeaturesKHR* props = (VkPhysicalDeviceMaintenance7FeaturesKHR*)structure; + const VkPhysicalDeviceMaintenance7FeaturesKHR* props = (const VkPhysicalDeviceMaintenance7FeaturesKHR*)structure; DumpVkPhysicalDeviceMaintenance7FeaturesKHR(p, "VkPhysicalDeviceMaintenance7FeaturesKHR", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_8_FEATURES_KHR) { + const VkPhysicalDeviceMaintenance8FeaturesKHR* props = (const VkPhysicalDeviceMaintenance8FeaturesKHR*)structure; + DumpVkPhysicalDeviceMaintenance8FeaturesKHR(p, "VkPhysicalDeviceMaintenance8FeaturesKHR", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT) { - VkPhysicalDeviceMapMemoryPlacedFeaturesEXT* props = (VkPhysicalDeviceMapMemoryPlacedFeaturesEXT*)structure; + const VkPhysicalDeviceMapMemoryPlacedFeaturesEXT* props = (const VkPhysicalDeviceMapMemoryPlacedFeaturesEXT*)structure; DumpVkPhysicalDeviceMapMemoryPlacedFeaturesEXT(p, "VkPhysicalDeviceMapMemoryPlacedFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT) { - VkPhysicalDeviceMemoryPriorityFeaturesEXT* props = (VkPhysicalDeviceMemoryPriorityFeaturesEXT*)structure; + const VkPhysicalDeviceMemoryPriorityFeaturesEXT* props = (const VkPhysicalDeviceMemoryPriorityFeaturesEXT*)structure; DumpVkPhysicalDeviceMemoryPriorityFeaturesEXT(p, "VkPhysicalDeviceMemoryPriorityFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT) { - VkPhysicalDeviceMeshShaderFeaturesEXT* props = (VkPhysicalDeviceMeshShaderFeaturesEXT*)structure; + const VkPhysicalDeviceMeshShaderFeaturesEXT* props = (const VkPhysicalDeviceMeshShaderFeaturesEXT*)structure; DumpVkPhysicalDeviceMeshShaderFeaturesEXT(p, "VkPhysicalDeviceMeshShaderFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT) { - VkPhysicalDeviceMultiDrawFeaturesEXT* props = (VkPhysicalDeviceMultiDrawFeaturesEXT*)structure; + const VkPhysicalDeviceMultiDrawFeaturesEXT* props = (const VkPhysicalDeviceMultiDrawFeaturesEXT*)structure; DumpVkPhysicalDeviceMultiDrawFeaturesEXT(p, "VkPhysicalDeviceMultiDrawFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT) { - VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT* props = (VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT*)structure; + const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT* props = (const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT*)structure; DumpVkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT(p, "VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES) { - VkPhysicalDeviceMultiviewFeatures* props = (VkPhysicalDeviceMultiviewFeatures*)structure; + const VkPhysicalDeviceMultiviewFeatures* props = (const VkPhysicalDeviceMultiviewFeatures*)structure; DumpVkPhysicalDeviceMultiviewFeatures(p, gpu.api_version >= VK_API_VERSION_1_1 ?"VkPhysicalDeviceMultiviewFeatures":"VkPhysicalDeviceMultiviewFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT) { - VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT* props = (VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT*)structure; + const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT* props = (const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT*)structure; DumpVkPhysicalDeviceMutableDescriptorTypeFeaturesEXT(p, "VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT) { - VkPhysicalDeviceNestedCommandBufferFeaturesEXT* props = (VkPhysicalDeviceNestedCommandBufferFeaturesEXT*)structure; + const VkPhysicalDeviceNestedCommandBufferFeaturesEXT* props = (const VkPhysicalDeviceNestedCommandBufferFeaturesEXT*)structure; DumpVkPhysicalDeviceNestedCommandBufferFeaturesEXT(p, "VkPhysicalDeviceNestedCommandBufferFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT) { - VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT* props = (VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT*)structure; + const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT* props = (const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT*)structure; DumpVkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT(p, "VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT) { - VkPhysicalDeviceOpacityMicromapFeaturesEXT* props = (VkPhysicalDeviceOpacityMicromapFeaturesEXT*)structure; + const VkPhysicalDeviceOpacityMicromapFeaturesEXT* props = (const VkPhysicalDeviceOpacityMicromapFeaturesEXT*)structure; DumpVkPhysicalDeviceOpacityMicromapFeaturesEXT(p, "VkPhysicalDeviceOpacityMicromapFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT) { - VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* props = (VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT*)structure; + const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* props = (const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT*)structure; DumpVkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(p, "VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR) { - VkPhysicalDevicePerformanceQueryFeaturesKHR* props = (VkPhysicalDevicePerformanceQueryFeaturesKHR*)structure; + const VkPhysicalDevicePerformanceQueryFeaturesKHR* props = (const VkPhysicalDevicePerformanceQueryFeaturesKHR*)structure; DumpVkPhysicalDevicePerformanceQueryFeaturesKHR(p, "VkPhysicalDevicePerformanceQueryFeaturesKHR", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR) { + const VkPhysicalDevicePipelineBinaryFeaturesKHR* props = (const VkPhysicalDevicePipelineBinaryFeaturesKHR*)structure; + DumpVkPhysicalDevicePipelineBinaryFeaturesKHR(p, "VkPhysicalDevicePipelineBinaryFeaturesKHR", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES) { - VkPhysicalDevicePipelineCreationCacheControlFeatures* props = (VkPhysicalDevicePipelineCreationCacheControlFeatures*)structure; + const VkPhysicalDevicePipelineCreationCacheControlFeatures* props = (const VkPhysicalDevicePipelineCreationCacheControlFeatures*)structure; DumpVkPhysicalDevicePipelineCreationCacheControlFeatures(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDevicePipelineCreationCacheControlFeatures":"VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR) { - VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* props = (VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*)structure; + const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* props = (const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*)structure; DumpVkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(p, "VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT) { - VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT* props = (VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT*)structure; + const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT* props = (const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT*)structure; DumpVkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT(p, "VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT) { - VkPhysicalDevicePipelinePropertiesFeaturesEXT* props = (VkPhysicalDevicePipelinePropertiesFeaturesEXT*)structure; + const VkPhysicalDevicePipelinePropertiesFeaturesEXT* props = (const VkPhysicalDevicePipelinePropertiesFeaturesEXT*)structure; DumpVkPhysicalDevicePipelinePropertiesFeaturesEXT(p, "VkPhysicalDevicePipelinePropertiesFeaturesEXT", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT) { - VkPhysicalDevicePipelineProtectedAccessFeaturesEXT* props = (VkPhysicalDevicePipelineProtectedAccessFeaturesEXT*)structure; - DumpVkPhysicalDevicePipelineProtectedAccessFeaturesEXT(p, "VkPhysicalDevicePipelineProtectedAccessFeaturesEXT", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES) { + const VkPhysicalDevicePipelineProtectedAccessFeatures* props = (const VkPhysicalDevicePipelineProtectedAccessFeatures*)structure; + DumpVkPhysicalDevicePipelineProtectedAccessFeatures(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDevicePipelineProtectedAccessFeatures":"VkPhysicalDevicePipelineProtectedAccessFeaturesEXT", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT) { - VkPhysicalDevicePipelineRobustnessFeaturesEXT* props = (VkPhysicalDevicePipelineRobustnessFeaturesEXT*)structure; - DumpVkPhysicalDevicePipelineRobustnessFeaturesEXT(p, "VkPhysicalDevicePipelineRobustnessFeaturesEXT", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES) { + const VkPhysicalDevicePipelineRobustnessFeatures* props = (const VkPhysicalDevicePipelineRobustnessFeatures*)structure; + DumpVkPhysicalDevicePipelineRobustnessFeatures(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDevicePipelineRobustnessFeatures":"VkPhysicalDevicePipelineRobustnessFeaturesEXT", *props); p.AddNewline(); } #ifdef VK_ENABLE_BETA_EXTENSIONS if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR && p.Type() != OutputType::json) { - VkPhysicalDevicePortabilitySubsetFeaturesKHR* props = (VkPhysicalDevicePortabilitySubsetFeaturesKHR*)structure; + const VkPhysicalDevicePortabilitySubsetFeaturesKHR* props = (const VkPhysicalDevicePortabilitySubsetFeaturesKHR*)structure; DumpVkPhysicalDevicePortabilitySubsetFeaturesKHR(p, "VkPhysicalDevicePortabilitySubsetFeaturesKHR", *props); p.AddNewline(); } #endif // VK_ENABLE_BETA_EXTENSIONS if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR) { - VkPhysicalDevicePresentIdFeaturesKHR* props = (VkPhysicalDevicePresentIdFeaturesKHR*)structure; + const VkPhysicalDevicePresentIdFeaturesKHR* props = (const VkPhysicalDevicePresentIdFeaturesKHR*)structure; DumpVkPhysicalDevicePresentIdFeaturesKHR(p, "VkPhysicalDevicePresentIdFeaturesKHR", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT) { + const VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT* props = (const VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT*)structure; + DumpVkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT(p, "VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR) { - VkPhysicalDevicePresentWaitFeaturesKHR* props = (VkPhysicalDevicePresentWaitFeaturesKHR*)structure; + const VkPhysicalDevicePresentWaitFeaturesKHR* props = (const VkPhysicalDevicePresentWaitFeaturesKHR*)structure; DumpVkPhysicalDevicePresentWaitFeaturesKHR(p, "VkPhysicalDevicePresentWaitFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT) { - VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* props = (VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*)structure; + const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* props = (const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*)structure; DumpVkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(p, "VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT) { - VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT* props = (VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT*)structure; + const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT* props = (const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT*)structure; DumpVkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT(p, "VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES) { - VkPhysicalDevicePrivateDataFeatures* props = (VkPhysicalDevicePrivateDataFeatures*)structure; + const VkPhysicalDevicePrivateDataFeatures* props = (const VkPhysicalDevicePrivateDataFeatures*)structure; DumpVkPhysicalDevicePrivateDataFeatures(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDevicePrivateDataFeatures":"VkPhysicalDevicePrivateDataFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES) { - VkPhysicalDeviceProtectedMemoryFeatures* props = (VkPhysicalDeviceProtectedMemoryFeatures*)structure; + const VkPhysicalDeviceProtectedMemoryFeatures* props = (const VkPhysicalDeviceProtectedMemoryFeatures*)structure; DumpVkPhysicalDeviceProtectedMemoryFeatures(p, "VkPhysicalDeviceProtectedMemoryFeatures", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT) { - VkPhysicalDeviceProvokingVertexFeaturesEXT* props = (VkPhysicalDeviceProvokingVertexFeaturesEXT*)structure; + const VkPhysicalDeviceProvokingVertexFeaturesEXT* props = (const VkPhysicalDeviceProvokingVertexFeaturesEXT*)structure; DumpVkPhysicalDeviceProvokingVertexFeaturesEXT(p, "VkPhysicalDeviceProvokingVertexFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT) { - VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* props = (VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT*)structure; + const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* props = (const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT*)structure; DumpVkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(p, "VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT) { - VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT* props = (VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT*)structure; + const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT* props = (const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT*)structure; DumpVkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT(p, "VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR) { - VkPhysicalDeviceRayQueryFeaturesKHR* props = (VkPhysicalDeviceRayQueryFeaturesKHR*)structure; + const VkPhysicalDeviceRayQueryFeaturesKHR* props = (const VkPhysicalDeviceRayQueryFeaturesKHR*)structure; DumpVkPhysicalDeviceRayQueryFeaturesKHR(p, "VkPhysicalDeviceRayQueryFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR) { - VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR* props = (VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR*)structure; + const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR* props = (const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR*)structure; DumpVkPhysicalDeviceRayTracingMaintenance1FeaturesKHR(p, "VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR) { - VkPhysicalDeviceRayTracingPipelineFeaturesKHR* props = (VkPhysicalDeviceRayTracingPipelineFeaturesKHR*)structure; + const VkPhysicalDeviceRayTracingPipelineFeaturesKHR* props = (const VkPhysicalDeviceRayTracingPipelineFeaturesKHR*)structure; DumpVkPhysicalDeviceRayTracingPipelineFeaturesKHR(p, "VkPhysicalDeviceRayTracingPipelineFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR) { - VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR* props = (VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR*)structure; + const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR* props = (const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR*)structure; DumpVkPhysicalDeviceRayTracingPositionFetchFeaturesKHR(p, "VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT) { - VkPhysicalDeviceRobustness2FeaturesEXT* props = (VkPhysicalDeviceRobustness2FeaturesEXT*)structure; + const VkPhysicalDeviceRobustness2FeaturesEXT* props = (const VkPhysicalDeviceRobustness2FeaturesEXT*)structure; DumpVkPhysicalDeviceRobustness2FeaturesEXT(p, "VkPhysicalDeviceRobustness2FeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES) { - VkPhysicalDeviceSamplerYcbcrConversionFeatures* props = (VkPhysicalDeviceSamplerYcbcrConversionFeatures*)structure; + const VkPhysicalDeviceSamplerYcbcrConversionFeatures* props = (const VkPhysicalDeviceSamplerYcbcrConversionFeatures*)structure; DumpVkPhysicalDeviceSamplerYcbcrConversionFeatures(p, gpu.api_version >= VK_API_VERSION_1_1 ?"VkPhysicalDeviceSamplerYcbcrConversionFeatures":"VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES) { - VkPhysicalDeviceScalarBlockLayoutFeatures* props = (VkPhysicalDeviceScalarBlockLayoutFeatures*)structure; + const VkPhysicalDeviceScalarBlockLayoutFeatures* props = (const VkPhysicalDeviceScalarBlockLayoutFeatures*)structure; DumpVkPhysicalDeviceScalarBlockLayoutFeatures(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceScalarBlockLayoutFeatures":"VkPhysicalDeviceScalarBlockLayoutFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES) { - VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* props = (VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*)structure; + const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* props = (const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*)structure; DumpVkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures":"VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT) { - VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* props = (VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT*)structure; + const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* props = (const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT*)structure; DumpVkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(p, "VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT) { - VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* props = (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*)structure; + const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* props = (const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*)structure; DumpVkPhysicalDeviceShaderAtomicFloatFeaturesEXT(p, "VkPhysicalDeviceShaderAtomicFloatFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES) { - VkPhysicalDeviceShaderAtomicInt64Features* props = (VkPhysicalDeviceShaderAtomicInt64Features*)structure; + const VkPhysicalDeviceShaderAtomicInt64Features* props = (const VkPhysicalDeviceShaderAtomicInt64Features*)structure; DumpVkPhysicalDeviceShaderAtomicInt64Features(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceShaderAtomicInt64Features":"VkPhysicalDeviceShaderAtomicInt64FeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR) { - VkPhysicalDeviceShaderClockFeaturesKHR* props = (VkPhysicalDeviceShaderClockFeaturesKHR*)structure; + const VkPhysicalDeviceShaderClockFeaturesKHR* props = (const VkPhysicalDeviceShaderClockFeaturesKHR*)structure; DumpVkPhysicalDeviceShaderClockFeaturesKHR(p, "VkPhysicalDeviceShaderClockFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES) { - VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures* props = (VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures*)structure; + const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures* props = (const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures*)structure; DumpVkPhysicalDeviceShaderDemoteToHelperInvocationFeatures(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures":"VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES) { - VkPhysicalDeviceShaderDrawParametersFeatures* props = (VkPhysicalDeviceShaderDrawParametersFeatures*)structure; + const VkPhysicalDeviceShaderDrawParametersFeatures* props = (const VkPhysicalDeviceShaderDrawParametersFeatures*)structure; DumpVkPhysicalDeviceShaderDrawParametersFeatures(p, gpu.api_version >= VK_API_VERSION_1_1 ?"VkPhysicalDeviceShaderDrawParametersFeatures":"VkPhysicalDeviceShaderDrawParameterFeatures", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES_KHR) { - VkPhysicalDeviceShaderExpectAssumeFeaturesKHR* props = (VkPhysicalDeviceShaderExpectAssumeFeaturesKHR*)structure; - DumpVkPhysicalDeviceShaderExpectAssumeFeaturesKHR(p, "VkPhysicalDeviceShaderExpectAssumeFeaturesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES) { + const VkPhysicalDeviceShaderExpectAssumeFeatures* props = (const VkPhysicalDeviceShaderExpectAssumeFeatures*)structure; + DumpVkPhysicalDeviceShaderExpectAssumeFeatures(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceShaderExpectAssumeFeatures":"VkPhysicalDeviceShaderExpectAssumeFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES) { - VkPhysicalDeviceShaderFloat16Int8Features* props = (VkPhysicalDeviceShaderFloat16Int8Features*)structure; + const VkPhysicalDeviceShaderFloat16Int8Features* props = (const VkPhysicalDeviceShaderFloat16Int8Features*)structure; DumpVkPhysicalDeviceShaderFloat16Int8Features(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceShaderFloat16Int8Features":"VkPhysicalDeviceFloat16Int8FeaturesKHR", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES_KHR) { - VkPhysicalDeviceShaderFloatControls2FeaturesKHR* props = (VkPhysicalDeviceShaderFloatControls2FeaturesKHR*)structure; - DumpVkPhysicalDeviceShaderFloatControls2FeaturesKHR(p, "VkPhysicalDeviceShaderFloatControls2FeaturesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES) { + const VkPhysicalDeviceShaderFloatControls2Features* props = (const VkPhysicalDeviceShaderFloatControls2Features*)structure; + DumpVkPhysicalDeviceShaderFloatControls2Features(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceShaderFloatControls2Features":"VkPhysicalDeviceShaderFloatControls2FeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT) { - VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* props = (VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*)structure; + const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* props = (const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*)structure; DumpVkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(p, "VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES) { - VkPhysicalDeviceShaderIntegerDotProductFeatures* props = (VkPhysicalDeviceShaderIntegerDotProductFeatures*)structure; + const VkPhysicalDeviceShaderIntegerDotProductFeatures* props = (const VkPhysicalDeviceShaderIntegerDotProductFeatures*)structure; DumpVkPhysicalDeviceShaderIntegerDotProductFeatures(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceShaderIntegerDotProductFeatures":"VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR) { - VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR* props = (VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR*)structure; + const VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR* props = (const VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR*)structure; DumpVkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR(p, "VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT) { - VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT* props = (VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT*)structure; + const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT* props = (const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT*)structure; DumpVkPhysicalDeviceShaderModuleIdentifierFeaturesEXT(p, "VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT) { - VkPhysicalDeviceShaderObjectFeaturesEXT* props = (VkPhysicalDeviceShaderObjectFeaturesEXT*)structure; + const VkPhysicalDeviceShaderObjectFeaturesEXT* props = (const VkPhysicalDeviceShaderObjectFeaturesEXT*)structure; DumpVkPhysicalDeviceShaderObjectFeaturesEXT(p, "VkPhysicalDeviceShaderObjectFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR) { - VkPhysicalDeviceShaderQuadControlFeaturesKHR* props = (VkPhysicalDeviceShaderQuadControlFeaturesKHR*)structure; + const VkPhysicalDeviceShaderQuadControlFeaturesKHR* props = (const VkPhysicalDeviceShaderQuadControlFeaturesKHR*)structure; DumpVkPhysicalDeviceShaderQuadControlFeaturesKHR(p, "VkPhysicalDeviceShaderQuadControlFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR) { - VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR* props = (VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR*)structure; + const VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR* props = (const VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR*)structure; DumpVkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR(p, "VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT) { - VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT* props = (VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT*)structure; + const VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT* props = (const VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT*)structure; DumpVkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT(p, "VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES) { - VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* props = (VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*)structure; + const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* props = (const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*)structure; DumpVkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures":"VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES_KHR) { - VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR* props = (VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR*)structure; - DumpVkPhysicalDeviceShaderSubgroupRotateFeaturesKHR(p, "VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES) { + const VkPhysicalDeviceShaderSubgroupRotateFeatures* props = (const VkPhysicalDeviceShaderSubgroupRotateFeatures*)structure; + DumpVkPhysicalDeviceShaderSubgroupRotateFeatures(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceShaderSubgroupRotateFeatures":"VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR) { - VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* props = (VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR*)structure; + const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* props = (const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR*)structure; DumpVkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(p, "VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES) { - VkPhysicalDeviceShaderTerminateInvocationFeatures* props = (VkPhysicalDeviceShaderTerminateInvocationFeatures*)structure; + const VkPhysicalDeviceShaderTerminateInvocationFeatures* props = (const VkPhysicalDeviceShaderTerminateInvocationFeatures*)structure; DumpVkPhysicalDeviceShaderTerminateInvocationFeatures(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceShaderTerminateInvocationFeatures":"VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT) { - VkPhysicalDeviceShaderTileImageFeaturesEXT* props = (VkPhysicalDeviceShaderTileImageFeaturesEXT*)structure; + const VkPhysicalDeviceShaderTileImageFeaturesEXT* props = (const VkPhysicalDeviceShaderTileImageFeaturesEXT*)structure; DumpVkPhysicalDeviceShaderTileImageFeaturesEXT(p, "VkPhysicalDeviceShaderTileImageFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES) { - VkPhysicalDeviceSubgroupSizeControlFeatures* props = (VkPhysicalDeviceSubgroupSizeControlFeatures*)structure; + const VkPhysicalDeviceSubgroupSizeControlFeatures* props = (const VkPhysicalDeviceSubgroupSizeControlFeatures*)structure; DumpVkPhysicalDeviceSubgroupSizeControlFeatures(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceSubgroupSizeControlFeatures":"VkPhysicalDeviceSubgroupSizeControlFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT) { - VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT* props = (VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT*)structure; + const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT* props = (const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT*)structure; DumpVkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT(p, "VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT) { - VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT* props = (VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT*)structure; + const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT* props = (const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT*)structure; DumpVkPhysicalDeviceSwapchainMaintenance1FeaturesEXT(p, "VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES) { - VkPhysicalDeviceSynchronization2Features* props = (VkPhysicalDeviceSynchronization2Features*)structure; + const VkPhysicalDeviceSynchronization2Features* props = (const VkPhysicalDeviceSynchronization2Features*)structure; DumpVkPhysicalDeviceSynchronization2Features(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceSynchronization2Features":"VkPhysicalDeviceSynchronization2FeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT) { - VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* props = (VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*)structure; + const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* props = (const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*)structure; DumpVkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(p, "VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES) { - VkPhysicalDeviceTextureCompressionASTCHDRFeatures* props = (VkPhysicalDeviceTextureCompressionASTCHDRFeatures*)structure; + const VkPhysicalDeviceTextureCompressionASTCHDRFeatures* props = (const VkPhysicalDeviceTextureCompressionASTCHDRFeatures*)structure; DumpVkPhysicalDeviceTextureCompressionASTCHDRFeatures(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceTextureCompressionASTCHDRFeatures":"VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES) { - VkPhysicalDeviceTimelineSemaphoreFeatures* props = (VkPhysicalDeviceTimelineSemaphoreFeatures*)structure; + const VkPhysicalDeviceTimelineSemaphoreFeatures* props = (const VkPhysicalDeviceTimelineSemaphoreFeatures*)structure; DumpVkPhysicalDeviceTimelineSemaphoreFeatures(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceTimelineSemaphoreFeatures":"VkPhysicalDeviceTimelineSemaphoreFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT) { - VkPhysicalDeviceTransformFeedbackFeaturesEXT* props = (VkPhysicalDeviceTransformFeedbackFeaturesEXT*)structure; + const VkPhysicalDeviceTransformFeedbackFeaturesEXT* props = (const VkPhysicalDeviceTransformFeedbackFeaturesEXT*)structure; DumpVkPhysicalDeviceTransformFeedbackFeaturesEXT(p, "VkPhysicalDeviceTransformFeedbackFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES) { - VkPhysicalDeviceUniformBufferStandardLayoutFeatures* props = (VkPhysicalDeviceUniformBufferStandardLayoutFeatures*)structure; + const VkPhysicalDeviceUniformBufferStandardLayoutFeatures* props = (const VkPhysicalDeviceUniformBufferStandardLayoutFeatures*)structure; DumpVkPhysicalDeviceUniformBufferStandardLayoutFeatures(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceUniformBufferStandardLayoutFeatures":"VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES) { - VkPhysicalDeviceVariablePointersFeatures* props = (VkPhysicalDeviceVariablePointersFeatures*)structure; + const VkPhysicalDeviceVariablePointersFeatures* props = (const VkPhysicalDeviceVariablePointersFeatures*)structure; DumpVkPhysicalDeviceVariablePointersFeatures(p, gpu.api_version >= VK_API_VERSION_1_1 ?"VkPhysicalDeviceVariablePointersFeatures":"VkPhysicalDeviceVariablePointersFeaturesKHR", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR) { - VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR* props = (VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR*)structure; - DumpVkPhysicalDeviceVertexAttributeDivisorFeaturesKHR(p, "VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES) { + const VkPhysicalDeviceVertexAttributeDivisorFeatures* props = (const VkPhysicalDeviceVertexAttributeDivisorFeatures*)structure; + DumpVkPhysicalDeviceVertexAttributeDivisorFeatures(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkPhysicalDeviceVertexAttributeDivisorFeatures":"VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT) { + const VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT* props = (const VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT*)structure; + DumpVkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT(p, "VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT) { - VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* props = (VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*)structure; + const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* props = (const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*)structure; DumpVkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(p, "VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR) { + const VkPhysicalDeviceVideoEncodeAV1FeaturesKHR* props = (const VkPhysicalDeviceVideoEncodeAV1FeaturesKHR*)structure; + DumpVkPhysicalDeviceVideoEncodeAV1FeaturesKHR(p, "VkPhysicalDeviceVideoEncodeAV1FeaturesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR) { + const VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR* props = (const VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR*)structure; + DumpVkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR(p, "VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR) { - VkPhysicalDeviceVideoMaintenance1FeaturesKHR* props = (VkPhysicalDeviceVideoMaintenance1FeaturesKHR*)structure; + const VkPhysicalDeviceVideoMaintenance1FeaturesKHR* props = (const VkPhysicalDeviceVideoMaintenance1FeaturesKHR*)structure; DumpVkPhysicalDeviceVideoMaintenance1FeaturesKHR(p, "VkPhysicalDeviceVideoMaintenance1FeaturesKHR", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_2_FEATURES_KHR) { + const VkPhysicalDeviceVideoMaintenance2FeaturesKHR* props = (const VkPhysicalDeviceVideoMaintenance2FeaturesKHR*)structure; + DumpVkPhysicalDeviceVideoMaintenance2FeaturesKHR(p, "VkPhysicalDeviceVideoMaintenance2FeaturesKHR", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES) { - VkPhysicalDeviceVulkan11Features* props = (VkPhysicalDeviceVulkan11Features*)structure; + const VkPhysicalDeviceVulkan11Features* props = (const VkPhysicalDeviceVulkan11Features*)structure; DumpVkPhysicalDeviceVulkan11Features(p, "VkPhysicalDeviceVulkan11Features", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES) { - VkPhysicalDeviceVulkan12Features* props = (VkPhysicalDeviceVulkan12Features*)structure; + const VkPhysicalDeviceVulkan12Features* props = (const VkPhysicalDeviceVulkan12Features*)structure; DumpVkPhysicalDeviceVulkan12Features(p, "VkPhysicalDeviceVulkan12Features", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES) { - VkPhysicalDeviceVulkan13Features* props = (VkPhysicalDeviceVulkan13Features*)structure; + const VkPhysicalDeviceVulkan13Features* props = (const VkPhysicalDeviceVulkan13Features*)structure; DumpVkPhysicalDeviceVulkan13Features(p, "VkPhysicalDeviceVulkan13Features", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES) { + const VkPhysicalDeviceVulkan14Features* props = (const VkPhysicalDeviceVulkan14Features*)structure; + DumpVkPhysicalDeviceVulkan14Features(p, "VkPhysicalDeviceVulkan14Features", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES) { - VkPhysicalDeviceVulkanMemoryModelFeatures* props = (VkPhysicalDeviceVulkanMemoryModelFeatures*)structure; + const VkPhysicalDeviceVulkanMemoryModelFeatures* props = (const VkPhysicalDeviceVulkanMemoryModelFeatures*)structure; DumpVkPhysicalDeviceVulkanMemoryModelFeatures(p, gpu.api_version >= VK_API_VERSION_1_2 ?"VkPhysicalDeviceVulkanMemoryModelFeatures":"VkPhysicalDeviceVulkanMemoryModelFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR) { - VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* props = (VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR*)structure; + const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* props = (const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR*)structure; DumpVkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(p, "VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT) { - VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* props = (VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*)structure; + const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* props = (const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*)structure; DumpVkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(p, "VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT) { - VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* props = (VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*)structure; + const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* props = (const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*)structure; DumpVkPhysicalDeviceYcbcrImageArraysFeaturesEXT(p, "VkPhysicalDeviceYcbcrImageArraysFeaturesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES) { - VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures* props = (VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures*)structure; + const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures* props = (const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures*)structure; DumpVkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures":"VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR", *props); p.AddNewline(); } place = structure->pNext; } } + +bool prepare_phys_device_features2_twocall_chain_vectors(std::unique_ptr& chain) { + (void)chain; + return false; +} struct surface_capabilities2_chain { surface_capabilities2_chain() = default; surface_capabilities2_chain(const surface_capabilities2_chain &) = delete; @@ -5386,30 +7308,35 @@ void setup_surface_capabilities2_chain(VkSurfaceCapabilities2KHR& start, std::un start.pNext = chain->start_of_chain; }; -void chain_iterator_surface_capabilities2(Printer &p, AppInstance &inst, AppGpu &gpu, void * place) { +void chain_iterator_surface_capabilities2(Printer &p, AppInstance &inst, AppGpu &gpu, const void * place) { while (place) { - struct VkBaseOutStructure *structure = (struct VkBaseOutStructure *)place; + const VkBaseOutStructure *structure = (const VkBaseOutStructure *)place; p.SetSubHeader(); if (structure->sType == VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR) { - VkSharedPresentSurfaceCapabilitiesKHR* props = (VkSharedPresentSurfaceCapabilitiesKHR*)structure; + const VkSharedPresentSurfaceCapabilitiesKHR* props = (const VkSharedPresentSurfaceCapabilitiesKHR*)structure; DumpVkSharedPresentSurfaceCapabilitiesKHR(p, "VkSharedPresentSurfaceCapabilitiesKHR", *props); p.AddNewline(); } #ifdef VK_USE_PLATFORM_WIN32_KHR if (structure->sType == VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT) { - VkSurfaceCapabilitiesFullScreenExclusiveEXT* props = (VkSurfaceCapabilitiesFullScreenExclusiveEXT*)structure; + const VkSurfaceCapabilitiesFullScreenExclusiveEXT* props = (const VkSurfaceCapabilitiesFullScreenExclusiveEXT*)structure; DumpVkSurfaceCapabilitiesFullScreenExclusiveEXT(p, "VkSurfaceCapabilitiesFullScreenExclusiveEXT", *props); p.AddNewline(); } #endif // VK_USE_PLATFORM_WIN32_KHR if (structure->sType == VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR) { - VkSurfaceProtectedCapabilitiesKHR* props = (VkSurfaceProtectedCapabilitiesKHR*)structure; + const VkSurfaceProtectedCapabilitiesKHR* props = (const VkSurfaceProtectedCapabilitiesKHR*)structure; DumpVkSurfaceProtectedCapabilitiesKHR(p, "VkSurfaceProtectedCapabilitiesKHR", *props); p.AddNewline(); } place = structure->pNext; } } + +bool prepare_surface_capabilities2_twocall_chain_vectors(std::unique_ptr& chain) { + (void)chain; + return false; +} struct format_properties2_chain { format_properties2_chain() = default; format_properties2_chain(const format_properties2_chain &) = delete; @@ -5443,23 +7370,28 @@ void setup_format_properties2_chain(VkFormatProperties2& start, std::unique_ptr< start.pNext = chain->start_of_chain; }; -void chain_iterator_format_properties2(Printer &p, AppGpu &gpu, void * place) { +void chain_iterator_format_properties2(Printer &p, AppGpu &gpu, const void * place) { while (place) { - struct VkBaseOutStructure *structure = (struct VkBaseOutStructure *)place; + const VkBaseOutStructure *structure = (const VkBaseOutStructure *)place; p.SetSubHeader(); if (structure->sType == VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3) { - VkFormatProperties3* props = (VkFormatProperties3*)structure; + const VkFormatProperties3* props = (const VkFormatProperties3*)structure; DumpVkFormatProperties3(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkFormatProperties3":"VkFormatProperties3KHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT) { - VkSubpassResolvePerformanceQueryEXT* props = (VkSubpassResolvePerformanceQueryEXT*)structure; + const VkSubpassResolvePerformanceQueryEXT* props = (const VkSubpassResolvePerformanceQueryEXT*)structure; DumpVkSubpassResolvePerformanceQueryEXT(p, "VkSubpassResolvePerformanceQueryEXT", *props); p.AddNewline(); } place = structure->pNext; } } + +bool prepare_format_properties2_twocall_chain_vectors(std::unique_ptr& chain) { + (void)chain; + return false; +} struct queue_properties2_chain { queue_properties2_chain() = default; queue_properties2_chain(const queue_properties2_chain &) = delete; @@ -5467,17 +7399,18 @@ struct queue_properties2_chain { queue_properties2_chain(queue_properties2_chain &&) = delete; queue_properties2_chain& operator=(queue_properties2_chain &&) = delete; void* start_of_chain = nullptr; - VkQueueFamilyGlobalPriorityPropertiesKHR QueueFamilyGlobalPriorityPropertiesKHR{}; + VkQueueFamilyGlobalPriorityProperties QueueFamilyGlobalPriorityProperties{}; VkQueueFamilyQueryResultStatusPropertiesKHR QueueFamilyQueryResultStatusPropertiesKHR{}; VkQueueFamilyVideoPropertiesKHR QueueFamilyVideoPropertiesKHR{}; void initialize_chain(AppGpu &gpu ) noexcept { - QueueFamilyGlobalPriorityPropertiesKHR.sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR; + QueueFamilyGlobalPriorityProperties.sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES; QueueFamilyQueryResultStatusPropertiesKHR.sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR; QueueFamilyVideoPropertiesKHR.sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR; std::vector chain_members{}; - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME) + if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME) || gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_GLOBAL_PRIORITY_QUERY_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&QueueFamilyGlobalPriorityPropertiesKHR)); + && (gpu.api_version < VK_API_VERSION_1_4 )) + chain_members.push_back(reinterpret_cast(&QueueFamilyGlobalPriorityProperties)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_QUEUE_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&QueueFamilyQueryResultStatusPropertiesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_QUEUE_EXTENSION_NAME)) @@ -5497,28 +7430,348 @@ void setup_queue_properties2_chain(VkQueueFamilyProperties2& start, std::unique_ start.pNext = chain->start_of_chain; }; -void chain_iterator_queue_properties2(Printer &p, AppGpu &gpu, void * place) { +void chain_iterator_queue_properties2(Printer &p, AppGpu &gpu, const void * place) { while (place) { - struct VkBaseOutStructure *structure = (struct VkBaseOutStructure *)place; + const VkBaseOutStructure *structure = (const VkBaseOutStructure *)place; p.SetSubHeader(); - if (structure->sType == VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR) { - VkQueueFamilyGlobalPriorityPropertiesKHR* props = (VkQueueFamilyGlobalPriorityPropertiesKHR*)structure; - DumpVkQueueFamilyGlobalPriorityPropertiesKHR(p, "VkQueueFamilyGlobalPriorityPropertiesKHR", *props); + if (structure->sType == VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES) { + const VkQueueFamilyGlobalPriorityProperties* props = (const VkQueueFamilyGlobalPriorityProperties*)structure; + DumpVkQueueFamilyGlobalPriorityProperties(p, gpu.api_version >= VK_API_VERSION_1_4 ?"VkQueueFamilyGlobalPriorityProperties":"VkQueueFamilyGlobalPriorityPropertiesEXT", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR) { - VkQueueFamilyQueryResultStatusPropertiesKHR* props = (VkQueueFamilyQueryResultStatusPropertiesKHR*)structure; + const VkQueueFamilyQueryResultStatusPropertiesKHR* props = (const VkQueueFamilyQueryResultStatusPropertiesKHR*)structure; DumpVkQueueFamilyQueryResultStatusPropertiesKHR(p, "VkQueueFamilyQueryResultStatusPropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR) { - VkQueueFamilyVideoPropertiesKHR* props = (VkQueueFamilyVideoPropertiesKHR*)structure; + const VkQueueFamilyVideoPropertiesKHR* props = (const VkQueueFamilyVideoPropertiesKHR*)structure; DumpVkQueueFamilyVideoPropertiesKHR(p, "VkQueueFamilyVideoPropertiesKHR", *props); p.AddNewline(); } place = structure->pNext; } } + +bool prepare_queue_properties2_twocall_chain_vectors(std::unique_ptr& chain) { + (void)chain; + return false; +} +struct video_profile_info_chain { + video_profile_info_chain() = default; + video_profile_info_chain(const video_profile_info_chain &) = delete; + video_profile_info_chain& operator=(const video_profile_info_chain &) = delete; + video_profile_info_chain(video_profile_info_chain &&) = delete; + video_profile_info_chain& operator=(video_profile_info_chain &&) = delete; + void* start_of_chain = nullptr; + VkVideoDecodeAV1ProfileInfoKHR VideoDecodeAV1ProfileInfoKHR{}; + VkVideoDecodeH264ProfileInfoKHR VideoDecodeH264ProfileInfoKHR{}; + VkVideoDecodeH265ProfileInfoKHR VideoDecodeH265ProfileInfoKHR{}; + VkVideoDecodeUsageInfoKHR VideoDecodeUsageInfoKHR{}; + VkVideoEncodeAV1ProfileInfoKHR VideoEncodeAV1ProfileInfoKHR{}; + VkVideoEncodeH264ProfileInfoKHR VideoEncodeH264ProfileInfoKHR{}; + VkVideoEncodeH265ProfileInfoKHR VideoEncodeH265ProfileInfoKHR{}; + VkVideoEncodeUsageInfoKHR VideoEncodeUsageInfoKHR{}; + void initialize_chain(AppGpu &gpu ) noexcept { + VideoDecodeAV1ProfileInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR; + VideoDecodeH264ProfileInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR; + VideoDecodeH265ProfileInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR; + VideoDecodeUsageInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR; + VideoEncodeAV1ProfileInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR; + VideoEncodeH264ProfileInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR; + VideoEncodeH265ProfileInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR; + VideoEncodeUsageInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR; + std::vector chain_members{}; + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoDecodeAV1ProfileInfoKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoDecodeH264ProfileInfoKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoDecodeH265ProfileInfoKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoDecodeUsageInfoKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_AV1_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoEncodeAV1ProfileInfoKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_H264_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoEncodeH264ProfileInfoKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_H265_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoEncodeH265ProfileInfoKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoEncodeUsageInfoKHR)); + + if (!chain_members.empty()) { + for(size_t i = 0; i < chain_members.size() - 1; i++){ + chain_members[i]->pNext = chain_members[i + 1]; + } + start_of_chain = chain_members[0]; + } + } +}; +void setup_video_profile_info_chain(VkVideoProfileInfoKHR& start, std::unique_ptr& chain, AppGpu &gpu){ + chain = std::unique_ptr(new video_profile_info_chain()); + chain->initialize_chain(gpu); + start.pNext = chain->start_of_chain; +}; + +void chain_iterator_video_profile_info(Printer &p, AppGpu &gpu, const void * place) { + while (place) { + const VkBaseOutStructure *structure = (const VkBaseOutStructure *)place; + p.SetSubHeader(); + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR) { + const VkVideoDecodeAV1ProfileInfoKHR* props = (const VkVideoDecodeAV1ProfileInfoKHR*)structure; + DumpVkVideoDecodeAV1ProfileInfoKHR(p, "VkVideoDecodeAV1ProfileInfoKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR) { + const VkVideoDecodeH264ProfileInfoKHR* props = (const VkVideoDecodeH264ProfileInfoKHR*)structure; + DumpVkVideoDecodeH264ProfileInfoKHR(p, "VkVideoDecodeH264ProfileInfoKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR) { + const VkVideoDecodeH265ProfileInfoKHR* props = (const VkVideoDecodeH265ProfileInfoKHR*)structure; + DumpVkVideoDecodeH265ProfileInfoKHR(p, "VkVideoDecodeH265ProfileInfoKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR) { + const VkVideoDecodeUsageInfoKHR* props = (const VkVideoDecodeUsageInfoKHR*)structure; + DumpVkVideoDecodeUsageInfoKHR(p, "VkVideoDecodeUsageInfoKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR) { + const VkVideoEncodeAV1ProfileInfoKHR* props = (const VkVideoEncodeAV1ProfileInfoKHR*)structure; + DumpVkVideoEncodeAV1ProfileInfoKHR(p, "VkVideoEncodeAV1ProfileInfoKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR) { + const VkVideoEncodeH264ProfileInfoKHR* props = (const VkVideoEncodeH264ProfileInfoKHR*)structure; + DumpVkVideoEncodeH264ProfileInfoKHR(p, "VkVideoEncodeH264ProfileInfoKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR) { + const VkVideoEncodeH265ProfileInfoKHR* props = (const VkVideoEncodeH265ProfileInfoKHR*)structure; + DumpVkVideoEncodeH265ProfileInfoKHR(p, "VkVideoEncodeH265ProfileInfoKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR) { + const VkVideoEncodeUsageInfoKHR* props = (const VkVideoEncodeUsageInfoKHR*)structure; + DumpVkVideoEncodeUsageInfoKHR(p, "VkVideoEncodeUsageInfoKHR", *props); + p.AddNewline(); + } + place = structure->pNext; + } +} + +bool prepare_video_profile_info_twocall_chain_vectors(std::unique_ptr& chain) { + (void)chain; + return false; +} +struct video_capabilities_chain { + video_capabilities_chain() = default; + video_capabilities_chain(const video_capabilities_chain &) = delete; + video_capabilities_chain& operator=(const video_capabilities_chain &) = delete; + video_capabilities_chain(video_capabilities_chain &&) = delete; + video_capabilities_chain& operator=(video_capabilities_chain &&) = delete; + void* start_of_chain = nullptr; + VkVideoDecodeAV1CapabilitiesKHR VideoDecodeAV1CapabilitiesKHR{}; + VkVideoDecodeCapabilitiesKHR VideoDecodeCapabilitiesKHR{}; + VkVideoDecodeH264CapabilitiesKHR VideoDecodeH264CapabilitiesKHR{}; + VkVideoDecodeH265CapabilitiesKHR VideoDecodeH265CapabilitiesKHR{}; + VkVideoEncodeAV1CapabilitiesKHR VideoEncodeAV1CapabilitiesKHR{}; + VkVideoEncodeAV1QuantizationMapCapabilitiesKHR VideoEncodeAV1QuantizationMapCapabilitiesKHR{}; + VkVideoEncodeCapabilitiesKHR VideoEncodeCapabilitiesKHR{}; + VkVideoEncodeH264CapabilitiesKHR VideoEncodeH264CapabilitiesKHR{}; + VkVideoEncodeH264QuantizationMapCapabilitiesKHR VideoEncodeH264QuantizationMapCapabilitiesKHR{}; + VkVideoEncodeH265CapabilitiesKHR VideoEncodeH265CapabilitiesKHR{}; + VkVideoEncodeH265QuantizationMapCapabilitiesKHR VideoEncodeH265QuantizationMapCapabilitiesKHR{}; + VkVideoEncodeQuantizationMapCapabilitiesKHR VideoEncodeQuantizationMapCapabilitiesKHR{}; + void initialize_chain(AppGpu &gpu ) noexcept { + VideoDecodeAV1CapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR; + VideoDecodeCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR; + VideoDecodeH264CapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR; + VideoDecodeH265CapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR; + VideoEncodeAV1CapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR; + VideoEncodeAV1QuantizationMapCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUANTIZATION_MAP_CAPABILITIES_KHR; + VideoEncodeCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR; + VideoEncodeH264CapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR; + VideoEncodeH264QuantizationMapCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR; + VideoEncodeH265CapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR; + VideoEncodeH265QuantizationMapCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR; + VideoEncodeQuantizationMapCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR; + std::vector chain_members{}; + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoDecodeAV1CapabilitiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoDecodeCapabilitiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoDecodeH264CapabilitiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoDecodeH265CapabilitiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_AV1_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoEncodeAV1CapabilitiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoEncodeAV1QuantizationMapCapabilitiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoEncodeCapabilitiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_H264_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoEncodeH264CapabilitiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoEncodeH264QuantizationMapCapabilitiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_H265_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoEncodeH265CapabilitiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoEncodeH265QuantizationMapCapabilitiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoEncodeQuantizationMapCapabilitiesKHR)); + + if (!chain_members.empty()) { + for(size_t i = 0; i < chain_members.size() - 1; i++){ + chain_members[i]->pNext = chain_members[i + 1]; + } + start_of_chain = chain_members[0]; + } + } +}; +void setup_video_capabilities_chain(VkVideoCapabilitiesKHR& start, std::unique_ptr& chain, AppGpu &gpu){ + chain = std::unique_ptr(new video_capabilities_chain()); + chain->initialize_chain(gpu); + start.pNext = chain->start_of_chain; +}; + +void chain_iterator_video_capabilities(Printer &p, AppGpu &gpu, const void * place) { + while (place) { + const VkBaseOutStructure *structure = (const VkBaseOutStructure *)place; + p.SetSubHeader(); + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR) { + const VkVideoDecodeAV1CapabilitiesKHR* props = (const VkVideoDecodeAV1CapabilitiesKHR*)structure; + DumpVkVideoDecodeAV1CapabilitiesKHR(p, "VkVideoDecodeAV1CapabilitiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR) { + const VkVideoDecodeCapabilitiesKHR* props = (const VkVideoDecodeCapabilitiesKHR*)structure; + DumpVkVideoDecodeCapabilitiesKHR(p, "VkVideoDecodeCapabilitiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR) { + const VkVideoDecodeH264CapabilitiesKHR* props = (const VkVideoDecodeH264CapabilitiesKHR*)structure; + DumpVkVideoDecodeH264CapabilitiesKHR(p, "VkVideoDecodeH264CapabilitiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR) { + const VkVideoDecodeH265CapabilitiesKHR* props = (const VkVideoDecodeH265CapabilitiesKHR*)structure; + DumpVkVideoDecodeH265CapabilitiesKHR(p, "VkVideoDecodeH265CapabilitiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR) { + const VkVideoEncodeAV1CapabilitiesKHR* props = (const VkVideoEncodeAV1CapabilitiesKHR*)structure; + DumpVkVideoEncodeAV1CapabilitiesKHR(p, "VkVideoEncodeAV1CapabilitiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUANTIZATION_MAP_CAPABILITIES_KHR) { + const VkVideoEncodeAV1QuantizationMapCapabilitiesKHR* props = (const VkVideoEncodeAV1QuantizationMapCapabilitiesKHR*)structure; + DumpVkVideoEncodeAV1QuantizationMapCapabilitiesKHR(p, "VkVideoEncodeAV1QuantizationMapCapabilitiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR) { + const VkVideoEncodeCapabilitiesKHR* props = (const VkVideoEncodeCapabilitiesKHR*)structure; + DumpVkVideoEncodeCapabilitiesKHR(p, "VkVideoEncodeCapabilitiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR) { + const VkVideoEncodeH264CapabilitiesKHR* props = (const VkVideoEncodeH264CapabilitiesKHR*)structure; + DumpVkVideoEncodeH264CapabilitiesKHR(p, "VkVideoEncodeH264CapabilitiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR) { + const VkVideoEncodeH264QuantizationMapCapabilitiesKHR* props = (const VkVideoEncodeH264QuantizationMapCapabilitiesKHR*)structure; + DumpVkVideoEncodeH264QuantizationMapCapabilitiesKHR(p, "VkVideoEncodeH264QuantizationMapCapabilitiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR) { + const VkVideoEncodeH265CapabilitiesKHR* props = (const VkVideoEncodeH265CapabilitiesKHR*)structure; + DumpVkVideoEncodeH265CapabilitiesKHR(p, "VkVideoEncodeH265CapabilitiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR) { + const VkVideoEncodeH265QuantizationMapCapabilitiesKHR* props = (const VkVideoEncodeH265QuantizationMapCapabilitiesKHR*)structure; + DumpVkVideoEncodeH265QuantizationMapCapabilitiesKHR(p, "VkVideoEncodeH265QuantizationMapCapabilitiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR) { + const VkVideoEncodeQuantizationMapCapabilitiesKHR* props = (const VkVideoEncodeQuantizationMapCapabilitiesKHR*)structure; + DumpVkVideoEncodeQuantizationMapCapabilitiesKHR(p, "VkVideoEncodeQuantizationMapCapabilitiesKHR", *props); + p.AddNewline(); + } + place = structure->pNext; + } +} + +bool prepare_video_capabilities_twocall_chain_vectors(std::unique_ptr& chain) { + (void)chain; + return false; +} +struct video_format_properties_chain { + video_format_properties_chain() = default; + video_format_properties_chain(const video_format_properties_chain &) = delete; + video_format_properties_chain& operator=(const video_format_properties_chain &) = delete; + video_format_properties_chain(video_format_properties_chain &&) = delete; + video_format_properties_chain& operator=(video_format_properties_chain &&) = delete; + void* start_of_chain = nullptr; + VkVideoFormatAV1QuantizationMapPropertiesKHR VideoFormatAV1QuantizationMapPropertiesKHR{}; + VkVideoFormatH265QuantizationMapPropertiesKHR VideoFormatH265QuantizationMapPropertiesKHR{}; + VkVideoFormatQuantizationMapPropertiesKHR VideoFormatQuantizationMapPropertiesKHR{}; + void initialize_chain(AppGpu &gpu ) noexcept { + VideoFormatAV1QuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR; + VideoFormatH265QuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR; + VideoFormatQuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR; + std::vector chain_members{}; + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoFormatAV1QuantizationMapPropertiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoFormatH265QuantizationMapPropertiesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&VideoFormatQuantizationMapPropertiesKHR)); + + if (!chain_members.empty()) { + for(size_t i = 0; i < chain_members.size() - 1; i++){ + chain_members[i]->pNext = chain_members[i + 1]; + } + start_of_chain = chain_members[0]; + } + } +}; +void setup_video_format_properties_chain(VkVideoFormatPropertiesKHR& start, std::unique_ptr& chain, AppGpu &gpu){ + chain = std::unique_ptr(new video_format_properties_chain()); + chain->initialize_chain(gpu); + start.pNext = chain->start_of_chain; +}; + +void chain_iterator_video_format_properties(Printer &p, AppGpu &gpu, const void * place) { + while (place) { + const VkBaseOutStructure *structure = (const VkBaseOutStructure *)place; + p.SetSubHeader(); + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR) { + const VkVideoFormatAV1QuantizationMapPropertiesKHR* props = (const VkVideoFormatAV1QuantizationMapPropertiesKHR*)structure; + DumpVkVideoFormatAV1QuantizationMapPropertiesKHR(p, "VkVideoFormatAV1QuantizationMapPropertiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR) { + const VkVideoFormatH265QuantizationMapPropertiesKHR* props = (const VkVideoFormatH265QuantizationMapPropertiesKHR*)structure; + DumpVkVideoFormatH265QuantizationMapPropertiesKHR(p, "VkVideoFormatH265QuantizationMapPropertiesKHR", *props); + p.AddNewline(); + } + if (structure->sType == VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR) { + const VkVideoFormatQuantizationMapPropertiesKHR* props = (const VkVideoFormatQuantizationMapPropertiesKHR*)structure; + DumpVkVideoFormatQuantizationMapPropertiesKHR(p, "VkVideoFormatQuantizationMapPropertiesKHR", *props); + p.AddNewline(); + } + place = structure->pNext; + } +} + +bool prepare_video_format_properties_twocall_chain_vectors(std::unique_ptr& chain) { + (void)chain; + return false; +} bool operator==(const VkExtent2D & a, const VkExtent2D b); bool operator==(const VkSurfaceCapabilities2EXT & a, const VkSurfaceCapabilities2EXT b); bool operator==(const VkSurfaceCapabilities2KHR & a, const VkSurfaceCapabilities2KHR b); @@ -5577,8 +7830,1112 @@ auto format_ranges = std::array{ FormatRange{0, VK_EXT_4444_FORMATS_EXTENSION_NAME, static_cast(1000340000), static_cast(1000340001)}, FormatRange{VK_API_VERSION_1_3, nullptr, static_cast(1000066000), static_cast(1000066013)}, FormatRange{0, VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_EXTENSION_NAME, static_cast(1000066000), static_cast(1000066013)}, + FormatRange{VK_API_VERSION_1_4, nullptr, static_cast(1000470000), static_cast(1000470001)}, + FormatRange{0, VK_KHR_MAINTENANCE_5_EXTENSION_NAME, static_cast(1000470000), static_cast(1000470001)}, FormatRange{0, VK_IMG_FORMAT_PVRTC_EXTENSION_NAME, static_cast(1000054000), static_cast(1000054007)}, FormatRange{0, VK_NV_OPTICAL_FLOW_EXTENSION_NAME, static_cast(1000464000), static_cast(1000464000)}, - FormatRange{0, VK_KHR_MAINTENANCE_5_EXTENSION_NAME, static_cast(1000470000), static_cast(1000470001)}, }; +bool is_video_format_same(const VkVideoFormatPropertiesKHR &format_a, const VkVideoFormatPropertiesKHR &format_b) { + auto a = reinterpret_cast(&format_a); + auto b = reinterpret_cast(&format_b); + bool same = true; + while (same && a != nullptr && b != nullptr) { + if (a->sType != b->sType) { + // Structure type mismatch (extension structures are expected to be chained in the same order) + same = false; + } else { + switch (a->sType) { + case VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR: + same = same && memcmp(reinterpret_cast(a) + sizeof(VkBaseInStructure), + reinterpret_cast(b) + sizeof(VkBaseInStructure), + sizeof(VkVideoFormatPropertiesKHR) - sizeof(VkBaseInStructure)) == 0; + break; + case VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR: + same = same && memcmp(reinterpret_cast(a) + sizeof(VkBaseInStructure), + reinterpret_cast(b) + sizeof(VkBaseInStructure), + sizeof(VkVideoFormatAV1QuantizationMapPropertiesKHR) - sizeof(VkBaseInStructure)) == 0; + break; + case VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR: + same = same && memcmp(reinterpret_cast(a) + sizeof(VkBaseInStructure), + reinterpret_cast(b) + sizeof(VkBaseInStructure), + sizeof(VkVideoFormatH265QuantizationMapPropertiesKHR) - sizeof(VkBaseInStructure)) == 0; + break; + case VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR: + same = same && memcmp(reinterpret_cast(a) + sizeof(VkBaseInStructure), + reinterpret_cast(b) + sizeof(VkBaseInStructure), + sizeof(VkVideoFormatQuantizationMapPropertiesKHR) - sizeof(VkBaseInStructure)) == 0; + break; + default: + // Unexpected structure type + same = false; + break; + } + } + a = a->pNext; + b = b->pNext; + } + return same; +} + +std::vector> enumerate_supported_video_profiles(AppGpu &gpu) { + std::vector> result{}; + + struct ChromaSubsamplingInfo { + VkVideoChromaSubsamplingFlagsKHR value; + const char* name; + }; + const std::vector chroma_subsampling_list = { + {VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR, "4:2:0"}, + {VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR, "4:2:2"}, + {VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR, "4:4:4"}, + {VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR, "monochrome"} + }; + + struct BitDepthInfo { + VkVideoComponentBitDepthFlagsKHR value; + const char* name; + }; + const std::vector bit_depth_list = { + {VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR, "8"}, + {VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR, "10"}, + {VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR, "12"} + }; + + auto find_caps_struct = [](const VkVideoCapabilitiesKHR &capabilities, VkStructureType stype) -> const VkBaseInStructure* { + auto p = reinterpret_cast(&capabilities); + while (p != nullptr) { + if (p->sType == stype) { + return p; + } + p = p->pNext; + } + return nullptr; + }; + + auto base_format = [] + (const ChromaSubsamplingInfo &chroma_subsampling, const BitDepthInfo &luma_bit_depth, const BitDepthInfo &chroma_bit_depth) { + std::string result{}; + result += " ("; + result += chroma_subsampling.name; + result += " "; + result += luma_bit_depth.name; + if (luma_bit_depth.value != chroma_bit_depth.value) { + result += ":"; + result += chroma_bit_depth.name; + } + result += "-bit)"; + return result; + }; + + auto add_profile = [&]( + const std::string &name, + const VkVideoProfileInfoKHR &profile_info, + AppVideoProfile::CreateProfileInfoChainCb create_profile_info_chain, + AppVideoProfile::CreateCapabilitiesChainCb create_capabilities_chain, + const AppVideoProfile::CreateFormatPropertiesChainCbList &create_format_properties_chain_list, + AppVideoProfile::InitProfileCb init_profile) { + auto profile = std::make_unique(gpu, gpu.phys_device, + name, profile_info, + create_profile_info_chain, + create_capabilities_chain, + create_format_properties_chain_list, + init_profile); + if (profile->supported) { + result.push_back(std::move(profile)); + } + }; + + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME)) { + const std::string codec_name = "H.264 Decode"; + + for (auto chroma_subsampling : chroma_subsampling_list) { + for (auto luma_bit_depth : bit_depth_list) { + for (auto chroma_bit_depth : bit_depth_list) { + if (chroma_subsampling.value == VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR && luma_bit_depth.value != chroma_bit_depth.value) { + // Ignore the chroma bit depth dimension for monochrome + continue; + } + + std::string profile_base_name = codec_name + base_format(chroma_subsampling, luma_bit_depth, chroma_bit_depth); + VkVideoProfileInfoKHR profile_info{ + VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, + nullptr, + VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, + chroma_subsampling.value, + luma_bit_depth.value, + chroma_bit_depth.value + }; + + auto create_profile_info_chain = [&](const void **ppnext) -> std::unique_ptr { + auto profile_info_chain = std::make_unique(); + if (profile_info_chain != nullptr) { + profile_info_chain->VideoDecodeH264ProfileInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR; + profile_info_chain->VideoDecodeH264ProfileInfoKHR.pNext = nullptr; + *ppnext = &profile_info_chain->VideoDecodeH264ProfileInfoKHR; + ppnext = &profile_info_chain->VideoDecodeH264ProfileInfoKHR.pNext; + } + return profile_info_chain; + }; + + auto create_capabilities_chain = [&](void **ppnext) -> std::unique_ptr { + auto capabilities_chain = std::make_unique(); + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME)) { + capabilities_chain->VideoDecodeCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR; + capabilities_chain->VideoDecodeCapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoDecodeCapabilitiesKHR; + ppnext = &capabilities_chain->VideoDecodeCapabilitiesKHR.pNext; + } + } + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME)) { + capabilities_chain->VideoDecodeH264CapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR; + capabilities_chain->VideoDecodeH264CapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoDecodeH264CapabilitiesKHR; + ppnext = &capabilities_chain->VideoDecodeH264CapabilitiesKHR.pNext; + } + } + return capabilities_chain; + }; + + const AppVideoProfile::CreateFormatPropertiesChainCbList create_format_properties_chain_list = { + AppVideoProfile::CreateFormatPropertiesChainCb { + "Decode Output", + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + return format_properties_chain; + }, + }, + AppVideoProfile::CreateFormatPropertiesChainCb { + "DPB", + VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + return format_properties_chain; + }, + }, + }; + + add_profile(profile_base_name + " Baseline progressive", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_BASELINE; + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR; + }); + add_profile(profile_base_name + " Main progressive", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_MAIN; + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR; + }); + add_profile(profile_base_name + " High progressive", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_HIGH; + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR; + }); + add_profile(profile_base_name + " High 4:4:4 Predictive progressive", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE; + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR; + }); + add_profile(profile_base_name + " Baseline interlaced (interleaved lines)", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_BASELINE; + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR; + }); + add_profile(profile_base_name + " Main interlaced (interleaved lines)", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_MAIN; + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR; + }); + add_profile(profile_base_name + " High interlaced (interleaved lines)", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_HIGH; + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR; + }); + add_profile(profile_base_name + " High 4:4:4 Predictive interlaced (interleaved lines)", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE; + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR; + }); + add_profile(profile_base_name + " Baseline interlaced (separate planes)", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_BASELINE; + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR; + }); + add_profile(profile_base_name + " Main interlaced (separate planes)", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_MAIN; + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR; + }); + add_profile(profile_base_name + " High interlaced (separate planes)", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_HIGH; + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR; + }); + add_profile(profile_base_name + " High 4:4:4 Predictive interlaced (separate planes)", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE; + profile.profile_info_chain->VideoDecodeH264ProfileInfoKHR.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR; + }); + } + } + } + } + + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME)) { + const std::string codec_name = "H.265 Decode"; + + for (auto chroma_subsampling : chroma_subsampling_list) { + for (auto luma_bit_depth : bit_depth_list) { + for (auto chroma_bit_depth : bit_depth_list) { + if (chroma_subsampling.value == VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR && luma_bit_depth.value != chroma_bit_depth.value) { + // Ignore the chroma bit depth dimension for monochrome + continue; + } + + std::string profile_base_name = codec_name + base_format(chroma_subsampling, luma_bit_depth, chroma_bit_depth); + VkVideoProfileInfoKHR profile_info{ + VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, + nullptr, + VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, + chroma_subsampling.value, + luma_bit_depth.value, + chroma_bit_depth.value + }; + + auto create_profile_info_chain = [&](const void **ppnext) -> std::unique_ptr { + auto profile_info_chain = std::make_unique(); + if (profile_info_chain != nullptr) { + profile_info_chain->VideoDecodeH265ProfileInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR; + profile_info_chain->VideoDecodeH265ProfileInfoKHR.pNext = nullptr; + *ppnext = &profile_info_chain->VideoDecodeH265ProfileInfoKHR; + ppnext = &profile_info_chain->VideoDecodeH265ProfileInfoKHR.pNext; + } + return profile_info_chain; + }; + + auto create_capabilities_chain = [&](void **ppnext) -> std::unique_ptr { + auto capabilities_chain = std::make_unique(); + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME)) { + capabilities_chain->VideoDecodeCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR; + capabilities_chain->VideoDecodeCapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoDecodeCapabilitiesKHR; + ppnext = &capabilities_chain->VideoDecodeCapabilitiesKHR.pNext; + } + } + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME)) { + capabilities_chain->VideoDecodeH265CapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR; + capabilities_chain->VideoDecodeH265CapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoDecodeH265CapabilitiesKHR; + ppnext = &capabilities_chain->VideoDecodeH265CapabilitiesKHR.pNext; + } + } + return capabilities_chain; + }; + + const AppVideoProfile::CreateFormatPropertiesChainCbList create_format_properties_chain_list = { + AppVideoProfile::CreateFormatPropertiesChainCb { + "Decode Output", + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + return format_properties_chain; + }, + }, + AppVideoProfile::CreateFormatPropertiesChainCb { + "DPB", + VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + return format_properties_chain; + }, + }, + }; + + add_profile(profile_base_name + " Main", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH265ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_MAIN; + }); + add_profile(profile_base_name + " Main 10", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH265ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_MAIN_10; + }); + add_profile(profile_base_name + " Main Still Picture", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH265ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_MAIN_STILL_PICTURE; + }); + add_profile(profile_base_name + " Format range extensions", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH265ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS; + }); + add_profile(profile_base_name + " Screen content coding extensions", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeH265ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS; + }); + } + } + } + } + + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME)) { + const std::string codec_name = "AV1 Decode"; + + for (auto chroma_subsampling : chroma_subsampling_list) { + for (auto luma_bit_depth : bit_depth_list) { + for (auto chroma_bit_depth : bit_depth_list) { + if (chroma_subsampling.value == VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR && luma_bit_depth.value != chroma_bit_depth.value) { + // Ignore the chroma bit depth dimension for monochrome + continue; + } + + std::string profile_base_name = codec_name + base_format(chroma_subsampling, luma_bit_depth, chroma_bit_depth); + VkVideoProfileInfoKHR profile_info{ + VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, + nullptr, + VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR, + chroma_subsampling.value, + luma_bit_depth.value, + chroma_bit_depth.value + }; + + auto create_profile_info_chain = [&](const void **ppnext) -> std::unique_ptr { + auto profile_info_chain = std::make_unique(); + if (profile_info_chain != nullptr) { + profile_info_chain->VideoDecodeAV1ProfileInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR; + profile_info_chain->VideoDecodeAV1ProfileInfoKHR.pNext = nullptr; + *ppnext = &profile_info_chain->VideoDecodeAV1ProfileInfoKHR; + ppnext = &profile_info_chain->VideoDecodeAV1ProfileInfoKHR.pNext; + } + return profile_info_chain; + }; + + auto create_capabilities_chain = [&](void **ppnext) -> std::unique_ptr { + auto capabilities_chain = std::make_unique(); + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME)) { + capabilities_chain->VideoDecodeCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR; + capabilities_chain->VideoDecodeCapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoDecodeCapabilitiesKHR; + ppnext = &capabilities_chain->VideoDecodeCapabilitiesKHR.pNext; + } + } + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME)) { + capabilities_chain->VideoDecodeAV1CapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR; + capabilities_chain->VideoDecodeAV1CapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoDecodeAV1CapabilitiesKHR; + ppnext = &capabilities_chain->VideoDecodeAV1CapabilitiesKHR.pNext; + } + } + return capabilities_chain; + }; + + const AppVideoProfile::CreateFormatPropertiesChainCbList create_format_properties_chain_list = { + AppVideoProfile::CreateFormatPropertiesChainCb { + "Decode Output", + VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + return format_properties_chain; + }, + }, + AppVideoProfile::CreateFormatPropertiesChainCb { + "DPB", + VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + return format_properties_chain; + }, + }, + }; + + add_profile(profile_base_name + " Main with film grain support", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeAV1ProfileInfoKHR.stdProfile = STD_VIDEO_AV1_PROFILE_MAIN; + profile.profile_info_chain->VideoDecodeAV1ProfileInfoKHR.filmGrainSupport = VK_TRUE; + }); + add_profile(profile_base_name + " High with film grain support", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeAV1ProfileInfoKHR.stdProfile = STD_VIDEO_AV1_PROFILE_HIGH; + profile.profile_info_chain->VideoDecodeAV1ProfileInfoKHR.filmGrainSupport = VK_TRUE; + }); + add_profile(profile_base_name + " Professional with film grain support", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeAV1ProfileInfoKHR.stdProfile = STD_VIDEO_AV1_PROFILE_PROFESSIONAL; + profile.profile_info_chain->VideoDecodeAV1ProfileInfoKHR.filmGrainSupport = VK_TRUE; + }); + add_profile(profile_base_name + " Main without film grain support", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeAV1ProfileInfoKHR.stdProfile = STD_VIDEO_AV1_PROFILE_MAIN; + profile.profile_info_chain->VideoDecodeAV1ProfileInfoKHR.filmGrainSupport = VK_FALSE; + }); + add_profile(profile_base_name + " High without film grain support", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeAV1ProfileInfoKHR.stdProfile = STD_VIDEO_AV1_PROFILE_HIGH; + profile.profile_info_chain->VideoDecodeAV1ProfileInfoKHR.filmGrainSupport = VK_FALSE; + }); + add_profile(profile_base_name + " Professional without film grain support", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoDecodeAV1ProfileInfoKHR.stdProfile = STD_VIDEO_AV1_PROFILE_PROFESSIONAL; + profile.profile_info_chain->VideoDecodeAV1ProfileInfoKHR.filmGrainSupport = VK_FALSE; + }); + } + } + } + } + + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_H264_EXTENSION_NAME)) { + const std::string codec_name = "H.264 Encode"; + + for (auto chroma_subsampling : chroma_subsampling_list) { + for (auto luma_bit_depth : bit_depth_list) { + for (auto chroma_bit_depth : bit_depth_list) { + if (chroma_subsampling.value == VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR && luma_bit_depth.value != chroma_bit_depth.value) { + // Ignore the chroma bit depth dimension for monochrome + continue; + } + + std::string profile_base_name = codec_name + base_format(chroma_subsampling, luma_bit_depth, chroma_bit_depth); + VkVideoProfileInfoKHR profile_info{ + VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, + nullptr, + VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR, + chroma_subsampling.value, + luma_bit_depth.value, + chroma_bit_depth.value + }; + + auto create_profile_info_chain = [&](const void **ppnext) -> std::unique_ptr { + auto profile_info_chain = std::make_unique(); + if (profile_info_chain != nullptr) { + profile_info_chain->VideoEncodeH264ProfileInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR; + profile_info_chain->VideoEncodeH264ProfileInfoKHR.pNext = nullptr; + *ppnext = &profile_info_chain->VideoEncodeH264ProfileInfoKHR; + ppnext = &profile_info_chain->VideoEncodeH264ProfileInfoKHR.pNext; + } + return profile_info_chain; + }; + + auto create_capabilities_chain = [&](void **ppnext) -> std::unique_ptr { + auto capabilities_chain = std::make_unique(); + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME)) { + capabilities_chain->VideoEncodeCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR; + capabilities_chain->VideoEncodeCapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoEncodeCapabilitiesKHR; + ppnext = &capabilities_chain->VideoEncodeCapabilitiesKHR.pNext; + } + } + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + capabilities_chain->VideoEncodeQuantizationMapCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR; + capabilities_chain->VideoEncodeQuantizationMapCapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoEncodeQuantizationMapCapabilitiesKHR; + ppnext = &capabilities_chain->VideoEncodeQuantizationMapCapabilitiesKHR.pNext; + } + } + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_H264_EXTENSION_NAME)) { + capabilities_chain->VideoEncodeH264CapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR; + capabilities_chain->VideoEncodeH264CapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoEncodeH264CapabilitiesKHR; + ppnext = &capabilities_chain->VideoEncodeH264CapabilitiesKHR.pNext; + } + } + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + capabilities_chain->VideoEncodeH264QuantizationMapCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR; + capabilities_chain->VideoEncodeH264QuantizationMapCapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoEncodeH264QuantizationMapCapabilitiesKHR; + ppnext = &capabilities_chain->VideoEncodeH264QuantizationMapCapabilitiesKHR.pNext; + } + } + return capabilities_chain; + }; + + const AppVideoProfile::CreateFormatPropertiesChainCbList create_format_properties_chain_list = { + AppVideoProfile::CreateFormatPropertiesChainCb { + "Encode Input", + VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + return format_properties_chain; + }, + }, + AppVideoProfile::CreateFormatPropertiesChainCb { + "DPB", + VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + return format_properties_chain; + }, + }, + AppVideoProfile::CreateFormatPropertiesChainCb { + "Quantization Delta Map", + VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME)) { + auto caps = reinterpret_cast(find_caps_struct(capabilities, VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR)); + if (caps != nullptr) { + supported = supported && ((caps->flags & VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR) != 0); + } else { + supported = false; + } + } else { + supported = false; + } + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + if (format_properties_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR; + format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.pNext = nullptr; + *ppnext = &format_properties_chain->VideoFormatQuantizationMapPropertiesKHR; + ppnext = &format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.pNext; + } + } + return format_properties_chain; + }, + }, + AppVideoProfile::CreateFormatPropertiesChainCb { + "Emphasis Map", + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME)) { + auto caps = reinterpret_cast(find_caps_struct(capabilities, VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR)); + if (caps != nullptr) { + supported = supported && ((caps->flags & VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR) != 0); + } else { + supported = false; + } + } else { + supported = false; + } + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + if (format_properties_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR; + format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.pNext = nullptr; + *ppnext = &format_properties_chain->VideoFormatQuantizationMapPropertiesKHR; + ppnext = &format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.pNext; + } + } + return format_properties_chain; + }, + }, + }; + + add_profile(profile_base_name + " Baseline", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoEncodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_BASELINE; + }); + add_profile(profile_base_name + " Main", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoEncodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_MAIN; + }); + add_profile(profile_base_name + " High", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoEncodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_HIGH; + }); + add_profile(profile_base_name + " High 4:4:4 Predictive", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoEncodeH264ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE; + }); + } + } + } + } + + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_H265_EXTENSION_NAME)) { + const std::string codec_name = "H.265 Encode"; + + for (auto chroma_subsampling : chroma_subsampling_list) { + for (auto luma_bit_depth : bit_depth_list) { + for (auto chroma_bit_depth : bit_depth_list) { + if (chroma_subsampling.value == VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR && luma_bit_depth.value != chroma_bit_depth.value) { + // Ignore the chroma bit depth dimension for monochrome + continue; + } + + std::string profile_base_name = codec_name + base_format(chroma_subsampling, luma_bit_depth, chroma_bit_depth); + VkVideoProfileInfoKHR profile_info{ + VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, + nullptr, + VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR, + chroma_subsampling.value, + luma_bit_depth.value, + chroma_bit_depth.value + }; + + auto create_profile_info_chain = [&](const void **ppnext) -> std::unique_ptr { + auto profile_info_chain = std::make_unique(); + if (profile_info_chain != nullptr) { + profile_info_chain->VideoEncodeH265ProfileInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR; + profile_info_chain->VideoEncodeH265ProfileInfoKHR.pNext = nullptr; + *ppnext = &profile_info_chain->VideoEncodeH265ProfileInfoKHR; + ppnext = &profile_info_chain->VideoEncodeH265ProfileInfoKHR.pNext; + } + return profile_info_chain; + }; + + auto create_capabilities_chain = [&](void **ppnext) -> std::unique_ptr { + auto capabilities_chain = std::make_unique(); + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME)) { + capabilities_chain->VideoEncodeCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR; + capabilities_chain->VideoEncodeCapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoEncodeCapabilitiesKHR; + ppnext = &capabilities_chain->VideoEncodeCapabilitiesKHR.pNext; + } + } + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + capabilities_chain->VideoEncodeQuantizationMapCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR; + capabilities_chain->VideoEncodeQuantizationMapCapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoEncodeQuantizationMapCapabilitiesKHR; + ppnext = &capabilities_chain->VideoEncodeQuantizationMapCapabilitiesKHR.pNext; + } + } + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_H265_EXTENSION_NAME)) { + capabilities_chain->VideoEncodeH265CapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR; + capabilities_chain->VideoEncodeH265CapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoEncodeH265CapabilitiesKHR; + ppnext = &capabilities_chain->VideoEncodeH265CapabilitiesKHR.pNext; + } + } + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + capabilities_chain->VideoEncodeH265QuantizationMapCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR; + capabilities_chain->VideoEncodeH265QuantizationMapCapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoEncodeH265QuantizationMapCapabilitiesKHR; + ppnext = &capabilities_chain->VideoEncodeH265QuantizationMapCapabilitiesKHR.pNext; + } + } + return capabilities_chain; + }; + + const AppVideoProfile::CreateFormatPropertiesChainCbList create_format_properties_chain_list = { + AppVideoProfile::CreateFormatPropertiesChainCb { + "Encode Input", + VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + return format_properties_chain; + }, + }, + AppVideoProfile::CreateFormatPropertiesChainCb { + "DPB", + VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + return format_properties_chain; + }, + }, + AppVideoProfile::CreateFormatPropertiesChainCb { + "Quantization Delta Map", + VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME)) { + auto caps = reinterpret_cast(find_caps_struct(capabilities, VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR)); + if (caps != nullptr) { + supported = supported && ((caps->flags & VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR) != 0); + } else { + supported = false; + } + } else { + supported = false; + } + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + if (format_properties_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR; + format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.pNext = nullptr; + *ppnext = &format_properties_chain->VideoFormatQuantizationMapPropertiesKHR; + ppnext = &format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.pNext; + } + } + if (format_properties_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + format_properties_chain->VideoFormatH265QuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR; + format_properties_chain->VideoFormatH265QuantizationMapPropertiesKHR.pNext = nullptr; + *ppnext = &format_properties_chain->VideoFormatH265QuantizationMapPropertiesKHR; + ppnext = &format_properties_chain->VideoFormatH265QuantizationMapPropertiesKHR.pNext; + } + } + return format_properties_chain; + }, + }, + AppVideoProfile::CreateFormatPropertiesChainCb { + "Emphasis Map", + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME)) { + auto caps = reinterpret_cast(find_caps_struct(capabilities, VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR)); + if (caps != nullptr) { + supported = supported && ((caps->flags & VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR) != 0); + } else { + supported = false; + } + } else { + supported = false; + } + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + if (format_properties_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR; + format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.pNext = nullptr; + *ppnext = &format_properties_chain->VideoFormatQuantizationMapPropertiesKHR; + ppnext = &format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.pNext; + } + } + if (format_properties_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + format_properties_chain->VideoFormatH265QuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR; + format_properties_chain->VideoFormatH265QuantizationMapPropertiesKHR.pNext = nullptr; + *ppnext = &format_properties_chain->VideoFormatH265QuantizationMapPropertiesKHR; + ppnext = &format_properties_chain->VideoFormatH265QuantizationMapPropertiesKHR.pNext; + } + } + return format_properties_chain; + }, + }, + }; + + add_profile(profile_base_name + " Main", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoEncodeH265ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_MAIN; + }); + add_profile(profile_base_name + " Main 10", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoEncodeH265ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_MAIN_10; + }); + add_profile(profile_base_name + " Main Still Picture", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoEncodeH265ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_MAIN_STILL_PICTURE; + }); + add_profile(profile_base_name + " Format range extensions", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoEncodeH265ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS; + }); + add_profile(profile_base_name + " Screen content coding extensions", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoEncodeH265ProfileInfoKHR.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS; + }); + } + } + } + } + + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_AV1_EXTENSION_NAME)) { + const std::string codec_name = "AV1 Encode"; + + for (auto chroma_subsampling : chroma_subsampling_list) { + for (auto luma_bit_depth : bit_depth_list) { + for (auto chroma_bit_depth : bit_depth_list) { + if (chroma_subsampling.value == VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR && luma_bit_depth.value != chroma_bit_depth.value) { + // Ignore the chroma bit depth dimension for monochrome + continue; + } + + std::string profile_base_name = codec_name + base_format(chroma_subsampling, luma_bit_depth, chroma_bit_depth); + VkVideoProfileInfoKHR profile_info{ + VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, + nullptr, + VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR, + chroma_subsampling.value, + luma_bit_depth.value, + chroma_bit_depth.value + }; + + auto create_profile_info_chain = [&](const void **ppnext) -> std::unique_ptr { + auto profile_info_chain = std::make_unique(); + if (profile_info_chain != nullptr) { + profile_info_chain->VideoEncodeAV1ProfileInfoKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR; + profile_info_chain->VideoEncodeAV1ProfileInfoKHR.pNext = nullptr; + *ppnext = &profile_info_chain->VideoEncodeAV1ProfileInfoKHR; + ppnext = &profile_info_chain->VideoEncodeAV1ProfileInfoKHR.pNext; + } + return profile_info_chain; + }; + + auto create_capabilities_chain = [&](void **ppnext) -> std::unique_ptr { + auto capabilities_chain = std::make_unique(); + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME)) { + capabilities_chain->VideoEncodeCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR; + capabilities_chain->VideoEncodeCapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoEncodeCapabilitiesKHR; + ppnext = &capabilities_chain->VideoEncodeCapabilitiesKHR.pNext; + } + } + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + capabilities_chain->VideoEncodeQuantizationMapCapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR; + capabilities_chain->VideoEncodeQuantizationMapCapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoEncodeQuantizationMapCapabilitiesKHR; + ppnext = &capabilities_chain->VideoEncodeQuantizationMapCapabilitiesKHR.pNext; + } + } + if (capabilities_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_AV1_EXTENSION_NAME)) { + capabilities_chain->VideoEncodeAV1CapabilitiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR; + capabilities_chain->VideoEncodeAV1CapabilitiesKHR.pNext = nullptr; + *ppnext = &capabilities_chain->VideoEncodeAV1CapabilitiesKHR; + ppnext = &capabilities_chain->VideoEncodeAV1CapabilitiesKHR.pNext; + } + } + return capabilities_chain; + }; + + const AppVideoProfile::CreateFormatPropertiesChainCbList create_format_properties_chain_list = { + AppVideoProfile::CreateFormatPropertiesChainCb { + "Encode Input", + VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + return format_properties_chain; + }, + }, + AppVideoProfile::CreateFormatPropertiesChainCb { + "DPB", + VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + return format_properties_chain; + }, + }, + AppVideoProfile::CreateFormatPropertiesChainCb { + "Quantization Delta Map", + VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME)) { + auto caps = reinterpret_cast(find_caps_struct(capabilities, VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR)); + if (caps != nullptr) { + supported = supported && ((caps->flags & VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR) != 0); + } else { + supported = false; + } + } else { + supported = false; + } + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + if (format_properties_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR; + format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.pNext = nullptr; + *ppnext = &format_properties_chain->VideoFormatQuantizationMapPropertiesKHR; + ppnext = &format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.pNext; + } + } + if (format_properties_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + format_properties_chain->VideoFormatAV1QuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR; + format_properties_chain->VideoFormatAV1QuantizationMapPropertiesKHR.pNext = nullptr; + *ppnext = &format_properties_chain->VideoFormatAV1QuantizationMapPropertiesKHR; + ppnext = &format_properties_chain->VideoFormatAV1QuantizationMapPropertiesKHR.pNext; + } + } + return format_properties_chain; + }, + }, + AppVideoProfile::CreateFormatPropertiesChainCb { + "Emphasis Map", + VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR, + [&](const VkVideoCapabilitiesKHR &capabilities) -> bool { + bool supported = true; + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME)) { + auto caps = reinterpret_cast(find_caps_struct(capabilities, VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR)); + if (caps != nullptr) { + supported = supported && ((caps->flags & VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR) != 0); + } else { + supported = false; + } + } else { + supported = false; + } + return supported; + }, + [&](void **ppnext) -> std::unique_ptr { + auto format_properties_chain = std::make_unique(); + if (format_properties_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR; + format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.pNext = nullptr; + *ppnext = &format_properties_chain->VideoFormatQuantizationMapPropertiesKHR; + ppnext = &format_properties_chain->VideoFormatQuantizationMapPropertiesKHR.pNext; + } + } + if (format_properties_chain != nullptr) { + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { + format_properties_chain->VideoFormatAV1QuantizationMapPropertiesKHR.sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR; + format_properties_chain->VideoFormatAV1QuantizationMapPropertiesKHR.pNext = nullptr; + *ppnext = &format_properties_chain->VideoFormatAV1QuantizationMapPropertiesKHR; + ppnext = &format_properties_chain->VideoFormatAV1QuantizationMapPropertiesKHR.pNext; + } + } + return format_properties_chain; + }, + }, + }; + + add_profile(profile_base_name + " Main", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoEncodeAV1ProfileInfoKHR.stdProfile = STD_VIDEO_AV1_PROFILE_MAIN; + }); + add_profile(profile_base_name + " High", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoEncodeAV1ProfileInfoKHR.stdProfile = STD_VIDEO_AV1_PROFILE_HIGH; + }); + add_profile(profile_base_name + " Professional", profile_info, + create_profile_info_chain, create_capabilities_chain, + create_format_properties_chain_list, + [](AppVideoProfile& profile) { + profile.profile_info_chain->VideoEncodeAV1ProfileInfoKHR.stdProfile = STD_VIDEO_AV1_PROFILE_PROFESSIONAL; + }); + } + } + } + } + return result; +} + + diff --git a/vulkaninfo/vulkaninfo.cpp b/vulkaninfo/vulkaninfo.cpp index 09030a0d8..0641ab0fb 100644 --- a/vulkaninfo/vulkaninfo.cpp +++ b/vulkaninfo/vulkaninfo.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2015-2021 The Khronos Group Inc. * Copyright (c) 2015-2021 Valve Corporation * Copyright (c) 2015-2021 LunarG, Inc. - * Copyright (c) 2023-2023 RasterGrid Kft. + * Copyright (c) 2023-2024 RasterGrid Kft. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -396,17 +396,19 @@ void GpuDumpQueueProps(Printer &p, AppGpu &gpu, const AppQueueFamilyProperties & p.PrintKeyString("queueFlags", VkQueueFlagsString(props.queueFlags)); p.PrintKeyValue("timestampValidBits", props.timestampValidBits); - if (queue.is_present_platform_agnostic) { - p.PrintKeyString("present support", queue.platforms_support_present ? "true" : "false"); + if (!queue.can_present) { + p.PrintKeyString("present support", "false"); + } else if (queue.can_always_present) { + p.PrintKeyString("present support", "true"); } else { size_t width = 0; - for (auto &surface : gpu.inst.surface_extensions) { - if (surface.name.size() > width) width = surface.name.size(); + for (const auto &support : queue.present_support) { + if (support.first.size() > width) width = support.first.size(); } ObjectWrapper obj_present_support(p, "present support"); p.SetMinKeyWidth(width); - for (auto &surface : gpu.inst.surface_extensions) { - p.PrintKeyString(surface.name, surface.supports_present ? "true" : "false"); + for (const auto &support : queue.present_support) { + p.PrintKeyString(support.first, support.second ? "true" : "false"); } } chain_iterator_queue_properties2(p, gpu, queue.pNext); @@ -616,9 +618,77 @@ void GpuDevDump(Printer &p, AppGpu &gpu) { p.AddNewline(); } +void DumpVkVideoProfileInfoKHRCustom(Printer &p, std::string name, const VkVideoProfileInfoKHR &obj) { + // We use custom dumping here because we do not want to output ignored fields + // e.g. for monochrome chromaBitDepth is ignored + ObjectWrapper object{p, name}; + DumpVkVideoCodecOperationFlagBitsKHR(p, "videoCodecOperation", obj.videoCodecOperation); + DumpVkVideoChromaSubsamplingFlagsKHR(p, "chromaSubsampling", obj.chromaSubsampling); + DumpVkVideoComponentBitDepthFlagsKHR(p, "lumaBitDepth", obj.lumaBitDepth); + if (obj.chromaSubsampling != VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR) { + DumpVkVideoComponentBitDepthFlagsKHR(p, "chromaBitDepth", obj.chromaBitDepth); + } else { + DumpVkVideoComponentBitDepthFlagsKHR(p, "chromaBitDepth", 0); + } +} + +void GpuDumpVideoProfiles(Printer &p, AppGpu &gpu, bool show_video_props) { + p.SetHeader(); + ArrayWrapper video_profiles_obj(p, "Video Profiles", gpu.video_profiles.size()); + IndentWrapper indent_outer(p); + + if (p.Type() != OutputType::text || show_video_props) { + // Video profile details per profile + for (const auto &video_profile : gpu.video_profiles) { + p.SetSubHeader(); + ObjectWrapper video_profile_obj(p, video_profile->name); + IndentWrapper indent_inner(p); + { + p.SetSubHeader(); + ObjectWrapper profile_info_obj(p, "Video Profile Definition"); + p.SetSubHeader(); + DumpVkVideoProfileInfoKHRCustom(p, "VkVideoProfileInfoKHR", video_profile->profile_info); + chain_iterator_video_profile_info(p, gpu, video_profile->profile_info.pNext); + } + { + p.SetSubHeader(); + ObjectWrapper capabilities_obj(p, "Video Profile Capabilities"); + p.SetSubHeader(); + DumpVkVideoCapabilitiesKHR(p, "VkVideoCapabilitiesKHR", video_profile->capabilities); + chain_iterator_video_capabilities(p, gpu, video_profile->capabilities.pNext); + } + { + p.SetSubHeader(); + ObjectWrapper video_formats_obj(p, "Video Formats"); + for (const auto &video_formats_it : video_profile->formats_by_category) { + const auto &video_format_category_name = video_formats_it.first; + const auto &video_format_props = video_formats_it.second; + ArrayWrapper video_format_category(p, video_format_category_name, video_format_props.size()); + for (size_t i = 0; i < video_format_props.size(); ++i) { + ObjectWrapper video_format_obj(p, video_format_category_name + " Format #" + std::to_string(i + 1)); + p.SetSubHeader(); + DumpVkVideoFormatPropertiesKHR(p, "VkVideoFormatPropertiesKHR", video_format_props[i]); + chain_iterator_video_format_properties(p, gpu, video_format_props[i].pNext); + } + } + } + + p.AddNewline(); + } + } else { + // Video profile list only + for (const auto &video_profile : gpu.video_profiles) { + p.PrintString(video_profile->name); + } + } + + p.AddNewline(); +} + // Print gpu info for text, html, & vkconfig_output // Uses a separate function than schema-json for clarity -void DumpGpu(Printer &p, AppGpu &gpu, bool show_tooling_info, bool show_formats, bool show_promoted_structs) { +void DumpGpu(Printer &p, AppGpu &gpu, bool show_tooling_info, bool show_formats, bool show_promoted_structs, + bool show_video_props) { ObjectWrapper obj_gpu(p, "GPU" + std::to_string(gpu.id)); IndentWrapper indent(p); @@ -642,6 +712,10 @@ void DumpGpu(Printer &p, AppGpu &gpu, bool show_tooling_info, bool show_formats, GpuDevDump(p, gpu); } + if (!gpu.video_profiles.empty()) { + GpuDumpVideoProfiles(p, gpu, show_video_props); + } + p.AddNewline(); } @@ -729,6 +803,30 @@ void DumpGpuProfileCapabilities(Printer &p, AppGpu &gpu) { chain_iterator_queue_properties2(p, gpu, extended_queue_prop.pNext); } } + if (!gpu.video_profiles.empty()) { + ArrayWrapper video_profiles(p, "videoProfiles"); + for (const auto &video_profile : gpu.video_profiles) { + ObjectWrapper video_profile_obj(p, ""); + { + ObjectWrapper profile_info_obj(p, "profile"); + DumpVkVideoProfileInfoKHRCustom(p, "VkVideoProfileInfoKHR", video_profile->profile_info); + chain_iterator_video_profile_info(p, gpu, video_profile->profile_info.pNext); + } + { + ObjectWrapper capabilities_obj(p, "capabilities"); + DumpVkVideoCapabilitiesKHR(p, "VkVideoCapabilitiesKHR", video_profile->capabilities); + chain_iterator_video_capabilities(p, gpu, video_profile->capabilities.pNext); + } + { + ArrayWrapper video_formats(p, "formats"); + for (const auto &video_format : video_profile->formats) { + ObjectWrapper video_format_obj(p, ""); + DumpVkVideoFormatPropertiesKHR(p, "VkVideoFormatPropertiesKHR", video_format.properties); + chain_iterator_video_format_properties(p, gpu, video_format.properties.pNext); + } + } + } + } } #if defined(VK_ENABLE_BETA_EXTENSIONS) // Print portability subset extension, features, and properties if available @@ -934,7 +1032,7 @@ const char *help_message_body = "_[DEVICE_NAME]_[DRIVER_VERSION].json\"\n" " of the first gpu in the system.\n" "[-j=, --json=]\n" - " For a multi-gpu system, a single gpu can be targetted by\n" + " For a multi-gpu system, a single gpu can be targeted by\n" " specifying the gpu-number associated with the gpu of \n" " interest. This number can be determined by running\n" " " APP_SHORT_NAME @@ -943,7 +1041,13 @@ const char *help_message_body = " finds.\n" "[--show-formats] Display the format properties of each physical device.\n" " Note: This only affects text output.\n" - "[--show-promoted-structs] Include structs promoted to core in pNext Chains.\n"; + "[--show-promoted-structs] Include structs promoted to core in pNext Chains.\n" + "[--show-video-props]\n" + " Display the video profile info, video capabilities and\n" + " video format properties of each video profile supported\n" + " by each physical device.\n" + " Note: This only affects text output which by default\n" + " only contains the list of supported video profile names.\n"; void print_usage(const std::string &executable_name) { std::cout << "\n" APP_SHORT_NAME " - Summarize " API_NAME " information in relation to the current environment.\n\n"; @@ -966,6 +1070,7 @@ struct ParsedResults { bool show_tool_props; bool show_formats; bool show_promoted_structs; + bool show_video_props; bool print_to_file; std::string filename; // set if explicitely given, or if vkconfig_output has a argument std::string default_filename; @@ -1018,6 +1123,8 @@ util::vulkaninfo_optional parse_arguments(int argc, char **argv, results.show_formats = true; } else if (strcmp(argv[i], "--show-promoted-structs") == 0) { results.show_promoted_structs = true; + } else if (strcmp(argv[i], "--show-video-props") == 0) { + results.show_video_props = true; } else if ((strcmp(argv[i], "--output") == 0 || strcmp(argv[i], "-o") == 0) && argc > (i + 1)) { if (argv[i + 1][0] == '-') { std::cout << "-o or --output must be followed by a filename\n"; @@ -1105,7 +1212,8 @@ void RunPrinter(Printer &p, ParsedResults parse_data, AppInstance &instance, std IndentWrapper indent(p); for (auto &gpu : gpus) { - DumpGpu(p, *(gpu.get()), parse_data.show_tool_props, parse_data.show_formats, parse_data.show_promoted_structs); + DumpGpu(p, *(gpu.get()), parse_data.show_tool_props, parse_data.show_formats, parse_data.show_promoted_structs, + parse_data.show_video_props); } } } diff --git a/vulkaninfo/vulkaninfo.h b/vulkaninfo/vulkaninfo.h index d19469148..0e96c9baf 100644 --- a/vulkaninfo/vulkaninfo.h +++ b/vulkaninfo/vulkaninfo.h @@ -2,7 +2,7 @@ * Copyright (c) 2015-2021 The Khronos Group Inc. * Copyright (c) 2015-2021 Valve Corporation * Copyright (c) 2015-2021 LunarG, Inc. - * Copyright (c) 2023-2023 RasterGrid Kft. + * Copyright (c) 2023-2024 RasterGrid Kft. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -71,6 +72,7 @@ #endif // _WIN32 #if defined(VK_USE_PLATFORM_XLIB_KHR) || defined(VK_USE_PLATFORM_XCB_KHR) +#include #include #endif @@ -231,20 +233,19 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL DbgCallback(VkDebugReportFlagsEXT msgFlags // Helper for robustly executing the two-call pattern template auto GetVectorInit(const char *func_name, F &&f, T init, Ts &&...ts) -> std::vector { - uint32_t count = 0; + uint32_t count = 32; // Preallocate enough so that most calls only happen once std::vector results; VkResult err; uint32_t iteration_count = 0; - uint32_t max_iterations = 3; + uint32_t max_iterations = 5; do { - err = f(ts..., &count, nullptr); - if (err) THROW_VK_ERR(func_name, err); + count *= 2; results.resize(count, init); err = f(ts..., &count, results.data()); results.resize(count); iteration_count++; - } while (err == VK_INCOMPLETE || iteration_count < max_iterations); - if (err && iteration_count <= max_iterations) THROW_VK_ERR(func_name, err); + } while (err == VK_INCOMPLETE && iteration_count < max_iterations); + if (err) THROW_VK_ERR(func_name, err); return results; } @@ -260,8 +261,12 @@ struct phys_device_features2_chain; struct surface_capabilities2_chain; struct format_properties2_chain; struct queue_properties2_chain; +struct video_profile_info_chain; +struct video_capabilities_chain; +struct video_format_properties_chain; struct AppInstance; struct AppGpu; +struct AppVideoProfile; void setup_phys_device_props2_chain(VkPhysicalDeviceProperties2 &start, std::unique_ptr &chain, AppInstance &inst, AppGpu &gpu, bool show_promoted_structs); @@ -274,7 +279,10 @@ void setup_surface_capabilities2_chain(VkSurfaceCapabilities2KHR &start, std::un void setup_format_properties2_chain(VkFormatProperties2 &start, std::unique_ptr &chain, AppGpu &gpu); void setup_queue_properties2_chain(VkQueueFamilyProperties2 &start, std::unique_ptr &chain, AppGpu &gpu); -void prepare_phys_device_props2_twocall_chain_vectors(std::unique_ptr &chain); +bool prepare_phys_device_props2_twocall_chain_vectors(std::unique_ptr &chain); + +bool is_video_format_same(const VkVideoFormatPropertiesKHR &format_a, const VkVideoFormatPropertiesKHR &format_b); +std::vector> enumerate_supported_video_profiles(AppGpu &gpu); /* An ptional contains either a value or nothing. The optional asserts if a value is trying to be gotten but none exist. * The interface is taken from C++17's with many aspects removed. @@ -321,10 +329,117 @@ struct SurfaceExtension { VkSurfaceKHR (*create_surface)(AppInstance &) = nullptr; void (*destroy_window)(AppInstance &) = nullptr; VkSurfaceKHR surface = VK_NULL_HANDLE; - VkBool32 supports_present = 0; - bool operator==(const SurfaceExtension &other) { - return name == other.name && surface == other.surface && supports_present == other.supports_present; + bool operator==(const SurfaceExtension &other) { return name == other.name && surface == other.surface; } +}; + +struct AppVideoProfile { + bool supported; + + std::string name; + + VkVideoProfileInfoKHR profile_info; + std::unique_ptr profile_info_chain; + + VkVideoCapabilitiesKHR capabilities; + std::unique_ptr capabilities_chain; + + struct Format { + VkVideoFormatPropertiesKHR properties; + std::unique_ptr properties_chain; + }; + std::vector formats; + std::unordered_map> formats_by_category; + + using CreateProfileInfoChainCb = std::function(const void **)>; + using CreateCapabilitiesChainCb = std::function(void **)>; + struct CreateFormatPropertiesChainCb { + std::string format_name; + VkImageUsageFlags image_usage_flags; + std::function check_required_caps; + std::function(void **)> callback; + }; + using CreateFormatPropertiesChainCbList = std::vector; + using InitProfileCb = std::function; + + AppVideoProfile(AppGpu &gpu, VkPhysicalDevice phys_device, const std::string &in_name, + const VkVideoProfileInfoKHR &in_profile_info, CreateProfileInfoChainCb create_profile_info_chain, + CreateCapabilitiesChainCb create_capabilities_chain, + const CreateFormatPropertiesChainCbList &create_format_properties_chain_list, InitProfileCb init_profile) + : supported(true), name(in_name), profile_info(in_profile_info) { + profile_info_chain = create_profile_info_chain(&profile_info.pNext); + if (profile_info_chain == nullptr) { + supported = false; + return; + } + + capabilities.sType = VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR; + capabilities.pNext = nullptr; + capabilities_chain = create_capabilities_chain(&capabilities.pNext); + if (capabilities_chain == nullptr) { + supported = false; + return; + } + + init_profile(*this); + + VkResult result = vkGetPhysicalDeviceVideoCapabilitiesKHR(phys_device, &profile_info, &capabilities); + if (result != VK_SUCCESS) { + supported = false; + return; + } + + VkVideoProfileListInfoKHR profile_list = {VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR, nullptr, 1, &profile_info}; + + std::vector video_format_props{}; + std::vector> video_format_props_chains{}; + for (const auto &create_format_properties_chain_info : create_format_properties_chain_list) { + if (!create_format_properties_chain_info.check_required_caps(capabilities)) { + continue; + } + + VkPhysicalDeviceVideoFormatInfoKHR video_format_info = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR, + &profile_list, + create_format_properties_chain_info.image_usage_flags}; + + uint32_t video_format_property_count = 0; + result = + vkGetPhysicalDeviceVideoFormatPropertiesKHR(phys_device, &video_format_info, &video_format_property_count, nullptr); + if (result != VK_SUCCESS) { + continue; + } + + video_format_props.resize(video_format_property_count); + video_format_props_chains.resize(video_format_property_count); + + for (uint32_t i = 0; i < video_format_property_count; ++i) { + video_format_props[i].sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR; + video_format_props_chains[i] = create_format_properties_chain_info.callback(&video_format_props[i].pNext); + } + + result = vkGetPhysicalDeviceVideoFormatPropertiesKHR(phys_device, &video_format_info, &video_format_property_count, + video_format_props.data()); + if (result == VK_SUCCESS) { + for (uint32_t i = 0; i < video_format_property_count; ++i) { + const VkVideoFormatPropertiesKHR *existing_format = nullptr; + for (const auto &format : formats) { + if (is_video_format_same(format.properties, video_format_props[i])) { + existing_format = &format.properties; + break; + } + } + if (existing_format == nullptr) { + formats.push_back(Format{video_format_props[i], std::move(video_format_props_chains[i])}); + formats_by_category[create_format_properties_chain_info.format_name].push_back(video_format_props[i]); + } else { + formats_by_category[create_format_properties_chain_info.format_name].push_back(*existing_format); + } + } + } + + video_format_props.clear(); + video_format_props_chains.clear(); + } } }; @@ -775,7 +890,7 @@ static void AppDestroyXcbWindow(AppInstance &inst) { #ifdef VK_USE_PLATFORM_XLIB_KHR static void AppCreateXlibWindow(AppInstance &inst) { long visualMask = VisualScreenMask; - int numberOfVisuals; + int numberOfVisuals{}; inst.xlib_display = XOpenDisplay(nullptr); if (inst.xlib_display == nullptr) { @@ -784,12 +899,17 @@ static void AppCreateXlibWindow(AppInstance &inst) { XVisualInfo vInfoTemplate = {}; vInfoTemplate.screen = DefaultScreen(inst.xlib_display); - XVisualInfo *visualInfo = XGetVisualInfo(inst.xlib_display, visualMask, &vInfoTemplate, &numberOfVisuals); + XVisualInfo *visualInfoBegin = XGetVisualInfo(inst.xlib_display, visualMask, &vInfoTemplate, &numberOfVisuals); + XVisualInfo *visualInfoEnd = visualInfoBegin + numberOfVisuals; + const Visual *rootVisual = DefaultVisual(inst.xlib_display, vInfoTemplate.screen); + const XVisualInfo *foundVisualInfo = + std::find_if(visualInfoBegin, visualInfoEnd, [rootVisual](const XVisualInfo &vi) { return vi.visual == rootVisual; }); + const XVisualInfo *visualInfo = foundVisualInfo == visualInfoEnd ? visualInfoBegin : foundVisualInfo; inst.xlib_window = XCreateWindow(inst.xlib_display, RootWindow(inst.xlib_display, vInfoTemplate.screen), 0, 0, inst.width, inst.height, 0, visualInfo->depth, InputOutput, visualInfo->visual, 0, nullptr); XSync(inst.xlib_display, false); - XFree(visualInfo); + XFree(visualInfoBegin); } static VkSurfaceKHR AppCreateXlibSurface(AppInstance &inst) { @@ -1197,10 +1317,10 @@ class AppSurface { surf_present_modes = GetVector("vkGetPhysicalDeviceSurfacePresentModesKHR", vkGetPhysicalDeviceSurfacePresentModesKHR, phys_device, surface_extension.surface); - const VkPhysicalDeviceSurfaceInfo2KHR surface_info2 = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR, nullptr, - surface_extension.surface}; if (inst.CheckExtensionEnabled(VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME)) { + const VkPhysicalDeviceSurfaceInfo2KHR surface_info2 = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR, nullptr, + surface_extension.surface}; VkSurfaceFormat2KHR init{}; init.sType = VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR; surf_formats2 = GetVectorInit( @@ -1398,21 +1518,22 @@ struct AppQueueFamilyProperties { VkQueueFamilyProperties props; uint32_t queue_index; void *pNext = nullptr; // assumes the lifetime of the pNext chain outlives this object, eg parent object must keep both alive - bool is_present_platform_agnostic = true; - VkBool32 platforms_support_present = VK_FALSE; + bool can_present = false; + bool can_always_present = true; + std::vector> present_support; AppQueueFamilyProperties(AppInstance &inst, VkPhysicalDevice physical_device, VkQueueFamilyProperties family_properties, uint32_t queue_index, void *pNext = nullptr) : props(family_properties), queue_index(queue_index), pNext(pNext) { - for (auto &surface_ext : inst.surface_extensions) { + for (const auto &surface_ext : inst.surface_extensions) { + present_support.push_back({surface_ext.name, VK_FALSE}); VkResult err = vkGetPhysicalDeviceSurfaceSupportKHR(physical_device, queue_index, surface_ext.surface, - &surface_ext.supports_present); + &present_support.back().second); if (err) THROW_VK_ERR("vkGetPhysicalDeviceSurfaceSupportKHR", err); - - const bool first = (surface_ext == inst.surface_extensions.at(0)); - if (!first && platforms_support_present != surface_ext.supports_present) { - is_present_platform_agnostic = false; + if (present_support.back().second) { + can_present = true; + } else { + can_always_present = false; } - platforms_support_present = surface_ext.supports_present; } } }; @@ -1466,6 +1587,8 @@ struct AppGpu { std::unique_ptr chain_for_phys_device_features2; std::vector> chain_for_queue_props2; + std::vector> video_profiles; + AppGpu(AppInstance &inst, uint32_t id, VkPhysicalDevice phys_device, bool show_promoted_structs) : inst(inst), id(id), phys_device(phys_device) { vkGetPhysicalDeviceProperties(phys_device, &props); @@ -1689,6 +1812,9 @@ struct AppGpu { } } // TODO buffer - memory type compatibility + + // Video // + video_profiles = enumerate_supported_video_profiles(*this); } ~AppGpu() { vkDestroyDevice(dev, nullptr); } diff --git a/vulkaninfo/vulkaninfo.md b/vulkaninfo/vulkaninfo.md index 8755b415e..952443972 100644 --- a/vulkaninfo/vulkaninfo.md +++ b/vulkaninfo/vulkaninfo.md @@ -75,7 +75,7 @@ OPTIONS: \"VP_VULKANINFO_[DEVICE_NAME]_[DRIVER_VERSION].json\" of the first gpu in the system. [-j=, --json=] - For a multi-gpu system, a single gpu can be targetted by + For a multi-gpu system, a single gpu can be targeted by specifying the gpu-number associated with the gpu of interest. This number can be determined by running vulkaninfo without any options specified. diff --git a/windows-runtime-installer/CMakeLists.txt b/windows-runtime-installer/CMakeLists.txt deleted file mode 100644 index d27bef8ef..000000000 --- a/windows-runtime-installer/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -# ~~~ -# Copyright (c) 2023 Valve Corporation -# Copyright (c) 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. -# ~~~ - -string(TIMESTAMP CURRENT_YEAR "%Y") - -# Keep windows-runtime-installer/VulkanRT-License.txt up to date. -# https://github.com/KhronosGroup/Vulkan-Tools/issues/754 -configure_file( - ${CMAKE_CURRENT_LIST_DIR}/VulkanRT-License.txt.in - ${CMAKE_CURRENT_LIST_DIR}/VulkanRT-License.txt - @ONLY -) diff --git a/windows-runtime-installer/InstallerRT.nsi b/windows-runtime-installer/InstallerRT.nsi deleted file mode 100644 index 63e555c75..000000000 --- a/windows-runtime-installer/InstallerRT.nsi +++ /dev/null @@ -1,165 +0,0 @@ -# The Vulkan runtime installer NSIS script - -!include LogicLib.nsh - -# Input file locations -!define RES "." - -# Input parameters -!ifndef MAJOR - !define MAJOR "1" - !define MINOR "1" - !define PATCH "73" - !define BUILD "0.dev" -!endif -!define VERSION "${MAJOR}.${MINOR}.${PATCH}.${BUILD}" -!ifndef PUBLISHER - !define PUBLISHER "YourCompany, Inc." -!endif -!ifndef COPYRIGHT - !define COPYRIGHT "" -!endif - -# Installer information -Icon ${RES}\V.ico -OutFile "VulkanRT-${VERSION}-Installer.exe" -InstallDir "$PROGRAMFILES\VulkanRT" - -RequestExecutionLevel admin -AddBrandingImage left 150 -Caption "Vulkan Runtime ${VERSION} Setup" -Name "Vulkan Runtime ${VERSION}" -LicenseData "${RES}\VulkanRT-License.txt" -Page custom brandimage "" ": Brand Image" -Page license -Page instfiles - -VIProductVersion "${VERSION}" -VIAddVersionKey "ProductName" "Vulkan Runtime" -VIAddVersionKey "FileVersion" "${VERSION}" -VIAddVersionKey "ProductVersion" "${VERSION}" -VIAddVersionKey "LegalCopyright" "${COPYRIGHT}" -VIAddVersionKey "FileDescription" "Vulkan Runtime Installer" - -Function brandimage - SetOutPath "$TEMP" - SetFileAttributes V.bmp temporary - File "${RES}\V.bmp" - SetBrandingImage "$TEMP/V.bmp" -Functionend - -# Utilties to check if a file is older than this installer or not -Function NeedsReplacing - Pop $0 - - # Extract the version of the existing file - GetDllVersion "$0" $R0 $R1 - IntOp $R2 $R0 >> 16 - IntOp $R2 $R2 & 0xffff - IntOp $R3 $R0 & 0xffff - IntOp $R4 $R1 >> 16 - IntOp $R4 $R4 & 0xffff - IntOp $R5 $R1 & 0xffff - - # Check major versions - ${IF} ${MAJOR} > $R2 - Push True - ${ELSEIF} ${MAJOR} < $R2 - Push False - - # Check minor versions - ${ELSEIF} ${MINOR} > $R3 - Push True - ${ELSEIF} ${MINOR} < $R3 - Push False - - # Check patch versions - ${ELSEIF} ${PATCH} > $R4 - Push True - ${ELSEIF} ${PATCH} < $R4 - Push False - - # Check build versions - ${ELSEIF} ${BUILD} > $R5 - Push True - ${ELSEIF} ${BUILD} < $R5 - Push False - - # If they match exactly, then we update - ${ELSE} - Push True - ${ENDIF} -FunctionEnd - -!macro InstallIfNewer SrcPath OutName - Push "$OUTDIR\${OutName}" - Call NeedsReplacing - Pop $0 - - ${IF} $0 == True - DetailPrint "File $OUTDIR\${OutName} (version $R2.$R3.$R4.$R5) will be upgraded to ${VERSION}" - File /oname=${OutName} "${SrcPath}" - ${ELSE} - DetailPrint "File $OUTDIR\${OutName} (version $R2.$R3.$R4.$R5) will not be replaced with ${VERSION}" - ${ENDIF} -!macroend - -# Utilities to check if this is a 64-bit OS or not -!define IsWow64 `"" IsWow64 ""` -!macro _IsWow64 _a _b _t _f - !insertmacro _LOGICLIB_TEMP - System::Call kernel32::GetCurrentProcess()p.s - System::Call kernel32::IsWow64Process(ps,*i0s) - Pop $_LOGICLIB_TEMP - !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}` -!macroend - -!define RunningX64 `"" RunningX64 ""` -!macro _RunningX64 _a _b _t _f - !if ${NSIS_PTR_SIZE} > 4 - !insertmacro LogicLib_JumpToBranch `${_t}` `${_f}` - !else - !insertmacro _IsWow64 `${_a}` `${_b}` `${_t}` `${_f}` - !endif -!macroend - -# Installer -Section - Delete "$INSTDIR\install.log" - Delete "$INSTDIR\VULKANRT_LICENSE.rtf" - LogSet on - - # Disable filesystem redirection - System::Call kernel32::Wow64EnableWow64FsRedirection(i0) - - ${IF} ${RunningX64} - SetOutPath $WINDIR\System32 - !insertmacro InstallIfNewer "${LOADER64}" "vulkan-1.dll" - !insertmacro InstallIfNewer "${LOADER64}" "vulkan-1-999-0-0-0.dll" - !insertmacro InstallIfNewer "${VULKANINFO64}" "vulkaninfo.exe" - !insertmacro InstallIfNewer "${VULKANINFO64}" "vulkaninfo-1-999-0-0-0.exe" - SetOutPath $WINDIR\SysWOW64 - ${ELSE} - SetOutPath $WINDIR\System32 - ${ENDIF} - - # Install 32-bit contents - !insertmacro InstallIfNewer "${LOADER32}" "vulkan-1.dll" - !insertmacro InstallIfNewer "${LOADER32}" "vulkan-1-999-0-0-0.dll" - !insertmacro InstallIfNewer "${VULKANINFO32}" "vulkaninfo.exe" - !insertmacro InstallIfNewer "${VULKANINFO32}" "vulkaninfo-1-999-0-0-0.exe" - - # Dump licenses into a the installation directory - SetOutPath "$INSTDIR" - AccessControl::DisableFileInheritance $INSTDIR - AccessControl::SetFileOwner $INSTDIR "Administrators" - AccessControl::ClearOnFile $INSTDIR "Administrators" "FullAccess" - AccessControl::SetOnFile $INSTDIR "SYSTEM" "FullAccess" - AccessControl::GrantOnFile $INSTDIR "Everyone" "ListDirectory" - AccessControl::GrantOnFile $INSTDIR "Everyone" "GenericExecute" - AccessControl::GrantOnFile $INSTDIR "Everyone" "GenericRead" - AccessControl::GrantOnFile $INSTDIR "Everyone" "ReadAttributes" - File "${RES}\VulkanRT-License.txt" - - LogSet off -SectionEnd diff --git a/windows-runtime-installer/NSIS_Security.patch b/windows-runtime-installer/NSIS_Security.patch deleted file mode 100644 index b275aae0a..000000000 --- a/windows-runtime-installer/NSIS_Security.patch +++ /dev/null @@ -1,58 +0,0 @@ -diff --git a/nsis-3.0b3-src/SCons/Config/ms b/nsis-3.0b3-src/SCons/Config/ms -index 32d3d33..d2c4d25 100644 ---- a/nsis-3.0b3-src/SCons/Config/ms -+++ b/nsis-3.0b3-src/SCons/Config/ms -@@ -16,7 +16,7 @@ def entry(x,u): - - defenv['ENTRY_FLAG'] = entry - defenv['MAP_FLAG'] = '/map' --defenv['NODEFLIBS_FLAG'] = '/NODEFAULTLIB' -+#defenv['NODEFLIBS_FLAG'] = '/NODEFAULTLIB' - defenv['C_FLAG'] = '/TC' - defenv['CPP_FLAG'] = '/TP' - defenv['CPP_REQUIRES_STDLIB'] = 0 -@@ -29,7 +29,7 @@ defenv['STDCALL'] = '__stdcall' - msvs_version = float(defenv['MSVS_VERSION'].replace('Exp','')) - if msvs_version >= 8.0: - defenv['EXCEPTION_FLAG'] = '/EHsc' -- defenv.Append(CCFLAGS = ['/GS-']) -+ defenv.Append(CCFLAGS = ['/GS']) - defenv.Append(CPPDEFINES = ['_CRT_SECURE_NO_WARNINGS', '_CRT_NONSTDC_NO_WARNINGS', '_CRT_SECURE_NO_DEPRECATE', '_CRT_NON_CONFORMING_SWPRINTFS']) - defenv['MSVCRT_FLAG'] = '/MT' # Avoid msvcr?0.dll dependency - else: -@@ -43,6 +43,10 @@ if msvs_version >= 11.0: - defenv['SUBSYS_CON'] = '/subsystem:console,5.01' # support windows xp - defenv['SUBSYS_WIN'] = '/subsystem:windows,5.01' # support windows xp - -+if msvs_version >= 14.0: -+ defenv.Append(CCFLAGS = ['/guard:cf']) -+ defenv.Append(LINKFLAGS = ['/guard:cf']) -+ - ### defines - - defenv.Append(CPPDEFINES = [('NSISCALL', '$STDCALL')]) -@@ -143,9 +147,9 @@ stub_env.Append(CCFLAGS = ['/Fa${TARGET}.lst']) # listing file name - stub_env.Append(LINKFLAGS = ['$NODEFLIBS_FLAG']) # no default libraries - stub_env.Append(LINKFLAGS = ['$MAP_FLAG']) # generate map file - --if msvs_version >= 10.0: -- # no relocations that our resource editor ignores -- stub_env.Append(LINKFLAGS = ['/FIXED']) -+#if msvs_version >= 10.0: -+# # no relocations that our resource editor ignores -+# stub_env.Append(LINKFLAGS = ['/FIXED']) - - stub_uenv = stub_env.Clone() - stub_uenv.Append(CPPDEFINES = ['_UNICODE', 'UNICODE']) -diff --git a/nsis-3.0b3-src/Source/exehead/Main.c b/nsis-3.0b3-src/Source/exehead/Main.c -index eb231e7..e4642ce 100644 ---- a/nsis-3.0b3-src/Source/exehead/Main.c -+++ b/nsis-3.0b3-src/Source/exehead/Main.c -@@ -84,6 +84,7 @@ void *g_SHGetFolderPath; - NSIS_ENTRYPOINT_GUINOCRT - EXTERN_C void NSISWinMainNOCRT() - { -+ __security_init_cookie(); - int ret = 0; - const TCHAR *m_Err = _LANG_ERRORWRITINGTEMP; - diff --git a/windows-runtime-installer/README.md b/windows-runtime-installer/README.md deleted file mode 100644 index 81c581251..000000000 --- a/windows-runtime-installer/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Windows Runtime Installer - -This directory contains the files required for building the Windows Vulkan Runtime Installer package. -The runtime installer is a method of delivering a Vulkan loader to system. -The runtime installer is used by the SDK installer. -It is also used by some drivers to ensure that an adequate Vulkan loader is installed on a system. -Additionally, applications may install a runtime to ensure that a minimum loader version is present. - -To build a runtime installer: -1. Get a copy of the Nullsoft Install System (NSIS) version 3.0b3. - Other versions may work, but the patch included in this directory is built against version 3.0b3. - Apply the `NSIS_Security.patch` file provided in this directory to the NSIS source code. - This security patch adds the /DYNAMICBASE /GS, and /guard:cf options to the build. - In addition, it will be necessary to specify NSIS_CONFIG_LOG=yes and NSIS_MAX_STRLEN=8192 when compiling. - Once you have applied the patch, compile NSIS with the command: - ``` - scons SKIPUTILS="NSIS Menu","MakeLangId" UNICODE=yes \ - ZLIB_W32=\zlib-1.2.7-win32-x86 NSIS_MAX_STRLEN=8192 \ - NSIS_CONFIG_LOG=yes NSIS_CONFIG_LOG_TIMESTAMP=yes \ - APPEND_CCFLAGS="/DYNAMICBASE /Zi" APPEND_LINKFLAGS="/DYNAMICBASE \ - /DEBUG /OPT:REF /OPT:ICF" SKIPDOC=all dist-zip - ``` - -2. The compilation should have created a zip file containing the new NSIS build. - Unzip this file to the location of your choosing. - Download the NSIS Access Control plugin in copy it into the plugin directory in the build you just unzipped. - It may be useful to prepend this NSIS binary directory to your system's path, so that this NSIS will be run when you type "makensis". - Otherwise, you will just have to specify the full path to makensis.exe in the following steps. - It may be useful to verify that all shared libraries in the build have the DYNAMIC_BASE and NX_COMPAT flags set. - -3. Build the Vulkan-Loader repository and this one. - -4. Build the runtime installer from this directory with the command: - ``` - makensis InstallerRT.nsi -DLOADER64="?" -DLOADER32="?" -DVULKANINFO64="?" -DVULKANINFO32="?" - ``` - where the question marks are replaced with the 64 and 32 bit versions of the loader and vulkaninfo builds. diff --git a/windows-runtime-installer/V.bmp b/windows-runtime-installer/V.bmp deleted file mode 100644 index dea3353c3..000000000 Binary files a/windows-runtime-installer/V.bmp and /dev/null differ diff --git a/windows-runtime-installer/V.ico b/windows-runtime-installer/V.ico deleted file mode 100644 index 61166983e..000000000 Binary files a/windows-runtime-installer/V.ico and /dev/null differ diff --git a/windows-runtime-installer/VulkanRT-License.txt b/windows-runtime-installer/VulkanRT-License.txt deleted file mode 100644 index e8cd1a73c..000000000 --- a/windows-runtime-installer/VulkanRT-License.txt +++ /dev/null @@ -1,79 +0,0 @@ -Copyright (c) 2015-2024 The Khronos Group Inc. -Copyright (c) 2015-2024 LunarG, Inc. -Copyright (c) 2015-2024 Valve Corporation - -The Vulkan Runtime is comprised of 100% open-source components (MIT, and -Apache 2.0). The text of such licenses is included below along with the -copyrights. - -ALL INFORMATION HERE IS PROVIDED "AS IS." LUNARG MAKES NO REPRESENTATIONS OR -WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS LIST OR ITS ACCURACY OR -COMPLETENESS, OR WITH RESPECT TO ANY RESULTS TO BE OBTAINED FROM USE OR -DISTRIBUTION OF THE LIST. BY USING OR DISTRIBUTING THIS LIST, YOU AGREE THAT -IN NO EVENT SHALL LUNARG BE HELD LIABLE FOR ANY DAMAGES WHATSOEVER RESULTING -FROM ANY USE OR DISTRIBUTION OF THIS LIST, INCLUDING, WITHOUT LIMITATION, ANY -SPECIAL, CONSEQUENTIAL, INCIDENTAL OR OTHER DIRECT OR INDIRECT DAMAGES. - -=========================Apache 2.0========================= -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 as "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. - -============================MIT============================ - -Copyright (c) 2009 Dave Gamble -Copyright (c) 2015-2024 The Khronos Group Inc. -Copyright (c) 2015-2024 Valve Corporation -Copyright (c) 2015-2024 LunarG, 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. - -============================MIT============================ - -Copyright (c) 2014 joseph werle -Copyright (c) 2015-2024 The Khronos Group Inc. -Copyright (c) 2015-2024 Valve Corporation -Copyright (c) 2015-2024 LunarG, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and/or associated documentation files (the "Materials"), to -deal in the Materials without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Materials, and to permit persons to whom the Materials are -furnished to do so, subject to the following conditions: - -The above copyright notice(s) and this permission notice shall be included in -all copies or substantial portions of the Materials. - -THE MATERIALS ARE 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 MATERIALS OR THE -USE OR OTHER DEALINGS IN THE MATERIALS. diff --git a/windows-runtime-installer/VulkanRT-License.txt.in b/windows-runtime-installer/VulkanRT-License.txt.in deleted file mode 100644 index 06c5f249a..000000000 --- a/windows-runtime-installer/VulkanRT-License.txt.in +++ /dev/null @@ -1,79 +0,0 @@ -Copyright (c) 2015-@CURRENT_YEAR@ The Khronos Group Inc. -Copyright (c) 2015-@CURRENT_YEAR@ LunarG, Inc. -Copyright (c) 2015-@CURRENT_YEAR@ Valve Corporation - -The Vulkan Runtime is comprised of 100% open-source components (MIT, and -Apache 2.0). The text of such licenses is included below along with the -copyrights. - -ALL INFORMATION HERE IS PROVIDED "AS IS." LUNARG MAKES NO REPRESENTATIONS OR -WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS LIST OR ITS ACCURACY OR -COMPLETENESS, OR WITH RESPECT TO ANY RESULTS TO BE OBTAINED FROM USE OR -DISTRIBUTION OF THE LIST. BY USING OR DISTRIBUTING THIS LIST, YOU AGREE THAT -IN NO EVENT SHALL LUNARG BE HELD LIABLE FOR ANY DAMAGES WHATSOEVER RESULTING -FROM ANY USE OR DISTRIBUTION OF THIS LIST, INCLUDING, WITHOUT LIMITATION, ANY -SPECIAL, CONSEQUENTIAL, INCIDENTAL OR OTHER DIRECT OR INDIRECT DAMAGES. - -=========================Apache 2.0========================= -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 as "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. - -============================MIT============================ - -Copyright (c) 2009 Dave Gamble -Copyright (c) 2015-@CURRENT_YEAR@ The Khronos Group Inc. -Copyright (c) 2015-@CURRENT_YEAR@ Valve Corporation -Copyright (c) 2015-@CURRENT_YEAR@ LunarG, 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. - -============================MIT============================ - -Copyright (c) 2014 joseph werle -Copyright (c) 2015-@CURRENT_YEAR@ The Khronos Group Inc. -Copyright (c) 2015-@CURRENT_YEAR@ Valve Corporation -Copyright (c) 2015-@CURRENT_YEAR@ LunarG, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and/or associated documentation files (the "Materials"), to -deal in the Materials without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Materials, and to permit persons to whom the Materials are -furnished to do so, subject to the following conditions: - -The above copyright notice(s) and this permission notice shall be included in -all copies or substantial portions of the Materials. - -THE MATERIALS ARE 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 MATERIALS OR THE -USE OR OTHER DEALINGS IN THE MATERIALS.